
2011/1/12 Serge Le Huitouze
Evan Laforge
wrote: ..... So, in addition to defining the approximation (not always easy as I tried to "demonstrate" above) to be used in comparisons, one probably needs ad'hoc generators whose complexity might very well exceed that of the code one wants to test... So, do you have any "methodology" for such use cases?
For this reason whenever the space of test cases is difficult to cover or when the border cases are not know well due to the complexity of the code, I created the package properties (http://hackage.haskell.org/package/properties) . http://hackage.haskell.org/package/properties The idea is to check the relevant subset of the test space that is precisely the one that the real application generates, so no extra generator coding are needed while at the same time making sure that the property holds for all the real data. It is in essence, a library that permits assertions of properties defined somewhere else . (something that assert does not permit). and a mechanism to create informative messages. I did´nt use it very mucho owever. Theoreticaly I found it a good idea. Alberto
--Serge
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe