Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Predictable random sequence

by Your Mother (Canon)
on Sep 17, 2013 at 14:42 UTC ( #1054456=note: print w/ replies, xml ) Need Help??


in reply to Predictable random sequence

While this is an interesting problem and I liked the answers, especially hdb's, it seems disconnected from your actual need. Predictable, randomized integers for use in unit tests, never changing. It would take one pass with int(rand(...)) for 1 .. $whatever to build a fixture and be done with it; and not risk introducing complications or dependencies on new code. The more code a test has the worse I think.

Update: keszler basically said this already. DERP.


Comment on Re: Predictable random sequence
Download Code
Re^2: Predictable random sequence
by Anonymous Monk on Sep 17, 2013 at 15:40 UTC
Re^2: Predictable random sequence
by Laurent_R (Parson) on Sep 17, 2013 at 16:57 UTC

    I agree that the discussion is interesting and I also agree that generating once a file of pseudo-random numbers is probably the best solution for garanteeing reproductible results in tests.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1054456]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-09-19 16:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (143 votes), past polls