[Haskell-cafe] QuickCheck Questions

Duncan Coutts duncan.coutts at googlemail.com
Mon Sep 28 12:29:50 EDT 2009


On Mon, 2009-09-28 at 23:59 +0900, Yusaku Hashimoto 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.

This requires thought and practise. The properties are a partial formal
description of what your program does. You have to decide what your
program is supposed to do. There is no magic here.

Sometimes you find that you adjust your properties to fit the program
and sometimes adjust the program to fit the properties.

To gain experience in thinking about properties of programs you probably
want to look at books and articles and try examples. This is the kind of
thing they teach in CS degrees. It is a matter of training yourself.

Duncan



More information about the Haskell-Cafe mailing list