fuzzcheck alternatives and similar packages
Based on the "Testing" category.
Alternatively, view fuzzcheck alternatives based on common mentions on social networks and blogs.
QuickCheck9.9 0.0 fuzzcheck VS QuickCheckAutomatic testing of Haskell programs.
hedgehog9.9 2.7 fuzzcheck VS hedgehogRelease with confidence, state-of-the-art property testing for Haskell.
hspec9.9 6.7 fuzzcheck VS hspecA Testing Framework for Haskell
tasty9.8 1.3 fuzzcheck VS tastyModern and extensible testing framework for Haskell
DocTest9.8 0.0 fuzzcheck VS DocTestAn implementation of Python's doctest for Haskell
quickcheck-state-machineTest monadic programs using state machine based models
quickspec9.6 0.0 fuzzcheck VS quickspecEquational laws for free
webdriver9.6 0.0 fuzzcheck VS webdriverA Haskell client for the Selenium WebDriver protocol.
genvalidity9.4 2.6 fuzzcheck VS genvalidityValidity and validity-based testing
curl-runnings9.3 0.0 fuzzcheck VS curl-runningsA declarative test framework for quickly and easily writing integration tests against JSON API's.
smallcheck9.3 0.0 fuzzcheck VS smallcheckTest your Haskell code by exhaustively checking its properties
HUnit9.3 0.0 fuzzcheck VS HUnitA unit testing framework for Haskell
ghc-prof-flamegraph9.2 0.0 fuzzcheck VS ghc-prof-flamegraphGenerates data to be used with flamegraph.pl from .prof files.
smartcheck9.0 0.0 fuzzcheck VS smartcheckA Smarter QuickCheck
hspec-wai9.0 0.0 fuzzcheck VS hspec-waiHelpers to test WAI applications with Hspec
checkers8.9 0.0 fuzzcheck VS checkersCheck properties on standard classes and data structures
monad-mock8.9 0.0 fuzzcheck VS monad-mockA Haskell package that provides a monad transformer for mocking mtl-style typeclasses
hspec-golden8.8 0.0 fuzzcheck VS hspec-goldenGolden tests with Hspec
HTF8.8 0.0 fuzzcheck VS HTFHaskell Test Framework
test-framework8.7 0.0 fuzzcheck VS test-frameworkFramework for running and organising QuickCheck test properties and HUnit test cases
fitspec8.7 0.0 fuzzcheck VS fitspecrefine properties for testing Haskell programs
hspec-checkers8.7 0.0 fuzzcheck VS hspec-checkersAllows to use checkers properties from hspec
hspec-expectations8.6 0.0 fuzzcheck VS hspec-expectationsCatchy combinators for HUnit
mockazo8.6 0.0 fuzzcheck VS mockazo👃 Mock your records of functions with ease
tasty-hedgehog8.6 5.9 fuzzcheck VS tasty-hedgehogTasty integration for the Hedgehog property testing library
hedgehog-classes8.6 0.0 fuzzcheck VS hedgehog-classesHedgehog will eat your typeclass bugs
lsp-test8.5 7.1 fuzzcheck VS lsp-testA functional test framework for LSP servers
arion8.3 0.0 fuzzcheck VS arionWatcher and runner for Hspec
tasty-discover8.3 0.0 fuzzcheck VS tasty-discoverTest discovery for the tasty framework.
leancheck8.3 0.0 fuzzcheck VS leancheckenumerative property-based testing for Haskell
hspec-expectations-jsonHspec expectations on JSON Values
should-not-typecheckA HUnit/hspec assertion to verify that an expression does not typecheck
tasty-golden8.2 0.0 fuzzcheck VS tasty-goldenGolden test support for Tasty
doctest-discover8.1 0.0 fuzzcheck VS doctest-discoverEasy way to run doctests via cabal
hspec-golden-aeson8.0 0.0 fuzzcheck VS hspec-golden-aesonUse tests to monitor changes in Aeson serialization
quickcheck-arbitrary-adtTypeclass for generating a list of each instance of a sum type's constructors
faker8.0 0.0 fuzzcheck VS fakerFaker is pure Haskell library for generating fake data.
type-spec7.8 0.0 fuzzcheck VS type-specA tiny EDSL to write type-level-unit tests
test-fixture7.8 0.0 fuzzcheck VS test-fixtureTesting with monadic side-effects
testing-feat7.7 0.0 fuzzcheck VS testing-featFEAT
webdriver-w3c7.7 5.1 fuzzcheck VS webdriver-w3cHaskell bindings for the W3C WebDriver API
swagger-test7.6 0.0 fuzzcheck VS swagger-testProperty based testing tool for Swagger APIs
test-framework-th7.5 0.0 fuzzcheck VS test-framework-thAutomagically (using Template Haskell) generates the Haskell-code you need when using HUnit
StrictCheck7.5 2.1 fuzzcheck VS StrictCheckKeep your laziness in check!
hspec-jenkins7.5 0.0 fuzzcheck VS hspec-jenkinsJenkins-friendly XML formatter for Hspec
tasty-expected-failureMark test cases as expected-failure
test-framework-sandboxtest-sandbox support for the test-framework package
markov-chain-usage-modelComputations for Markov chain usage models
tasty-rerun7.3 0.0 fuzzcheck VS tasty-rerunRerun previous test suite runs to run only failing tests
speculate7.3 0.0 fuzzcheck VS speculateSpeculate laws about Haskell functions
Access the most powerful time series database as a service
Do you think we are missing an alternative of fuzzcheck or a related project?
FuzzCheck is a library much like QuickCheck, except that instead of test the properties of pure functions, it tests the behavior of applicative or monadic code.
For example, with QuickCheck you would check a property of a function as follows:
prop_reverse xs = xs == reverse (reverse xs) >>> quickCheck prop_reverse
This would generate a list of random length and contents, and ensure that the stated property is maintained for each instance.
FuzzCheck is for testing monadic (or applicative) code, which may only be testable in the context of other operations. For example, let's test some simple FFI code:
prop_bs_ffi = do mem <- "allocate buffer" ?> pure malloc n <- "pick a number" ?> return <$> gen (choose (40::Int,100)) "poke" ?> poke <$> arg mem <*> arg n x <- "peek at memory" ?> peek <$> arg mem "make sure it matches" ?> (@?=) <$> arg x <*> arg n "free the buffer" ?> free <$> arg mem
There are just three special details introduced by FuzzCheck, the
operator, and the
"label" ?> action
This runs a
Fuzz action. If an exception occurs, the label is printed
along with the exception.
let x = "Hello" "label" ?> f <$> arg x
This executes a monadic function
f, passing it the argument
x. This is
equivalent to using
f x in the surrounding monad, except that if an
exception is generated, the error report looks like this:
f "Hello": <text of actual exception here>
You may also use
rand, which is just a shorter synonym for QuickCheck's
arbitrary, for generating a type-appropriate random value automatically:
"label" ?> f <$> rand
Another option is to use
gen, which takes for its argument any combinator
from QuickCheck that generates an appropriately typed
Gen value. For
"label" ?> f <$> gen (choose (1,10))
f by passing it a randomly chosen integer from the given range.
If an exception occurs, the actual integer that caused the problem is shown:
f 9: <text of actual exception here>
That's it. To run the test, call
fuzzCheck on the property:
>>> fuzzCheck prop_bs_ffi2 +++ OK, passed 100 tests.
You can use
fuzzCheck' if you want to change the number of tests executed,
or if you want to associate cleanup code with the test after it runs, whether
or not it succeeds.
The role of
?> is to assign a label to each operation (to assist with error
reporting in case of failure), and to execute the
Fuzz action in its
enclosing Monad. A fuzz test may occur within any monad supporting
MonadBaseControl IO (for the purpose of catching exceptions), which
means that if we're testing code in IO, we can limit the use of
?> to only
those cases we expect might fail:
prop_bs_ffi2 = do mem <- malloc n <- "pick a number" ?> return <$> gen (choose (40::Int,100)) "poke" ?> poke <$> arg mem <*> arg n x <- "peek at memory" ?> peek <$> arg mem x @?= n free mem
gen does not mean that that specific function is invoked 100
times at that point in the monadic block. Instead, the entire block passed to
fuzzCheck is executed 100 times, with each occurence of
gen producing a
new value at each run.
Integration with Hspec and HUnit
This all integrates quite nicely with Hspec and Hunit. For example, this is from the smoke tests for this library:
hspec $ it "works with an FFI example" $ fuzzCheck $ do mem <- malloc n <- "pick a number" ?> return <$> gen (choose (40::Int,100)) "poke" ?> poke <$> arg mem <*> arg n x <- "peek at memory" ?> peek <$> arg mem x @?= n free mem
Although this library was written before I had found
Test.QuickCheck.Monadic, the results are somewhat similar (the paper
name instead of
arg is the same).