Re: Testing a class which utilizes randomness

Steven Gordon <[email protected]> Fri, 4 Apr 2014 11:52:11 -0700
Newsgroups gmane.comp.programming.test-driven-development
Message-ID <CAF7qo6VcSRfjwTsAOrY_sxtVpEeHRucR4kdTNMPoNmc5jt-dLw@mail.gmail.com>
Agreed.

Already suggested that the" history" object is what needs to be TDD-ed.

The fact that randomness is not a good candidate for TDD-ing is just an
interesting side-note.


On Fri, Apr 4, 2014 at 11:50 AM, Ron Jeffries <[email protected]> wrote:

>
>
> I'm pretty sure OP is trying to learn how to TDD, not how to create really
> great random strings.
> :)
> R
>
> On Apr 4, 2014, at 2:48 PM, Steven Gordon <[email protected]> wrote:
>
> This project is presumably using an RNG rather than coding one.
>
> The criteria that matters would be whether the strings being generated
> (using an RNG) is sufficiently random, not whether the sequence of numbers
> that are being used to generate those strings are sufficiently random.
>
> It is quite possible for the RNG to be random enough, but the strings to
> not be.  For example, the long term behavior of the random number generator
> could always create a nice random distribution on bins, but that
> subsequences are not as random. If each string would be created by a
> subsequence rather than individual number, then they would not be random
> enough.
>
> It could make a difference whether or not the size of the character set is
> prime.
>
>
>
> Ron Jeffries
> www.XProgramming.com <http://www.xprogramming.com>
> I know we always like to say it'll be easier to do it now than it
> will be to do it later. Not likely. I plan to be smarter later than
> I am now, so I think it'll be just as easy later, maybe even easier.
> Why pay now when we can pay later?
>
>  
>