¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: [TDD] Testing a class which utilizes randomness


 

¿ªÔÆÌåÓý

Jarod,

On Apr 4, 2014, at 1:55 PM, Jarod Eells <jarod+yahoo@...> wrote:

Testing a RNG doesn't have to be hard.
Just have to roll the dice a sufficient number of times and bin out the results.
Then check that the bins are filled according to the expected statistical distribution.
If you want a higher accuracy for your test then make more bins and/or roll more numbers.

I¡¯d advise a little research on this topic. There are issues of runs, alternation, patterns, and many others. It¡¯s quite a subject.

Ron Jeffries
Sometimes I give myself admirable advice, but I am incapable of taking it.
-- Mary Wortley Montagu



Join [email protected] to automatically receive all group messages.