The quickspec package

[ Tags: bsd3, library, testing ] [ Propose Tags ]

QuickSpec takes your Haskell code and, as if by magic, discovers laws about it. You give QuickSpec a collection of Haskell functions; QuickSpec tests your functions with QuickCheck and prints out laws which seem to hold.

For example, give QuickSpec the functions reverse, ++ and [], and it will find six laws:

reverse [] == []
xs ++ [] == xs
[] ++ xs == xs
reverse (reverse xs) == xs
(xs ++ ys) ++ zs == xs ++ (ys ++ zs)
reverse xs ++ reverse ys == reverse (ys ++ xs)

QuickSpec can find equational laws as well as conditional equations. All you need to supply are the functions to test, as well as Ord and Arbitrary instances for QuickSpec to use in testing; the rest is automatic.

For information on how to use QuickSpec, see the documentation in the main module, QuickSpec. You can also look in the examples directory, for example at Lists.hs, IntSet.hs, or Parsing.hs. To read about how QuickSpec works, see our paper, Quick specifications for the busy programmer.


[Skip to Readme]

Properties

Versions 0.9, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 2
Dependencies base (==4.*), constraints, containers, data-lens-light (>=0.1.1), dlist, QuickCheck (>=2.10), random, reflection, template-haskell, transformers, twee-lib (>=2.1.2), uglymemo [details]
License BSD3
Copyright 2009-2018 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 Fri Feb 23 14:47:06 UTC 2018 by NickSmallbone
Distributions NixOS:0.9.6
Downloads 2896 total (120 in the last 30 days)
Rating 1.75 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-02-23 [all 1 reports]
Hackage Matrix CI

Modules

  • QuickSpec
    • QuickSpec.Explore
      • QuickSpec.Explore.Conditionals
      • QuickSpec.Explore.PartialApplication
      • QuickSpec.Explore.Polymorphic
      • QuickSpec.Explore.Schemas
      • QuickSpec.Explore.Terms
    • QuickSpec.Haskell
      • QuickSpec.Haskell.Resolve
    • QuickSpec.Prop
    • QuickSpec.Pruning
      • QuickSpec.Pruning.Background
      • QuickSpec.Pruning.Twee
      • QuickSpec.Pruning.Types
      • QuickSpec.Pruning.UntypedTwee
    • QuickSpec.Term
    • QuickSpec.Terminal
    • QuickSpec.Testing
      • QuickSpec.Testing.DecisionTree
      • QuickSpec.Testing.QuickCheck
    • QuickSpec.Type
    • QuickSpec.Utils

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for quickspec-2

[back to package description]

QuickSpec: equational laws for free!

QuickSpec takes your Haskell code and, as if by magic, discovers laws about it. You give QuickSpec a collection of Haskell functions; QuickSpec tests your functions with QuickCheck and prints out laws which seem to hold.

For example, give QuickSpec the functions reverse, ++ and [], and it will find six laws:

reverse [] == []
xs ++ [] == xs
[] ++ xs == xs
reverse (reverse xs) == xs
(xs ++ ys) ++ zs == xs ++ (ys ++ zs)
reverse xs ++ reverse ys == reverse (ys ++ xs)

QuickSpec can find equational laws as well as conditional equations. All you need to supply are the functions to test, as well as Ord and Arbitrary instances for QuickSpec to use in testing; the rest is automatic.

For information on how to use QuickSpec, see the documentation. You can also look in the examples directory, for example at List.hs, IntSet.hs, or Parsing.hs. To read about how QuickSpec works, see our paper, Quick specifications for the busy programmer.