[Haskell-cafe] Haskell performance (again)!
Donald Bruce Stewart
dons at cse.unsw.edu.au
Sun Oct 8 19:22:00 EDT 2006
> On Sun, 2006-10-08 at 15:25 -0700, Jason Dagit wrote:
> > Another good idea when you have a pretty version which is easy to
> > verify for correctness and an ugly version that is harder to verify is
> > to use QuickCheck or SmallCheck and define a property that says both
> > versions are equal for all inputs. Ugly code is notorious for holding
> > bugs, but doing this would help test the ugly code.
> This is exactly how we tested Data.ByteString and to great effect I
> think. We uncovered loads of bugs during testing. The few bugs uncovered
> by our users since it has been released have invariably been in things
> we didn't have QC properties for.
Yes, I agree with this. By checking fast-bug-ugly code against
slow-but-obvious code, we were able to catch bugs before Data.ByteString
was deployed in the outside world, and before the bugs could hurt
anyone. These days, Data.ByteString has some 2000 lines of QC
properties, which are run on ever darcs commit.
More information about the Haskell-Cafe