smallcheck: A property-based testing library

[ bsd3, library, testing ] [ Propose Tags ] [ Report a vulnerability ]

As of 2023, this library is largely obsolete: arbitrary test generators with shrinking such as falsify offer much better user experience.

SmallCheck is a testing library that allows to verify properties for all test cases up to some depth. The test cases are generated automatically by SmallCheck.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.2.1, 0.4, 0.5, 0.6, 0.6.1, 0.6.2, 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1, 1.1.0.1, 1.1.1, 1.1.2, 1.1.3, 1.1.3.1, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.2.0, 1.2.1, 1.2.1.1 (info)
Change log CHANGELOG.md
Dependencies base (>=4.3 && <5), ghc-prim (>=0.2 && <1), logict (>=0.5 && <0.9), mtl (<2.4), nats (<1.2), pretty (<1.2), semigroups (<0.21), transformers (<0.7), void (<0.8) [details]
Tested with ghc ==9.6.1, ghc ==9.4.5, ghc ==9.2.7, ghc ==9.0.2, ghc ==8.10.7, ghc ==8.8.4, ghc ==8.6.5, ghc ==8.4.4, ghc ==8.2.2, ghc ==8.0.2, ghc ==7.10.3, ghc ==7.8.4, ghc ==7.6.3, ghc ==7.4.2, ghc ==7.2.2, ghc ==7.0.4
License BSD-3-Clause
Author Colin Runciman, Roman Cheplyaka
Maintainer Andrew Lelechenko <andrew.lelechenko@gmail.com>
Category Testing
Home page https://github.com/Bodigrim/smallcheck
Bug tracker https://github.com/Bodigrim/smallcheck/issues
Source repo head: git clone git://github.com/Bodigrim/smallcheck.git
Uploaded by Bodigrim at 2023-06-04T22:59:05Z
Distributions Arch:1.2.1.1, Debian:1.1.7, Fedora:1.2.1.1, FreeBSD:1.1.1, LTSHaskell:1.2.1.1, NixOS:1.2.1.1, Stackage:1.2.1.1
Reverse Dependencies 26 direct, 147 indirect [details]
Downloads 51110 total (252 in the last 30 days)
Rating 2.0 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-06-04 [all 1 reports]

Readme for smallcheck-1.2.1.1

[back to package description]

SmallCheck: a property-based testing library for Haskell

As of 2023, this library is largely obsolete: arbitrary test generators with shrinking such as falsify offer much better user experience.

SmallCheck is a testing library that allows to verify properties for all test cases up to some depth. The test cases are generated automatically by SmallCheck.

Usefulness of such an approach to testing is based on the following observation:

If a program fails to meet its specification in some cases, it almost always fails in some simple case.

In many ways SmallCheck is very similar to QuickCheck. It uses the idea of type-based generators for test data, and the way testable properties are expressed is closely based on the QuickCheck approach. Like QuickCheck, SmallCheck tests whether properties hold for finite completely defined values at specific types, and reports counter-examples.

The big difference is that instead of using a sample of randomly generated values, SmallCheck tests properties for all the finitely many values up to some depth, progressively increasing the depth used. For data values, depth means depth of construction. For functional values, it is a measure combining the depth to which arguments may be evaluated and the depth of possible results.

The package is based on the paper by Colin Runciman, Matthew Naylor and Fredrik Lindblad.