Condition Coverage criteria(CC) in software testing

Condition Coverage criteria(CC) for software testing

According to Condition Coverage (CC) criteria, every condition must be covered. It means that each condition must have at least one True and one False value. Condition coverage and decision coverage have no subsumption relationship.

Important Point: condition coverage testing tests the conditions independently of each other

Condition coverage
Condition coverage

Examples of Condition Coverage Testing

Example 1

if((A>0 || B<7)){

    cout<<"valid input";

}else{

    cout<<"invalid input";

}

Test Cases

TestCaseID A>0 B<7 Final output
1 True Not required True
2 False True True
3 False False False

Example 2

if((A>0) && (A+B<7)){

    cout<<"valid input";

}else{

    cout<<"invalid input";

}

Test Cases

TestCaseID A>0 A+B<7 Final output
1 True True True
2 True False False
3 False Not required False

Example 3

if((A>0 || B<4) && (A+B<7)){

    cout<<"valid input";

}else{

    cout<<"invalid input";

}

Test Cases

TestCaseID A>0 B<4 A+B<7 Final output
1 True don’t care True True
2 True don’t care False False
3 False True True True
4 False True False False
5 False False Not required False

Example 4

int A = 0;

if(A>0){

    cout<<"valid input";

}else{

    cout<<"invalid input";

}

Test Cases

TestCaseID A>0 Final output
1 True True
2 False False

 

Prof.Fazal Rehman Shamil (Available for Professional Discussions)
1. Message on Facebook page for discussions,
2. Video lectures on Youtube
3. Email is only for Advertisement/business enquiries.