[plt-dev] random testing, we need to do more of this

From: Casey Klein (clklein at eecs.northwestern.edu)
Date: Sun Jan 24 08:27:38 EST 2010

Claessen and Hughes emphasize this benefit in the original QuickCheck paper.

"We are convinced that one of the major advantages of using QuickCheck
is that it encourages us to formulate formal specifications, thus
improving our understanding of our programs. While it is open to the
programmer to do this anyway, few really do, perhaps because there is
little short term payoff, and perhaps because a specification is of
less value if there is no check at all that it corresponds to the
implemented program. QuickCheck addresses both these issues: it gives
us short-term payoff via automated testing, and some reason to believe
that properties stated in a module actually hold."

http://www.md.chalmers.se/~koen/Papers/quick.ps (section 6.6)

On Sun, Jan 24, 2010 at 1:10 AM, David Herman <dherman at ccs.neu.edu> wrote:
> I got to have lunch with Jacob last week and he was talking about how QuickCheck really opened his eyes about the value of randomized testing. In particular, he described how it lifts your thinking out of the realm of individual cases to general properties, since you let the engine to the dirty work of generating the cases. IOW, it makes it easier to think about invariants.
> Dave
> On Jan 23, 2010, at 6:06 PM, Robby Findler wrote:
>> Just thought I'd share my coding story of the day.
>> I'm getting ready to make a change to the internal data structure in
>> the image library (normalized shapes; they are a subtype of the full
>> shape data structure that simplifies the structure in certain ways to
>> make it easier to process). So, to get read for this change to the
>> code that produces normalized shapes, I wrote a predicate for
>> normalized shapes and then randomly made up shapes, normalized them,
>> and then checked to see if the result of normalization was, in fact, a
>> normalized shape.
>> And guess what: I had changed the normalized shape slightly a month or
>> so ago and fixed up code in two places incorrectly that this found.
>> This wasn't at all what I was looking for, either!
>> Anyways, yet one more time I've learned that random testing is a big
>> win, so I thought I'd post about it. You should give it a try yourself
>> sometime.
>> Robby
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-dev
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-dev

Posted on the dev mailing list.