Unit tests and random.Random() 
Author Message
 Unit tests and random.Random()

I've got unit tests (oh, that's a good thing, right?) that, alas, are
implemented using whrandom to get their own instances of Wichmann-Hill
generators.

Of course, I've noticed that whrandom is deprecated.  "Use random
instead".  Fine.

Except that, reading the documentation (5.6 random - Generate pseudo-
random numbers), it doesn't appear that random.Random is promising me a
W-H generator, but instead just some unspecified instance of the class
used under the covers by random (which, by fortuitous coincidence,
happens to be a WH implementation, today, but it could change in the
future).

Is there an official position on how code should be written to guarantee
that it gets a WH generator[1]?  And where should I have looked to find
this answer for myself?

Danil



Tue, 29 Jun 2004 11:15:15 GMT  
 Unit tests and random.Random()
[Danil]]

Quote:
> ...
> Is there an official position on how code should be written to guarantee
> that it gets a WH generator[1]?

No, not even a guarantee that there always *will* be a way to get a WH
generator.  It's mounds better than the C library's rand(), but falls
increasingly behind the reasonable state of the art.

Quote:
> And where should I have looked to find this answer for myself?

You had already figured that out yourself, so I'd say you looked in the
right places.


Tue, 29 Jun 2004 12:02:41 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Test::Unit::Mock: Mock objects for testing with Test::Unit

2. random rant on random files

3. A truly random $random??

4. ? generating random uniform and binomial random deviates for BIG integers

5. Random number not random?

6. random behavior in random module?

7. Random Number Generator to produce SAME random number from 12:00am-11:59pm

8. Opening random line from file with random.shuffle()

9. using test::unit for C++ unit tests

10. Instructions for testing the COM Random Stream Sample

11. Random Number Generator Test

12. Random Number Test

 

 
Powered by phpBB® Forum Software