QCheck review
A focused OCaml library with generators, shrinking, runners, and model-based testing.
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
QCheck is an open-source property-based testing library for OCaml teams. It provides APIs for defining randomized tests, creating built-in or custom generators, printing counterexamples, and shrinking failing cases. The project is suited to developers who want property-based testing inside an OCaml codebase, whether tests are run through QCheck’s own runners or integrated with established OCaml testing frameworks.
Its strongest area is the testing workflow around generated inputs and failures. QCheck includes integrated shrinking in QCheck2, helping reduce failing examples to more useful counterexamples. It also supports command-line and programmatic runners through QCheck_base_runner and QCheck_runner. OUnit and Alcotest integrations give teams options for fitting property-based tests into those test environments, while ppx_deriving_qcheck can automatically derive generators. These capabilities make QCheck more than a basic random-data generator: it covers test definition, failure diagnosis, execution, and framework integration.
QCheck also extends beyond stateless properties through qcheck-stm, which supports sequential and parallel model-based testing. The broader package set includes core libraries, compatibility support, framework integrations, and a preprocessor for generator derivation. QCheck is distributed as OCaml opam packages and can be built from source, so it fits teams already working within the OCaml ecosystem. It is a strong choice for OCaml projects that need shrinking, multiple runner options, and stateful testing. Teams seeking a multi-language tool, a hosted commercial product, or AI-assisted testing should choose another category fit.
QCheck pros and cons
- Where it wins
- Randomized generators with counterexample printing and shrinking
- OUnit, Alcotest, command-line, and programmatic runner support
- Sequential and parallel model-based testing through qcheck-stm
- Where it doesn't
- Supports OCaml rather than multiple programming languages
- Requires an OCaml package or source-based setup
- Does not include AI features
QCheck fact sheet, pricing and score →
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update