QuickCheck: Automatic testing of Haskell programs
QuickCheck is a library for random testing of program properties. The programmer provides a specification of the program, in the form of properties which functions should satisfy, and QuickCheck then tests that the properties hold in a large number of randomly generated cases. Specifications are expressed in Haskell, using combinators provided by QuickCheck. QuickCheck provides combinators to define properties, observe the distribution of test data, and define test data generators.
Most of QuickCheck's functionality is exported by the main Test.QuickCheck module. The main exception is the monadic property testing library in Test.QuickCheck.Monadic .
If you are new to QuickCheck, you can try looking at the following resources:
The official QuickCheck manual. It's a bit out-of-date in some details and doesn't cover newer QuickCheck features, but is still full of good advice.
https://begriffs.com/posts/2017-01-14-design-use-quickcheck.html, a detailed tutorial written by a user of QuickCheck.
The quickcheck-instances companion package provides instances for types in Haskell Platform packages at the cost of additional dependencies.
[Skip to Readme]
Modules
[Index] [Quick Jump]
- Test
- Test.QuickCheck
- Test.QuickCheck.All
- Test.QuickCheck.Arbitrary
- Test.QuickCheck.Exception
- Test.QuickCheck.Features
- Test.QuickCheck.Function
- Test.QuickCheck.Gen
- Test.QuickCheck.Modifiers
- Test.QuickCheck.Monadic
- Test.QuickCheck.Monoids
- Test.QuickCheck.Poly
- Test.QuickCheck.Property
- Test.QuickCheck.Random
- Test.QuickCheck.State
- Test.QuickCheck.Test
- Test.QuickCheck.Text
- Test.QuickCheck
Flags
Manual Flags
| Name | Description | Default |
|---|---|---|
| templatehaskell | Build Test.QuickCheck.All, which uses Template Haskell. | Enabled |
Automatic Flags
| Name | Description | Default |
|---|---|---|
| old-random | Build against a pre-1.2.0 version of the random package. | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- QuickCheck-2.17.1.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 1.0, 1.1.0.0, 1.2.0.0, 1.2.0.1, 2.1, 2.1.0.1, 2.1.0.2, 2.1.0.3, 2.1.1, 2.1.1.1, 2.1.2, 2.2, 2.3, 2.3.0.1, 2.3.0.2, 2.4, 2.4.0.1, 2.4.1, 2.4.1.1, 2.4.2, 2.5, 2.5.1, 2.5.1.1, 2.6, 2.7, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.7.5, 2.7.6, 2.8, 2.8.1, 2.8.2, 2.9, 2.9.1, 2.9.2, 2.10, 2.10.0.1, 2.10.1, 2.11, 2.11.1, 2.11.2, 2.11.3, 2.12, 2.12.1, 2.12.2, 2.12.3, 2.12.4, 2.12.5, 2.12.6, 2.12.6.1, 2.13, 2.13.1, 2.13.2, 2.14, 2.14.1, 2.14.2, 2.14.3, 2.15, 2.15.0.1, 2.16.0.0, 2.17.0.0, 2.17.1.0 (info) |
|---|---|
| Change log | changelog |
| Dependencies | base (>=4.14 && <5), containers , data-array-byte , deepseq (>=1.1.0.0), random (>=1.0.0.3 && <1.4), splitmix (>=0.1.0.2 && <0.2), template-haskell (>=2.4), transformers (>=0.3) [details] |
| Tested with | ghc >=8.10 && <9.13, hugs >=0 |
| License | BSD-3-Clause |
| Copyright | 2000-2019 Koen Claessen, 2006-2008 Björn Bringert, 2009-2019 Nick Smallbone |
| Author | Koen Claessen <koen@chalmers.se> |
| Maintainer | Nick Smallbone <nick@smallbone.se> |
| Uploaded | by maximilian_algehed at 2025年10月13日T12:40:28Z |
| Category | Testing |
| Home page | https://github.com/nick8325/quickcheck |
| Bug tracker | https://github.com/nick8325/quickcheck/issues |
| Source repo | head: git clone https://github.com/nick8325/quickcheck this: git clone https://github.com/nick8325/quickcheck(tag 2.16) |
| Distributions | Arch:2.15.0.1, Debian:2.13.2, Fedora:2.14.3, FreeBSD:2.8.1, LTSHaskell:2.15.0.1, NixOS:2.15.0.1, Stackage:2.16.0.0, openSUSE:2.15.0.1 |
| Reverse Dependencies | 819 direct, 8624 indirect [details] |
| Downloads | 443991 total (207 in the last 30 days) |
| Rating | 2.75 (votes: 22) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2025年10月13日 [all 1 reports] |
Readme for QuickCheck-2.17.1.0
[back to package description]This is QuickCheck 2, a library for random testing of program properties. Add `QuickCheck` to your package dependencies to use it in tests or REPL. The quickcheck-instances [1] companion package provides instances for types in Haskell Platform packages at the cost of additional dependencies. The make-hugs script makes a Hugs-compatible version of QuickCheck. It may also be useful for other non-GHC implementations. [1]: http://hackage.haskell.org/package/quickcheck-instances