Condition coverage testing is somewhat similar to the decision coverage testing.Condition coverage testing is also known as the Predict coverage testing in which each Boolean expression is predicted as TRUE or FALSE. In this testing all the outcomes are tested atleast once.
In condition coverage testing the operands which are the part of the if statement are evaluated to both true and false. consider one example as given below :
bool x= … ;
then in this case x and y both are evaluated to both true and false.The condition coverage for both x and y would be
test 1: x = TRUE & y = FALSE
test 2: x = FALSE & y = TRUE
Condition Coverage an contain multiple conditions also.Multiple condition coverage is also known as the condition combination coverage. In multiple condition coverage all the conditions are examined and evaluated. Consider an example as given below :
if( X || Y)
The conditions that might occur are as follows :
test 1: X = TRUE & Y = TRUE
test 2: X = TRUE & Y = FALSE
test 3: X = FALSE & Y= TRUE
test 4: X = FALSE & Y= FALSE
- Almost all the conditions are tested.
- Bugs can be found if present since all the possible conditions are tested.
- If the Boolean expression is large and complex then it is very tedious job to find all the test cases of that expression.