Clone project locally:
git clone https://github.com/sylvaindecout/jqwik-handson.git
Run tests:
./mvnw clean test
Run mutation coverage:
./mvnw org.pitest:pitest-maven:mutationCoverage
A dedicated package is available in test folder for each exercise. Instructions are available as TODO tasks.
Prerequisite: Java 17+
- Basic properties
- Basic parameter constraints
- Basic providers
- Complex providers
- Complex parameter constraints
- Dependent parameters
- Configuration
- Borderline cases
- Stateful testing
Create property-based tests for a method with null-checks.
Create property-based tests for a value object with basic validity constraints.
Add basic parameter to property-based test by defining a parameter provider method.
Add complex parameter to property-based test by defining a simple arbitrary provider.
Combine parameters of property-based test by defining a complex arbitrary provider as well as custom annotations.
Add a property-based test for a method with dependent arguments, by relying on existing arbitrary providers.
Adapt property-based test to long method execution time.
Define property-based tests in a case for which it is not so straightforward. Consider trade-offs and how you may want to use property-based testing in conjunction with example-based testing.
Leverage property-based testing for a basic state machine.