Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

QuickTheories

github.com

  • Free plan
  • API
  • Self-hosted
6.8 Club score Visit github.com

What QuickTheories is

QuickTheories is a free, open-source property-based testing library for Java 8. It generates random valid inputs and checks whether defined properties and invariants continue to hold. Its generator DSL supports common Java types, value constraints, and combinations or conversions for custom types. When a property fails, QuickTheories searches for smaller or simpler values that still reproduce the failure, and reports the seed; fixed seeds can make runs deterministic. Tests can run with JUnit, TestNG or another framework, while checkAssert works with assertion libraries such as AssertJ and Hamcrest. The forAll API supports theories using one to four generated values. System properties configure seeds, example counts and shrink attempts, and named profiles allow shared configurations. An experimental coverage feature guides searches toward new code paths, but may reduce performance by about 10% and interfere with JaCoCo or other coverage tools. The library is Apache-2.0 licensed and was produced at NCR Edinburgh as part of a graduate training program.

Who it suits

QuickTheories is for Java developers testing general properties and invariants rather than only hand-written examples. It fits projects using JUnit, TestNG or other test frameworks.

Good to know, and what to watch

  • Generates random valid test inputs
  • Automatic shrinking of failures
  • Reports seeds for reproducibility
  • Works with multiple test frameworks
  • Configurable examples and shrink attempts
  • forAll supports only one to four values
  • Coverage feature is experimental
  • Coverage may reduce performance about 10%
  • Coverage can interfere with JaCoCo

QuickTheories

Free

Free plan

The verdict

QuickTheories helps Java teams explore many generated cases while preserving reproducible failures and smaller counterexamples. Its four-value limit and experimental coverage trade-offs should be considered when configuring tests.

What the maker publishes

Assertions
The checkAssert method lets tests use assertion libraries such as AssertJ and Hamcrest. source
Audience
The README describes the library for Java developers who want to test general properties and invariants of their code. source
Configuration
The QT_SEED, QT_EXAMPLES, and QT_SHRINKS system properties configure the random seed, examples per theory, and shrink attempts. source
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. source
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. source
Generators
Its generator DSL can create common Java types, constrain generated values, and combine or convert generators for custom types. source
How it tests
It checks properties by automatically generating random samples of valid inputs. source
Input generation
It automatically generates random samples of valid inputs to check whether properties hold. source
License
The repository identifies its license as Apache-2.0. source
Maker
The README says QuickTheories was produced at NCR Edinburgh as part of its graduate training program. source
Origin
The project was produced at NCR Edinburgh as part of its graduate training program. source
Profiles
Named profiles can reuse configurations across properties and can be selected with the QT_PROFILE system property. source
Purpose
QuickTheories is a property based testing library for Java 8, described as a Java version of QuickCheck. source
Repeatability
Tests can use a fixed seed for deterministic runs, and QuickTheories reports the seed when a property is falsified. source
Shrinking
It automatically tries to find smaller or simpler values that still falsify a property, without requiring custom shrinking code for each type. source
Test frameworks
QuickTheories can run with JUnit, TestNG, or another test framework. source
Usage limit
The forAll API supports theories over between one and four generated values. source

Checked against the maker's pages on 7 Oct 2026.