+0
Daily
299
stars
52
forks
14
watchers
255
prs
194
issues
20
releases
README
QuickChick
==========
Description
- 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
Tutorial
- 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
Installation
From OPAM
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
Simple Examples
- 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.
Documentation
The public API of QuickChick is summarized in QuickChickInterface.v.
Top-level Commands
- QuickCheck c
- Sample g
- QCDerive Arbitrary for c
- QCDerive Show for c
- QCDerive ArbitrarySizedSuchThat for (fun x = p)
- QCDerive DecOpt for p
- QCDerive EnumSizedSuchThat for (fun x = p)
- QCDerive 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
More resources
Here is some more reading material:
- Our PLDI 2022 paper on a mechanism for automatically deriving generators, enumerators, and checkers for inductive relations
- Our POPL 2018 paper on a mechanism for automatically deriving generators for inductive relations
- Our ITP 2015 paper on Foundational Property-Based Testing
- Our PLDI 2023 paper on a mechanism for merging multiple inductive relations into one
- Leo's invited talk at CLA on Random Testing in the Coq Proof Assistant
- Catalin's internship topic proposals for 2015
- Catalin's presentation at CoqPL 2015 workshop (2015-01-18)
- Zoe's thesis defense at NTU Athens (2014-09-08)
- Maxime's presentation at the Coq Workshop (2014-07-18)
- Catalin's presentation at the Coq Working Group @ PPS (2014-03-19)
---
Developer's corner
Build dependencies
Dependencies are listed in 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-Top issues
#269Discussion: QuickChick on Windows Coq Platform25 comments · 2022-01-24#168Independent `Show` package12 comments · 2019-06-21#109Invoke QuickChick on current goal11 comments · 2018-10-08#220Universe inconsistency if Princeton VST and QuickChick is required9 comments · 2021-03-16#73Combinator library × eager evaluation = bad performance?8 comments · 2018-05-28#4No generation of functions (verification interesting)8 comments · 2014-09-15#169QuickChick 26 comments · 2019-06-21#87Error: Signature mismatch:6 comments · 2018-06-25
Latest release
v2.1.1 v2.1.1 2025-06-30What's Changed ci: Add Rocq 9.0 by @liyishuai in https://github.com/QuickChick/QuickChick/pull/403 Adapt to coq/coq20371 (Lib.cwd is full_path) by @SkySkimmer in https://github.com/QuickChick/QuickChick/pull/402 Adapt to rocq-prover/rocq20355 by @yannl35133 in https://github.com/QuickChick/QuickChick/pull/404 Adapt to https://github.com/math-comp/math-comp/pull/1415 by @proux01 in https://github.com/QuickChick/QuickChick/pull/405 Fix congruence notation on =9.0 by @SkySkimmer in https://github.com/QuickChick/QuickChick/pull/406 Fix CI for rocq-9.0 and rocq-dev by @Lysxia in https:/