External Publication
Visit Post

Why not use smallcheck?

Haskell Community [Unofficial] March 30, 2026
Source

@turion the problem is not the raw performance of inputs generation, the problem is that for a given depth their number grows exponentially. So with default depth 5 a record with 6 fields will generate roughly 5^6 test cases. And if your property takes two of such records, it’s 5^12, almost a quarter of a billion of them. So at this point you start to micromanage smallcheck tweaking depth here and there (which is already annoying) and end up setting depth of 2 for such test. It’s still at least 2^12 test cases, which is probably okayish, but you are barely testing anything with such depth, right?..

Imagine testing a property on strings. What would you like smallcheck to do? Should it limit itself to enumerating ['a'..] for small depth? In such case it would never generate even something very simple, like a string with a space. Or a digit. Or an upper case letter. quickcheck is so much better: in a matter of microseconds it will throw all kinds of inputs on your test property.

Discussion in the ATmosphere

Loading comments...