[Haskell-cafe] Type System vs Test Driven Development
Alberto G. Corona
agocorona at gmail.com
Wed Jan 12 13:20:40 CET 2011
2011/1/12 Serge Le Huitouze <serge.lehuitouze at gmail.com>
> Evan Laforge <qdunkan at gmail.com> 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)
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.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe