[Haskell-cafe] Type System vs Test Driven Development

Erik de Castro Lopo mle+hs at mega-nerd.com
Thu Jan 6 01:26:57 CET 2011

John Zabroski wrote:

> 5. I have a hard time understanding statements like "The difficulties in
> unit testing OO code is coaxing objects into the correct state to test a
> particular property."

This is my direct experience of inheriting code written by others
without any tests and trying to add tests before doing more serious
work on extending and enhancing the code base.

> Difficulty in unit testing OO code is best documented
> in Robert Binder's tome [1],

I'm sure thats a fine book for testing OO code. I'm trying to avoid
OO code as much as possible :-).

My main point was that testing pure functions is easy and obvious
in comparison to test objects with internal state.

Erik de Castro Lopo

More information about the Haskell-Cafe mailing list