[Haskell-cafe] Type System vs Test Driven Development

Anthony Cowley acowley at seas.upenn.edu
Wed Jan 5 21:30:26 CET 2011


On Wed, Jan 5, 2011 at 3:02 PM, Jonathan Geddes
<geddes.jonathan at gmail.com> wrote:
>> The Haskell type system is simply not rich enough to guarantee everything you might need.
> Despite all this, I suspect that since Haskell is at a higher level of
> abstraction than other languages, the tests in Haskell must be at a
> correspondingly higher level than the tests in other languages. I can
> see that such tests would give great benefits to the development
> process. I am convinced that I should try to write such tests. But I
> still think that Haskell makes a huge class of tests unnecessary.

The way I think about this is that you want to write tests for things
that can not be usefully represented in the type system. If you have a
parametrically typed function, then the type system is doing a lot of
useful "testing" for you. If you want to make sure that you properly
parse documents in a given format, then having a bunch of examples
that feed into unit tests is a smart move.

Anthony



More information about the Haskell-Cafe mailing list