Re: [HUnit-users] how do you use HUnit?
Status: Beta
Brought to you by:
dherington
|
From: Dean H. <her...@cs...> - 2002-07-15 06:20:35
|
On 14 Jul 2002, Shae Matijs Erisson wrote: > My primary language has been Python, so learning to think in Haskell is > difficult. > I've realized that I don't know how to effectively unit test in a > language that requires my functions to already exist before I test them. I'm not sure I understand what you mean by already existing before test. That the function must be defined for compilation to succeed? If that's what you mean, I don't think Haskell would differ from any other statically typed language, such as Java. (A dynamically typed language might allow execution to begin without all referenced functions being defined. Is this the case with Python?) If you're bothered by having to create stubs in Haskell, note that they can be more concise than in any other language I know: someFunction = undefined > Does anyone have suggestion on how to do unit test first in Haskell? > Could someone describe their process to me? Although I've not had much experience doing Beck-style unit testing, I imagine that I do in Haskell pretty much what one does in any language. I write a/some test(s), implying some feature(s) of the interface to the unit under construction, then code enough of the implementation for the test to pass (which naturally progresses from fixing compilation errors to fixing execution errors). I then repeat as needed to evolve the unit. > thanks, > -- > Shae Matijs Erisson - http://www.webwitches.com/~shae/ Dean |