Question

I have encountered (even in literature) two contradicting opinions related to path vs condition coverage (not branch or edge!). Some say Path coverage is stronger than the condition coverage, some say the opposite.

Having code like this:

If(X<0 OR X>100)
   DoStuff();

Path coverage - 1 test case is needed to cover the path. With X=-1, the second expression will not be tested and possible bug will be missed.
Condition coverage - test cases X=-1 and X=100 are needed to test both conditions.

Am I missing something or condition coverage is really stronger than path coverage?

Condition coverage (ISTQB):

Our next level of coverage is called condition coverage. The basic concept is that, when a decision is made by a complex expression that eventually evaluates to TRUE or FALSE, we want to make sure that each atomic condition is tested both ways.

Practical Insight Into CMMI

Condition coverage measures the true and false outcome of each Boolean subexpression.

References:

Software Testing: Principles and Practices from Srinivasan Desikan,Gopalaswamy Ramesh: page 61

Condition coverage is a much stronger criteria than path coverage, which in turns is a much stronger criteria than statement coverage.

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top