Verification · Testing · Property-based tests
Model-based properties
Compare the implementation against a simple reference model.
How to build it
- Write a simple, obviously correct version of the function to compare against.
- Generate random inputs and assert that the real and simple versions return equal results.
- Keep the simple version in the test tree, not in production code.
Signals in a repository
- Test files that define a naive version of a function and compare it with the real one under random inputs.
- fast-check tests built with fc.commands.
In practice
23 repositories run a tool for this check in the scanned set.
hypothesis· 10 reposfast-check· 3 reposproptest· 11 repos