Condition coverage is correlated to decision coverage as whenever any decision is to be taken, focus will be on number of possible conditions. Condition Coverage is also known as ‘Predicate Coverage’.
If ((A || B) && C)
{
<< Statements >>
}
Else
{
<< Statements >>
}
The programmatic condition is given by,
If (A||B)
Then
Print C
There are two Boolean Expressions A and B, so the Multiple Condition Coverage is defined as:
According to this explanation, there are 4 test cases for 2 conditions. So, for 3 conditions there will be 8 test cases.
Therefore, for n number of conditions, there are 2n tests.
If {(X or Y) and Z} then
To fulfil condition coverage, Boolean expression X, Y and Z will be evaluated in TRUE and FALSE form, at least once.
The test case for condition coverage is given by:
To satisfy decision coverage, we need to evaluates IF statements in TRUE and FALSE form. Therefore, the test set is expressed as:
To evaluate MCDC, the above test cases are not sufficient. So, in this context, there are 4 more test cases to appropriate decision.
For test case 3, decision outcome = FALSE
For test case 4, decision outcome = TRUE
For test case 5, decision outcome = FALSE
For test case 6, decision outcome = TRUE
From the above observation, the change in Boolean variables can be determined that illustrates change in decision outcomes.
In any decision, there are some possible number of conditions, which can be examined and evaluated by applying Boolean Expression as expressed above.
Advertisement: