QuickCheck
QuickCheck is a property-based testing library, originally developed for Haskell, that generates test cases to check specified properties and can shrink failures to simpler counterexamples.
Learn Haskell by Example
QuickCheck is a Haskell library for property-based testing that generates test data and checks properties across many inputs.
- How it is used
- Tests formalized properties of pure Haskell functions, data types, and modules using generated random inputs.
- How deep it goes
- Explains property execution, generators, Arbitrary instances, shrinking, coverage modifiers, and Stack suites while deferring custom Testable instances.
- Examples
- Uses rot13 symmetry, alphabet rotation closedness, sorting predicates, associative maps, and multi-module Stack test suites.
- What you can do after
- Apply it via QuickCheck and Stack to generate inputs, diagnose weak properties, shrink failures, and run property suites.
Functional Programming in JavaScript
A Haskell library for property-based testing that generates random test cases from specifications.
- How it is used
- Uses pure-function specifications to test many randomized inputs and guard behavior during refactoring.
- How deep it goes
- Explains specifications, generated cases, reports, and JavaScript integration, but does not detail QuickCheck internals.
- Examples
- Demonstrates grade classification and Social Security number validation through generated inputs and pass/fail reports.
- What you can do after
- Evaluate pure functions by writing properties and reviewing randomized test reports.
Read how Functional Programming in JavaScript explains QuickCheck →
Functional Design and Architecture: Examples in Haskell
QuickCheck is a library for property-based testing that generates test inputs and checks specified properties against them.
- How it is used
- Uses generated properties to test pure algorithms and selected effectful scenarios without enumerating cases by hand.
- How deep it goes
- Explains generation, shrinking, bounded success counts, IO execution, and constrained inputs, but stops short of exhaustive verification.
- Examples
- Uses malformed square functions and labyrinth generation with bounded dimensions, exits, wormholes, and runtime interpretation.
- What you can do after
- Diagnoses logical defects through falsified properties and tests interpreted scenarios with generated or deliberately constrained inputs.
Read how Functional Design and Architecture: Examples in Haskell explains QuickCheck →
What to know first
- pure functionA pure function is a function whose result depends only on its explicit inputs and whose evaluation has no externally observable side effects.
- side effectA side effect is an observable change or interaction caused by a computation beyond producing its direct result, such as modifying state or interacting with the external environment.
Related concepts
- property-based testinguses · Property-based testing is a software-testing technique that checks whether specified general properties hold across varied, often automatically generated, inputs.
- shrinkinguses · Shrinking is a test-case minimization technique that reduces a failing input while preserving the failure.
- preconditionuses · A precondition is a condition that must hold before an operation, process, or activity can proceed validly.
- algebraic lawuses · An algebraic law is a general equation or behavioral property that an operation or implementation is expected to satisfy for applicable values.
- librarykind of · A software library is a reusable collection of code or components that provides functionality for other programs to incorporate or invoke.
Questions about QuickCheck
What is QuickCheck?
QuickCheck is a property-based testing library, originally developed for Haskell, that generates test cases to check specified properties and can shrink failures to simpler counterexamples.
Which Manning books explain QuickCheck?
Learn Haskell by Example, Functional Programming in JavaScript and Functional Design and Architecture: Examples in Haskell.
What should I know before learning QuickCheck?
Manning books that teach QuickCheck usually introduce pure function and side effect first.
What is QuickCheck a kind of?
QuickCheck is a kind of library. A software library is a reusable collection of code or components that provides functionality for other programs to incorporate or invoke.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


