typelevel / scalacheck

Property-based testing for Scala
http://www.scalacheck.org
BSD 3-Clause "New" or "Revised" License
1.94k stars 405 forks source link

Feature request: automatically persist failure cases and prioritise their reproduction in the following test runs. #970

Open tribbloid opened 1 year ago

tribbloid commented 1 year ago

In property-based testing, any property should be guaranteed with maximum certainty, a fake assumption that passed all test by mistake may cause catastrophic damage much later.

As a result, failed property check should be automatically persisted to disk, and be given higher priority in the upcoming test runs. The history of all previous failures can be used to determine probability of random test cases being generated.

The current implementation is incapable of doing this, this can results in sporadic failures being ignored and accumulates.

We need an improved implementation to prevent it from happening.

rossabaker commented 1 year ago

Where would it persist to disk by default? Or would it be opt in?

I usually take the inputs and make an explicit test case for it, but this is admittedly manual. It also means I'm not probabilistically checking for regressions, but guaranteed.