FREEDOM251

Freedom251 › Property-Based Testing Tools

QCheck

Free plan Linux

Visit QCheck Alternatives Pricing

QCheck's own site

What QCheck is

QCheck is a free property-based testing library for OCaml, inspired by QuickCheck. It helps developers check properties against generated inputs rather than relying only on individually written examples. Its combinators create generators for lists, arrays, tuples, recursive types, and algebraic types. Generators can be paired with printers and shrinkers to display and minimize counterexamples when a property fails. QCheck2 builds shrinking into its generators, while the project describes QCheck2 as less battle-tested than QCheck. The package collection includes qcheck-core, qcheck-ounit, qcheck-alcotest, qcheck, and ppx_deriving_qcheck; the latter can derive generators from type declarations. Runner options include QCheck_base_runner in qcheck-core and QCheck_runner with OUnit compatibility in qcheck, and integration layers are available for OUnit and Alcotest. For model-based testing, the project points to qcheck-stm for sequential and parallel tests and qcheck-lin for sequential consistency. Installation is available through opam, and the source can be built with make. The minimal qcheck-core package depends only on unix and dune. QCheck is released under the BSD-2-Clause license.

Who it suits

QCheck suits OCaml developers who want to check properties over generated values and inspect minimized failing cases. Its package options support users seeking a minimal core or integrations with OUnit and Alcotest.

What it does well

  • Generators cover lists, arrays, tuples, and recursive types.
  • QCheck2 integrates shrinking into generators.
  • OUnit and Alcotest integration layers are available.
  • qcheck-core depends only on unix and dune.
  • The project uses the BSD-2-Clause license.

What to know first

  • QCheck2 is described as less battle-tested than QCheck.
  • The library supports OCaml.

Plans

PlanBilled and limitsPrice
QCheckOCaml property-based testing library · BSD-2-Clause licenseFree

As github.com lists them, read 7 Oct 2026. The maker's own page has the final word.

Getting started

  1. Install opam if needed for the package installation route.
  2. Choose qcheck-core for a minimal dependency set, or qcheck for QCheck_runner with OUnit compatibility.
  3. Install the selected package with opam.
  4. Use the generator combinators to construct values and define properties to check.
  5. Build from source with make if using the source route.

Verdict

QCheck combines random generation, failure-case shrinking, and several runner and integration options for OCaml testing. The project describes QCheck2 as less battle-tested, so that maturity distinction is worth considering when choosing its API.

Questions

How much does QCheck cost?

The listed QCheck plan is free.

Which language and platform does it support?

QCheck supports OCaml and lists Linux as its platform.

Is QCheck open source?

Yes. The repository identifies the license as BSD-2-Clause.

Which test runners does it support?

The listed options are QCheck_base_runner, QCheck_runner, OUnit, and Alcotest.

Can QCheck reduce failing examples?

Yes. Generators can be paired with printers and shrinkers; QCheck2 integrates shrinking into its generators.

How do I install it?

The project gives opam installation commands for qcheck-core and qcheck. It also says the source can be built with make.

Facts from QCheck's own pages

Core dependencies
The README says qcheck-core depends only on unix and dune and recommends it for a minimal installation. · github.com, 7 Oct 2026
Counterexamples
Generators can be paired with printers and shrinkers to display and minimize counterexamples when a property fails. · github.com, 7 Oct 2026
Documentation
The project documentation site lists documentation for five opam packages, with qcheck-core, qcheck, qcheck-alcotest, and qcheck-ounit at version 0.91 and ppx_deriving_qcheck at 0.9. · c-cube.github.io, 7 Oct 2026
Generators
QCheck includes combinators for constructing random generators, including generators for lists, arrays, recursive types, algebraic types, and tuples. · github.com, 7 Oct 2026
Install
The README gives opam install commands for qcheck-core and qcheck, and says the source can be built with make. · github.com, 7 Oct 2026
Installation
QCheck can be installed through opam, and the README recommends qcheck-core for a minimal dependency set. · github.com, 7 Oct 2026
Integrated shrinking
The README says shrinking is built into QCheck2 generators, so users do not need to hand-write shrinkers for that API. · github.com, 7 Oct 2026
Integrations
The project provides integration layers for OUnit and Alcotest, and the README describes using QCheck with Rely through an npm package. · github.com, 7 Oct 2026
License
The repository identifies its license as BSD-2-Clause and says the code is released under the BSD license. · github.com, 7 Oct 2026
Maintainer
The project page says it is maintained by c-cube, whose GitHub profile identifies Simon Cruanes. · github.com, 7 Oct 2026
Maturity note
The README describes QCheck2 as newer and less battle-tested than QCheck. · github.com, 7 Oct 2026
Model-based testing
The README points to the multicoretests repository for qcheck-stm, which runs sequential and parallel model-based tests, and qcheck-lin, which tests sequential consistency. · github.com, 7 Oct 2026
Package collection
The project provides opam packages including qcheck-core, qcheck-ounit, qcheck-alcotest, qcheck, and ppx_deriving_qcheck. · github.com, 7 Oct 2026
Packages
The project provides opam packages including qcheck-core, qcheck-ounit, qcheck-alcotest, qcheck, and ppx_deriving_qcheck. · github.com, 7 Oct 2026
Purpose
QCheck is a QuickCheck-inspired property-based testing library for OCaml. · github.com, 7 Oct 2026
QCheck2
QCheck2 integrates shrinking into its generators and the README describes it as less battle tested than QCheck. · github.com, 7 Oct 2026
Random generators
QCheck includes combinators for generating values such as lists, arrays, tuples, recursive types, and algebraic types. · github.com, 7 Oct 2026
Test runners
The qcheck-core package includes QCheck_base_runner, and the qcheck package includes QCheck_runner with OUnit compatibility. · github.com, 7 Oct 2026
Type derivation
The ppx_deriving_qcheck package can automatically derive generators from type declarations. · github.com, 7 Oct 2026

Where QCheck stands on Freedom251

Look at these too