5 ms·
When would that be preferable to have nondeterministic random?
by alkonaut 1y ago
When would that be preferable to have nondeterministic random?
- Akronymus 1y agoI don't think I have said anything about it being nondeterministic. You can have a prng seeded from something like the commit hash and have prngs generate the test cases. That still can fail on 1/10 tests for a particular run.
- Jtsummers 1y agoWith PBT you generate an arbitrary number of inputs, ideally they all pass. However it's entirely possible that you have an error in your program and the property only holds for some inputs, but not all. In that case, since each execution starts with a different seed (unless you provide a specific seed, in which case the generated inputs should be exactly the same each time), you may have some executions that always pass, some that always fail, and others that are in between (have a mix of passes and failures). This is expected.