[Cuis-dev] Tests

Luciano Notarfrancesco luchiano at gmail.com
Tue Aug 16 10:01:09 PDT 2022


Hi Juan,

On Tue, 16 Aug 2022 at 20:16 Juan Vuletich <juan at cuis.st> wrote:

> Besides, any test I
> write is repeatable, setting Random seeds as needed. I guess you must
> have your reasons to do otherwise...


You set a fixed seed in the test method itself? In that case you run the
exact same test every time. But what I do is set a ‘seed’ instance variable
to a randomly generated value in initialize, and in setUp I set a ‘random’
instance variable to ‘Random seed: seed’. This is essentially what Leandro
implemented in Bee (he added a ‘seed’ instance variable to TestCase). In
this way, test methods can use ‘random’ freely and all is reproducible, but
the seed is not fixed (if I create a new test suite or press the refresh
button on the test runner new seeds are used, and on the long run a much
larger space is covered in the tests).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220817/db8c804d/attachment.htm>


More information about the Cuis-dev mailing list