[Haskell-cafe] Quickcheck research

Jonathan Fischoff jonathangfischoff at gmail.com
Wed Nov 23 21:14:49 CET 2011

> which makes me think that Arbitrary isn't the right set of
> abstractions for controlling coverage of the value space.

I agree with you Wren. I think what is needed is a library for expressing
the distribution of values for a given type.

I can see several ways of specifying distributions, directly (exponential,
normal, etc), qualitative constraints (a tuple where each value is less
then the next), constraints on moments (MaxEnt), etc, there are many ways
that are not mutually exclusive.

There are other ways to improve quickcheck.

Writing arbitrary instance could be made more declarative. The process of
describing an indicator function that fully determines the set of values
that are valid for my type, and writing the sequence of steps necessary to
make the function efficient could be separated.

Combinatorial species and symbolic combinatorics are too possibilities to
simplify the creation of arbitrary functions. There might be way go from
list of functions to an generator. Something like

make_arb :: [a -> Bool] -> Gen a

That is psuedo code, since you can't reify a function. But that would be
the idea, although I don't think it would work in all cases.

Also, the current quickcheck workflow is to run it until a example of valid
input fails a test. When this happens the example should be used in a
regression. Creating unit tests automatically from failed quickcheck cases
would be a time saver.

Additionally the right type mutation of testing would be a great addition
to quickcheck.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111123/40135f7c/attachment.htm>

More information about the Haskell-Cafe mailing list