quickspec: Equational laws for free
QuickSpec automatically finds equational properties of your program.
Give it an API, i.e. a collection of functions, and it will spit out
equations about those functions. For example, given reverse
, ++
and []
, QuickSpec finds six laws:
xs++[] == xs []++xs == xs reverse [] == [] (xs++ys)++zs == xs++(ys++zs) reverse (reverse xs) == xs reverse xs++reverse ys == reverse (ys++xs)
All you have to provide is:
Some functions and constants to test. These are the only functions that will appear in the equations.
A collection of variables that can appear in the equations (
xs
,ys
andzs
in the example above).Test.QuickCheck.Arbitrary
andData.Typeable.Typeable
instances for the types you want to test.
Consider this a pre-release. Everything is complete but undocumented :) The best place to start is the examples at http://github.com/nick8325/quickspec/tree/master/examples. There is also a paper at http://www.cse.chalmers.se/~nicsma/quickspec.pdf. Everything you need should be in the module Test.QuickSpec.
If you want help, email me!
[Skip to Readme]
Modules
[Index]
Downloads
- quickspec-0.9.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.9, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 2, 2.1, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.2 |
---|---|
Dependencies | array, base (<5), containers, ghc-prim, mtl, QuickCheck, random, spoon (>=0.2), transformers [details] |
License | BSD-3-Clause |
Copyright | 2009-2013 Nick Smallbone |
Author | Nick Smallbone |
Maintainer | nicsma@chalmers.se |
Category | Testing |
Home page | https://github.com/nick8325/quickspec |
Source repo | head: git clone git://github.com/nick8325/quickspec.git -b master |
Uploaded | by NickSmallbone at 2013-02-19T17:59:48Z |
Distributions | NixOS:2.2 |
Reverse Dependencies | 3 direct, 0 indirect [details] |
Downloads | 9877 total (5 in the last 30 days) |
Rating | 2.0 (votes: 2) [estimated by Bayesian average] |
Your Rating | |
Status | Docs uploaded by user Build status unknown [no reports yet] |