• Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    Haskell
  • License
    Other
  • Created about 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Test your Haskell code by exhaustively checking its properties

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.

More Repositories

1

arithmoi

Number theory: primes, arithmetic functions, modular computations, special sequences
Haskell
144
star
2

linear-builder

Strict Text and ByteString builder, which hides mutable buffer behind linear types and takes amortized linear time.
Haskell
86
star
3

tasty-bench

Featherlight benchmark framework, drop-in replacement for criterion and gauge.
Haskell
78
star
4

logict

A continuation-based backtracking logic programming monad
Haskell
75
star
5

bitvec

Bit vectors: 8x less memory, up to 3500x faster than Vector Bool
Haskell
72
star
6

poly

Fast polynomial arithmetic in Haskell (dense and sparse, univariate and multivariate, usual and Laurent)
Haskell
64
star
7

chimera

Lazy infinite compact streams with cache-friendly O(1) indexing and applications for memoization
Haskell
55
star
8

cabal-add

Extend Cabal build-depends from the command line
Haskell
43
star
9

text-rope

A wrapper around Text for fast line/column navigation and logarithmic concatenation
Haskell
36
star
10

tasty-bench-fit

Benchmark a given function for variable input sizes and find out its time complexity
Haskell
24
star
11

mod

Modular arithmetic, promoting moduli to the type level
Haskell
24
star
12

quote-quot

Divide without division
Haskell
15
star
13

infinite-list

Infinite lists aka streams
Haskell
13
star
14

fast-digits

Split integers into digits, blazingly fast
Haskell
12
star
15

rotcev

A wrapper for an arbitrary Vector with O(1) reverse
Haskell
6
star
16

tasty-inspection-testing

Integrate inspection-testing into tasty test suites
Haskell
6
star
17

ntru

Haskell
6
star
18

acme-php-types

Haskell
3
star
19

my-talks

TeX
2
star
20

exp-pairs

Linear programming over exponent pairs
Haskell
2
star
21

ascension

Haskell
2
star
22

integer-roots

Integer roots and perfect powers of arbitrary precision
Haskell
2
star
23

ghc92-segfault

Haskell
1
star
24

arewefastyet-bytestring

1
star
25

perfect

Haskell
1
star
26

arxiv2ebook

Compile papers from arxiv.org to the size of your e-reader's viewport
1
star