19 Oct
2005
19 Oct
'05
12:21 a.m.
On Tue, 18 Oct 2005, Philippa Cowderoy <flippa@flippac.org> wrote:
If you've got a decent chunk of test data or don't mind generating it with QuickCheck odds are you can spot it reasonably quickly when it happens.
When I write a parser I usually also write a pretty-printer (or ugly-printer) plus the following property: prop_parsePretty x = parse (pretty x) == x Randomly generating abstract syntax trees using QuickCheck is often straightforward. I can't remember ever having found a bug in code that has passed this kind of test. (But I guess that I haven't written parsers for very complicated languages...) -- /NAD