3 ms·
> and also to automatically shrink any counterexamples it finds to be as simple as possible. This actually is a problém with most quickcheck clones (and quickc
by ReleaseCandidat 3y ago
> and also to automatically shrink any counterexamples it finds to be as simple as possible.
This actually is a problém with most quickcheck clones (and quickcheck itself), that's why it's better to use a library that is inspired by Python's Hypothesis (combining generation and shrinking, in a nutshell). So Hedgehog for Haskell and F# (instead of Fscheck) and Rapid for Go https://github.com/flyingmutant/rapid https://github.com/flyingmutant/rapid
But tables and property tests complement each other, even if you can get rid of some tables by using property testing.
Example article about the shrinking of Hypothesis vs. Quickcheck
https://hypothesis.works/articles/integrated-shrinking/ https://hypothesis.works/articles/integrated-shrinking/
- lloydatkinson 3y agoI’ve recently started using property based testing in C# using FsCheck. The FsCheck docs are already pretty unclear with poor examples, and the C# snippets are tiny and barely explained. I want to use it more but it’s actually quite painful to even understand how to achieve the thing I want. I briefly looked at Hedgehog which seems to have even less documentation let alone anything helpful for C#. Just started reading that link and I agree, I’ve found it confusing how FsCheck has Arbritary and Gen. Are there any other differences?
- ReleaseCandidat 3y agoYes, sadly the documentation of both could be way better. If somebody doesn't know property testing already (for example by using Hypothesis in Python), it is really hard to both learn the concept and the actual usage of the libraries (and their concepts) at the same time. But it is quite strange that there is no C# alternative to FsCheck, I would have thought there would be. I'm sorry I can't help much more.
- eru 3y agoYes, Hypothesis is great! See also my response at https://news.ycombinator.com/item?id=39215177 https://news.ycombinator.com/item?id=39215177 I was fortunate enough to have met the author of Hypothesis, David R. MacIver, in London a few years ago. In addition to better shrinking, Hypothesis also has a few more tricks up its sleeves compared to QuickCheck.