Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

QuickChick/QuickChick

Randomized Property-Based Testing Plugin for Coq

QuickChick/QuickChick.json
{
"createdAt": "2014-04-03T22:36:19Z",
"defaultBranch": "master",
"description": "Randomized Property-Based Testing Plugin for Coq",
"fullName": "QuickChick/QuickChick",
"homepage": "",
"language": "Rocq Prover",
"name": "QuickChick",
"pushedAt": "2025-11-23T21:27:26Z",
"stargazersCount": 276,
"topics": [
"coq",
"testing"
],
"updatedAt": "2025-11-23T21:27:31Z",
"url": "https://github.com/QuickChick/QuickChick"
}

CircleCI project chat

  • Randomized property-based testing plugin for Coq; a clone of [Haskell QuickCheck]
  • Includes a [foundational verification framework for testing code]
  • Includes a [mechanism for automatically deriving generators for inductive relations]

[Haskell QuickCheck] !: https://hackage.haskell.org/package/QuickCheck

[foundational verification framework for testing code] !: http://prosecco.gforge.inria.fr/personal/hritcu/publications/foundational-pbt.pdf

[mechanism for automatically deriving generators for inductive relations] !: https://lemonidas.github.io/pdf/GeneratingGoodGenerators.pdf

  • Small tutorials on Basic Usage and Automation can be found under tutorials/
  • An extended introduction can be found in [QuickChick: Property-Based Testing in Coq][sfqc] (Software Foundations, Volume 4)

[sfqc] !: https://softwarefoundations.cis.upenn.edu/qc-current/index.html

# Add the Coq opam repository (if you haven't already)
opam repo add coq-released https://coq.inria.fr/opam/released
opam update
# Install the coq-quickchick opam package
opam install coq-quickchick
  • examples/Tutorial.v
  • examples/RedBlack
  • examples/stlc
  • examples/ifc-basic

Running make tests in the top-level QuickChick folder will check and execute all of these. If successful, you should see “success” at the end.

The public API of QuickChick is summarized in QuickChickInterface.v.

  • QuickCheck c
  • Sample g
  • Derive Arbitrary for c
  • Derive Show for c
  • Derive ArbitrarySizedSuchThat for (fun x => p)
  • Derive DecOpt for p
  • Derive EnumSizedSuchThat for (fun x => p)
  • Derive ArbitrarySizedSuchThat for (fun x => let (x1,x2...) := x in p)
  • QuickCheckWith args c
  • MutateCheck c p
  • MutateCheckWith args c p
  • MutateCheckMany c ps
  • MutateCheckManyWith args c ps

Here is some more reading material:


Dependencies are listed in [coq-quickchick.opam]!(./coq-quickchick.opam).

# To get the dependencies, add the Coq opam repository if you haven't already
opam repo add coq-released https://coq.inria.fr/opam/released
opam update
opam install . --deps-only
dune build
dune runtest
dune install coq-quickchick # Makes QuickChick available globally
dune build @cram