[Newbies] Generating a predictable 'atRandom' result for testing

John Almberg jalmberg at identry.com
Mon Aug 13 01:51:16 UTC 2007


Actually, eventually I *would* like to test the random distribution  
of the results, but as a first go, I'm trying to test the rest of the  
method, that varies with the randomness.

-- John

On Aug 12, 2007, at 8:08 PM, Kyle Hamilton wrote:

> If you can test it for lack-of-randomness, I would presume that  
> you're not trying to test the randomness.
>
> I would create a wrapper to 'get number' -- if the test harness is  
> loaded and a flag is set, have that wrapper return an entry from an  
> array or such, and if not, use atRandom.
>
> -Kyle H
>
> On Aug 12, 2007, at 11:51 AM, John Almberg wrote:
>
>> I'm trying to write a test for a method that uses atRandom to  
>> choose a random integer. Is there a way to seed the random number  
>> generator to generate a predictable sequence of numbers, so I end  
>> up with testable results?
>>
>> TIA: John
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marketing for On-line Collectible Dealers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Identry, LLC
John Almberg
(631) 546-5079
jalmberg at identry.com
www.identry.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




More information about the Beginners mailing list