Thursday, March 03, 2005

What good is a coverage tool?

Don't get me wrong, I think a coverage tools gives valuable feedback. But it occurred to me yesterday that you could have a coverage tool reporting 100% when in fact, the true coverage is 0%! That is, you have unit tests that "exercise" ever line of code, but make absolutely no assertions.

It's an extreme example, but it then flags that it is possible to exercise code without making an assertion against the change it creates. Which then leads me to thinking about developers working independently writing tests and checking in code. Therefore, another reason to pair (though it doesn't guarantee that some code will not be "asserted").

Conclusion: coverage tools are good for feedback, but I don't think they should be treated as an end in themselves. They could be lying...

1 Comments:

At 08 March, 2005 13:57, Anonymous Rob said...

I agree that this is a good reason to pair. Having someone sit over your shoulder and say "Why did you put that in, there is no test?" helps, or a more malicous pair who deletes code that doesn't have a test.

Failing this, Jester might help...
http://jester.sourceforge.net/

 

Post a Comment

Links to this post:

Create a Link

<< Home