Le 17/11/2010 02:14, Ted Dunning a écrit :
> It is also desirable to have a way to inject a test generator so that test
> cases can be made deterministic.

Yes, this is what is done in the classes that already have a constructor
argument, the tests do use it and use hard coded funny constants to seed
the generator.

> 
> In Mahout, we did this by having a static method in a utility class for
> getting a standard generator for either testing or normal operation.  This
> has turned out very well.

It's a very good idea for production code, but I am not sure I
understand it's use for test code. Doesn't that induce problems when new
tests are included which change the running order of the tests or when
only one test is run ? In these cases the current state for the
generator will not be the same in each situation. Do tests reseed the
generator when they start ?

Luc

> 
> +1 on using a better default generator.
> 
> On Tue, Nov 16, 2010 at 1:16 PM, Luc Maisonobe <luc.maison...@free.fr>wrote:
> 
>> I would also like to have one generator for each instance
>> set up at construction time. I also think JDKRandomGenerator is probably
>> not a good default and one of the more modern generators we now have
>> could be used like Well19937c.
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to