[plt-scheme] FastTest random testing library

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Tue Sep 23 20:36:57 EDT 2008

I've just updated FastTest to Planet version (3 2).  FastTest is an
automated, randomized test case generation library inspired by
QuickCheck [1].  This is the first version with Scribble documentation
and follows a fairly major redesign, so check it out if you've been
using one of the older versions.  The new design no longer has a
"generator" type, and instead produces random values directly, which
makes custom random distributions a little more natural to write - for
instance, you can write:

(list 'posn (random-integer) (random-integer)),

whereas before you might write:

(generate (random-apply list (nonrandom 'posn) (random-int-between
-1000 1000) (random-int-between -1000 1000))).

The SchemeUnit integration now makes use of keywords for its optional
arguments, which may make code more readable:

(test-random #:name "Example"
 ([x (random-integer) #:where (odd? x)]
  [y (random-integer) #:where (odd? y)])
 (check-pred even? (+ x y)))

Check out FastTest at:

Carl Eastlund

[1] Claessen, K. and J. Hughes. QuickCheck: a lightweight tool for
random testing of Haskell programs. In ACM SIGPLAN International
Conference on Functional Programming, pages 268–279, 2000.

Posted on the users mailing list.