Thursday, May 26, 2005

How to Misuse Code Coverage

What is code coverage?
There are many different coverage measures. A simple one is to record which lines of code were executed. If a line has never been executed, it's a safe bet you didn't catch any bugs lurking in it. This type of coverage is usually called “statement coverage”.
In this paper, I'll use a somewhat more powerful type. Many commercial tools measure
some variant of this coverage; few measure anything more powerful. Different people use
different names for this type of coverage: "segment coverage", "multiple condition
coverage", "branch coverage" (arguably incorrectly), and so on. I'll use "multiple condition coverage". It measures whether each logical condition in the code has evaluated both true and false (in some execution of the program, not necessarily in the same one).
Post a Comment