[prog] Unit testing
Terri Oda
terri at zone12.com
Fri Sep 3 11:46:05 EST 2004
On Sep 2, 2004, at 4:32 AM, drichter at essi.fr wrote:
> HBut I have a question: how well should you document your unit tests?
> Mine often
> have code that's difficult to follow because they're just slapped
> together.
> This makes for fast coding, which is important for two reasons. First,
> you want
> a lot of unit tests. Second, your unit tests may be obsolete with the
> next
> revision of the program, so you shouldn't spend too much time on them.
In my experience, if your requirements aren't changing too quickly,
it's worth putting the extra effort in to do at least a little
documentation. If you don't have enough documentation, people have a
tendency to ignore the failures 'cause they haven't a clue how to fix
them. So if you find out someone's ignoring your test results, or
always dumps the problem on your lap because your test makes no sense,
you probably need some more documentation.
I don't know how easy it is with your work, but I've also found that
making the unit tests as small as possible helps with both speed and
ability to document without having them take too much time. I do
realize that having them all small isn't feasible or useful at all
times, but when it works, is seems to work well.
Terri
More information about the Programming
mailing list