[Haskell-beginners] testing and the culture of Haskell

Isaac Dupree ml at isaac.cedarswampstudios.org
Mon Jan 18 11:19:35 EST 2010

Michael Easter wrote:
> Q: Is TDD advocated the Haskell community? Is it controversial? Is it even
> on the radar?

we're not big on hyped, capitalized words, but many of us like tests. 
There's even a tool, "HPC" (Haskell Program Coverage) that you can use 
when you run your tests to see how much of the code is reached at all by 
the tests.

Actually, in terms of writing tests before writing code (which I 
sometimes do)... what Haskellers often do even more often is to write 
type-signature for functions before they write the function's code. 
This helps testing (i.e. test failure = compile-time type errors) as 
well as thinking about what you want the function to do.  Types are 
generally more useful-for-thinking in FP than in imperative languages

> Q: Note that TDD and "writing tests" are different things. With respect to
> "writing tests", I know
> that HUnit exists and that RWH has a chapter on quality assurance.

I would use QuickCheck first... have you taken a look at it?


More information about the Beginners mailing list