[Haskell-cafe] QuickCheck Questions

Gwern Branwen gwern0 at gmail.com
Mon Sep 28 11:14:36 EDT 2009


On Mon, Sep 28, 2009 at 10:59 AM, Yusaku Hashimoto <nonowarn at gmail.com> wrote:
> After a few more investigations, I can say
>
> QuickCheck does:
> - make easy to finding couter-cases and refactoring codes
> - make easy to test some functions if they have good mathematical properties
> - generate random test cases
>
> But QuickCheck does *not*:
> - help us to find good properties
>
> So what I want to know is "how to find good properties." Please let me
> know how do you find QuickCheck properties. There are so many
> tutorials or papers for using QuickCheck, but when I try to apply them
> to my programming, I often miss properties in my codes.
>
> Cheers
> -nwn

I don't think there's any automated way to come up with good properties given a function; that seems tantamount to solving AI.

One thing I've meant to do is look at checkers: http://hackage.haskell.org/package/checkers - which I understand includes a collection of lots of properties for various datatypes and classes. Presumably you could look through it for ideas ('ooh, I forgot that my results should monotonically increase!') or pick the module closest to what you're testing and steal as many of its properties as you can.

-- 
gwern
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090928/233d6a9a/signature.bin


More information about the Haskell-Cafe mailing list