- Home
- Property-Based Testing Tools
- QuickTheories
QuickTheories
What it is
QuickTheories is a free property-based testing library for Java 8. It checks properties and invariants by generating random valid inputs, allowing developers to exercise many cases without writing each one individually. Its generator DSL can create common Java types, constrain values, and combine or convert generators for custom types. When a property fails, QuickTheories searches for smaller or simpler values that still expose the problem, and reports the seed so the run can be reproduced. Tests may use a fixed seed for deterministic runs. The library works with JUnit, TestNG, or other test frameworks, and its checkAssert method can use assertion libraries such as AssertJ and Hamcrest. The forAll API supports theories with one to four generated values. System properties can configure the seed, examples per theory, and shrink attempts; named profiles can reuse configurations. An experimental coverage feature can steer search toward examples that exercise new code paths, but may reduce performance by about 10% and interfere with JaCoCo or other coverage systems. QuickTheories is available under the Apache-2.0 license and was produced at NCR Edinburgh as part of its graduate training program.
For and against
For
- Generates random valid inputs for property checks.
- Shrinks failing cases without custom shrinking code per type.
- Reports seeds to help reproduce failures.
- Works with JUnit, TestNG, and other frameworks.
- Free under the Apache-2.0 license.
Against
- The forAll API supports one to four generated values.
- Experimental coverage guidance may reduce performance by about 10%.
- Coverage guidance may interfere with JaCoCo or other coverage systems.
The verdict
QuickTheories provides Java developers with generated property checks, failing-case shrinking, and reproducible seeds at no cost. Its experimental coverage guidance has stated performance and compatibility caveats.
Who it suits
It suits Java developers who want to test general properties and invariants across generated inputs. It may be useful to teams already using JUnit, TestNG, or another test framework.
Plans and prices
QuickTheories
Open source Java library · Apache-2.0 license
Read 7 Oct 2026 · github.com
On the record
- Assertions
- The checkAssert method lets tests use assertion libraries such as AssertJ and Hamcrest.github.com · read 7 Oct 2026
- Audience
- The README describes the library for Java developers who want to test general properties and invariants of their code.github.com · read 7 Oct 2026
- Configuration
- The QT_SEED, QT_EXAMPLES, and QT_SHRINKS system properties configure the random seed, examples per theory, and shrink attempts.github.com · read 7 Oct 2026
- Coverage guidance
- An experimental coverage feature can focus search on examples exercising new code paths; the README says it may reduce performance by about 10% and interfere with JaCoCo or other coverage systems.github.com · read 7 Oct 2026
- Coverage limitation
- Coverage guidance attaches an agent to the JVM, can reduce performance by about 10%, and may interfere with JaCoCo or other coverage systems.github.com · read 7 Oct 2026
- Generators
- Its generator DSL can create common Java types, constrain generated values, and combine or convert generators for custom types.github.com · read 7 Oct 2026
- How it tests
- It checks properties by automatically generating random samples of valid inputs.github.com · read 7 Oct 2026
- Input generation
- It automatically generates random samples of valid inputs to check whether properties hold.github.com · read 7 Oct 2026
- License
- The repository identifies its license as Apache-2.0.github.com · read 7 Oct 2026
- Maker
- The README says QuickTheories was produced at NCR Edinburgh as part of its graduate training program.github.com · read 7 Oct 2026
- Origin
- The project was produced at NCR Edinburgh as part of its graduate training program.github.com · read 7 Oct 2026
- Profiles
- Named profiles can reuse configurations across properties and can be selected with the QT_PROFILE system property.github.com · read 7 Oct 2026
- Purpose
- QuickTheories is a property based testing library for Java 8, described as a Java version of QuickCheck.github.com · read 7 Oct 2026
- Repeatability
- Tests can use a fixed seed for deterministic runs, and QuickTheories reports the seed when a property is falsified.github.com · read 7 Oct 2026
- Shrinking
- It automatically tries to find smaller or simpler values that still falsify a property, without requiring custom shrinking code for each type.github.com · read 7 Oct 2026
- Test frameworks
- QuickTheories can run with JUnit, TestNG, or another test framework.github.com · read 7 Oct 2026
- Usage limit
- The forAll API supports theories over between one and four generated values.github.com · read 7 Oct 2026