function X(Y, Z){
if(Y){
foo();
}
if(Z){
bar();
}
}
If you have tests like: X(true, false);
X(false, true);
Then your code coverage from the "line" point of view is 100%. Those two tests execute every line of code. However, the two states: X(true, true);
X(false, false);
have not been tested, and if foo() and bar() both manipulate some global state, or otherwise have side effects, then the system could still break.This is an issue with many code coverage tools. The lines themselves have been executed, but not necessarily all program states.