Version: 2.0.x

# Non-deterministic Test Data

The random process of the `TestRandom` is said to be deterministic since, with the initial seed, we can generate a sequence of predictable numbers. So with the same initial seed, it will generate the same sequence of numbers.

By default, the initial seed of the `TestRandom` is fixed. So repeating a generator more and more results in the same sequence:

``import zio._import zio.test.{test, _}import zio.test.TestAspect._test("pseudo-random number generator with fixed initial seed") {  check(Gen.int(0, 100)) { n =>    ZIO.attempt(n).debug.map(_ => assertTrue(true))  }} @@  samples(5) @@  after(Console.printLine("----").orDie) @@  repeat(Schedule.recurs(1))``

Regardless of how many times we repeat this test, the output would be the same:

``9951814851----9951814851----+ pseudo-random numbers with fixed initial seed - repeated: 2Ran 1 test in 522 ms: 1 succeeded, 0 ignored, 0 failed``

The `nondeterministic` test aspect, will change the seed of the pseudo-random generator before each test repetition:

``import zio._import zio.test.{ test, _ }import zio.test.TestAspect._test("pseudo-random number generator with random initial seed on each repetition") {  check(Gen.int(0, 100)) { n =>    ZIO.attempt(n).debug.map(_ => assertTrue(true))  }} @@  nondeterministic @@  samples(5) @@  after(Console.printLine("----").orDie) @@  repeat(Schedule.recurs(1))``

Here is a sample output, which we have different sequences of numbers on each run:

``739173310----428538273----+ pseudo-random number generator with random initial seed on each repetition - repeated: 2Ran 1 test in 733 ms: 1 succeeded, 0 ignored, 0 failed``