QCheck
What it is
QCheck is a free, QuickCheck-inspired property-based testing library for OCaml. Developers can create random generators and use generated values to check properties across inputs. Its combinators cover lists, arrays, tuples, recursive types and algebraic types. Generators can be paired with printers and shrinkers to show and reduce counterexamples after a failure; QCheck2 incorporates shrinking into its generators, although the project describes that version as less battle-tested than QCheck. The package collection includes qcheck-core, qcheck-ounit, qcheck-alcotest, qcheck and ppx_deriving_qcheck, which can derive generators from type declarations. Runner options include QCheck_base_runner in qcheck-core and QCheck_runner with OUnit compatibility in qcheck. Integration layers support OUnit and Alcotest. The project also points to qcheck-stm for sequential and parallel model-based tests and qcheck-lin for sequential consistency. Installation is available through opam, and the source can be built with make. The project recommends qcheck-core for a minimal setup; it depends only on unix and dune. The license is BSD-2-Clause.
For and against
For
- Generators cover lists, arrays, tuples and recursive types.
- Printers and shrinkers help reduce failing examples.
- QCheck2 integrates shrinking into its generators.
- Integration layers support OUnit and Alcotest.
- qcheck-core depends only on unix and dune.
Against
- QCheck2 is described as less battle-tested than QCheck.
- The library supports OCaml.
- The minimal package still depends on unix and dune.
The verdict
QCheck offers generators, failure reduction and multiple OCaml test-runner options, with qcheck-core for a minimal dependency set. The project itself cautions that QCheck2 is less battle-tested than QCheck.
Who it suits
QCheck suits OCaml developers who want to test properties using generated inputs rather than relying only on individual examples. Its runners and OUnit and Alcotest integrations are relevant to projects using those tools.
Plans and prices
QCheck
OCaml property-based testing library · BSD-2-Clause license
Read 7 Oct 2026 · github.com
On the record
- Core dependencies
- The README says qcheck-core depends only on unix and dune and recommends it for a minimal installation.github.com · read 7 Oct 2026
- Counterexamples
- Generators can be paired with printers and shrinkers to display and minimize counterexamples when a property fails.github.com · read 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 · read 7 Oct 2026
- Generators
- QCheck includes combinators for constructing random generators, including generators for lists, arrays, recursive types, algebraic types, and tuples.github.com · read 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 · read 7 Oct 2026
- Installation
- QCheck can be installed through opam, and the README recommends qcheck-core for a minimal dependency set.github.com · read 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 · read 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 · read 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 · read 7 Oct 2026
- Maintainer
- The project page says it is maintained by c-cube, whose GitHub profile identifies Simon Cruanes.github.com · read 7 Oct 2026
- Maturity note
- The README describes QCheck2 as newer and less battle-tested than QCheck.github.com · read 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 · read 7 Oct 2026
- Package collection
- The project provides opam packages including qcheck-core, qcheck-ounit, qcheck-alcotest, qcheck, and ppx_deriving_qcheck.github.com · read 7 Oct 2026
- Packages
- The project provides opam packages including qcheck-core, qcheck-ounit, qcheck-alcotest, qcheck, and ppx_deriving_qcheck.github.com · read 7 Oct 2026
- Purpose
- QCheck is a QuickCheck-inspired property-based testing library for OCaml.github.com · read 7 Oct 2026
- QCheck2
- QCheck2 integrates shrinking into its generators and the README describes it as less battle tested than QCheck.github.com · read 7 Oct 2026
- Random generators
- QCheck includes combinators for generating values such as lists, arrays, tuples, recursive types, and algebraic types.github.com · read 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 · read 7 Oct 2026