¿ªÔÆÌåÓý

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

Re: [TDD] Testing a class which utilizes randomness


Mark Levison
 

All you've done is test with you've approximately built a random number generator. My underlying point was the OP might want to choose a slightly saner problem.

Cheers
Mark


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

?

On Fri, Apr 04, 2014 at 12:23:49PM -0400, Mark Levison wrote:
> Desirable? - by definition - randomness can and should occasionally
> duplicate something. Testing a random number generator is very hard.
>
> Cheers
> Mark

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.

Jarod Eells




--
Mark Levison?| 1 (877) 248-8277 |??|??|?
Certified ScrumMaster Training:??|??|??|??|?
?|?
Proud Sponsor of??and?

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