Re: Testing a class which utilizes randomness

Ron Jeffries <[email protected]> Fri, 4 Apr 2014 14:36:50 -0400
Newsgroups gmane.comp.programming.test-driven-development
Message-ID <[email protected]>
Jarod,

On Apr 4, 2014, at 1:55 PM, Jarod Eells <[email protected]> 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
www.XProgramming.com
Sometimes I give myself admirable advice, but I am incapable of taking it.
-- Mary Wortley Montagu