Created abstraction for generating a random string.
Use new abstraction in test functions.