
10 Aug
2010
10 Aug
'10
2:34 p.m.
Hi, I'm trying to figure out QuickCheck and how to generate arbitrary test data form complex data structures;
sometimes the following workaround is enough: if you have a function that makes a tree (heap) from a list, then generate an "arbitrary" list, and make the tree from that. of course this might restrict your test set. similarly, if you want to test a property that needs an ordered list (as input), just generate an arbitrary list and use a trusted sort function. oh, and try Smallcheck as well. http://www.cs.york.ac.uk/fp/smallcheck/ Similar idea, but using complete (instead of random) enumeration. Sometimes that's easier to control. Regards, J.W.