hedgehog
smallcheck
hedgehog | smallcheck | |
---|---|---|
5 | 3 | |
676 | 134 | |
0.4% | - | |
7.0 | 4.2 | |
about 1 month ago | over 1 year ago | |
Haskell | Haskell | |
BSD 3-clause "New" or "Revised" License | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
hedgehog
-
The sad state of property-based testing libraries
> - rose tree "integrated shrinking" (eg. Hedgehog) follows the constraints of the generators, but has issues with monadic bind.
We're at the limits of my amateur knowledge, but I believe this is a fundamental limitation of monadic bind/generators. Instead, you should prefer applicative generators for ideal shrinking. https://github.com/hedgehogqa/haskell-hedgehog/issues/473#is...
In other words, applicative generators do not use "results of generators to dispatch to another generator", but instead shrinking is optimal due to the "parallel" nature of applicatives (I'm using "parallel" in the monadic sense, and not the sense of article's "threading" sense).
-
Monthly Hask Anything (May 2022)
I've had some PRs open on hedgehog for one and two months respectively. It looks like the maintainer isn't currently very active, which is fair enough. This isn't about criticizing him, and I'm not trying to take over the repo.
-
Monthly Hask Anything (February 2022)
Testing libraries like hedgehog often run tests in parallel, so you may find related issues to work on.
-
Mutation Testing
Haskell has QuickCheck and Hedgehog, and dotnet has both as well. F# is favored, but there's C# interop.
smallcheck
-
Generating Well-Typed Terms that are not "Useless" [pdf]
Using laziness to avoid generating parts of an expression until it's needed is a really nice idea. The LazySmallCheck package[1] took this approach, but was limited in the types of data it could produce (e.g. it couldn't generate functions). This was extended by LazySmallCheck2012[2], but that seems to be unmaintained and doesn't work with more recent GHC versions.
(Note that these are named in reference to SmallCheck[3], which takes the approach of enumerating concrete values in order of "size"; as an alternative to the more widely-used QuickCheck[4], which generates concrete values at random, and tries to "shrink" those which trigger a failure)
[1] https://hackage.haskell.org/package/lazysmallcheck
[2] https://github.com/UoYCS-plasma/LazySmallCheck2012
[3] https://hackage.haskell.org/package/smallcheck
[4] https://hackage.haskell.org/package/QuickCheck
-
[ANN] LeanCheck v1.0.0 – Enumerative Property Testing
Could you compare with https://hackage.haskell.org/package/smallcheck in particular the smallcheck ability "to verify properties for all test cases up to some depth"?
-
Property-based testing #1: What is it anyway?
Another strategy is exhaustive generation. There, all possible values for some type are generated in some well-defined order - typically from "small" to "large" values, and with some upper bound, as once you go past booleans the number of values for most types are (countably) infinite. For example, trying all the integers between -20 and 20 in "zig zag" order 0,1,-1,2,-2,.... SmallCheck for Haskell and SciFe for Scala do this, but this approach is not so well-known. It's a shame as random and exhaustive generation are complementary - if you think of generating values as exploring some large space to find failing tests, random generation is a serendipitous type of exploration, while exhaustive generation is diligently mapping out all the paths in some area.
What are some alternatives?
QuickCheck - Automatic testing of Haskell programs.
leancheck - enumerative property-based testing for Haskell
quickcheck-arbitrary-adt - Typeclass for generating a list of each instance of a sum type's constructors
genvalidity - Validity and validity-based testing
FsCheck - Random Testing for .NET
http-test - Tests for HTTP APIs
tasty - Modern and extensible testing framework for Haskell
ghc-prof-flamegraph
quickcheck-instances - Instances for QuickCheck classes
smallcheck-series - Orphan Series/CoSeries instances for common types
fixie - 🚴 Opininated testing framework for mtl style (spies, stubs, and mocks)