random value generation

Brandon Michael Moore brandon at its.caltech.edu
Wed Aug 13 16:19:22 EDT 2003


On Wed, 13 Aug 2003, Colin J. Williams wrote:

> Brandon Michael Moore wrote:
> > I'm trying to test a web application using a tool written in python. I
> > would like to be able to generate random values to put in fields. I would
> > like to be able to generate random dates (in a specified range), random
> > strings (specifying allowed characters and a distribution of lengths), or
> > choose randomly between several generators (for better control of the
> > distribution of values).
> >
> > Brandon
> >
> numarray, the package which is being developed to replace Numeric
> has random_array.  It permits one to generate random arrays or
> single values, with a number of statistical distributions.
>
> Colin W.

Thanks, but I want to generate more than just numbers. I'll remember it if
I ever have any monte carlo work to do.

For now all I really need are dates, numeric strings, and alphanumeric
strings. For unit testing the code it would be nice to generate other
things, like objects, or graphs of objects.

How many people out there are doing randomized testing? Are you
generating test data with random.py and bare code, or have you
written libraries to help you define test data generators?
Or are tree structured data and randomized unit testing things
people only do in Haskell-land?

Brandon







More information about the Python-list mailing list