[mercury-users] QuickCheck for Mercury?

Richard A. O'Keefe ok at atlas.otago.ac.nz
Mon Oct 30 12:55:50 AEDT 2000


QuickCheck is a really cute little unit testing framework for Haskell
designed and implemented by Koen Claessen and John Hughes.

The basic idea is that you declare properties that some code should
satisfy as functions from arguments (which the QuickCheck package will
generate for you) to Bool or 'prop', and the package will generate
random test cases and report the ones that fail.  There's a bit more
to it than that of course.

This stuff is actually being used to test integrated circuit designs.
It relies crucially on the typeclass machinery:  you declare the type
of an argument and the typeclass system associates that with a random
data generator.  Where the built in ones are not adequate, you can
plug your own in.

It looks to me as though this _should_ port to anything that has a
similar typeclass system, which means Haskell, Clean, or Mercury.  It
would be really nice to have in Mercury.  Has anyone looked at this?

(You'll find the guts of the code in Koen Claessen's thesis; the full
thing is in the GHC 4.08.1 distribution.  Look in fptools/hslibs/util/check)
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list