Background/motivation: After working through the Unison tour, in particular the section on testing, I feel a little weird about caching property test results. I raised this on the Unison Slack, and we decided that it would be helpful for me to write up an overview of non-deterministic testing as a way to contribute. So, here goes!
Non-deterministic tests generally fall into two categories:
- property tests, where random values are fed into a function to assure a property holds (e.g. to assert that a function is idempotent by checking
fn a == fn (fn a)
.) Examples: QuickCheck (Haskell/Erlang), Hedgehog (Haskell/F#/C#/R/Scala), Hypothesis (Python), elm-test (Elm) - fuzz tests, where a random bytes are given to a program to make sure it behaves properly in the face of malformed input. These tests usually start with a corpus of inputs and mutate them using a genetic algorithm guided by co