/developers-intuition.hs

QuickCheck property-based testing demo based on John Hughes' talk

Primary LanguageHaskellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Building on developers' intuitions to create effective property-based tests

QuickCheck demo code from a talk by John Hughes.

Usage

If you're a Nix user start by running nix-shell.

Everyone:

$ cabal new-configure && cabal new-build && cabal new-test && echo $?
$ cabal new-repl test:tests
> :load Main
> main
> :m Test.QuickCheck
> :load Coin
> quickCheck Coin.prop_Add''
+++ OK, passed 100 tests:
52% normal
48% overflow

See ./tests for more property-based tests. Comments help explain the incremental refinements.