More about Property-Based Testing
There is a lot of noise (and hype) about Property-Based Testing (PBT) out there. However, most of the stuff is in the context of functional programming languages.
- David MacIver, the author of Hypothesis, a PBT library for Python, tries to answer the question: What is Property Based Testing?
- Also from David MacIver: In praise of property-based testing
- A series of blog entries about PBT in Java from the developer of jqwik.
- How to Specify it! In Java!
- Know for Sure: An article in Oracle’s Java Magazine about Property-based Testing in Java
- Quickcheck is the original tool for writing property tests. The article links to scores of PBT libraries in dozens of programming languages.
- A nice video from a presentation by Noel Markham in which he motivates and introduces ScalaCheck.
- PropEr Testing: An online-book about Property-Based Testing. The examples use Erlang but most of the contents is generic.
Patterns for PBT
Some of the common patterns used in PBT are described here.
Alternative Tools for the JVM
There are a few alternatives to jqwik if you want to do PBT on the JVM:
- JUnit-Quickcheck: Tightly integrated with JUnit 4, also uses annotations to configure generators.
- QuickTheories: Unlike other systems QuickTheories supports both shrinking and targeted search using coverage data.
- Vavr: The functional library also comes with a property-based testing module.
- jetCheck: A property-based testing library for Java 8+. Works with any testing framework.
- ScalaCheck: A mature property based testing system with shrinking and all, if you prefer Scala to Java.
- test.check for Clojure: Inspired by QuickCheck. Since Clojure does not have static types generators must always be declared explicitly.
- KotlinTest: Has some basic support for PBT. Currently, no shrinking yet.
- Frege, a Haskell for the JVM, comes with a classical QuickCheck implementation. This section from Dierk König’s Frege book provides a short introduction.
Please let me know if you learn about any other maintained library or tool.