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.

Condition C1 Condition C2
T Don’t Care
F Don’t Care
Don’t Care T
Don’t Care F

Table 1: C1 and C2 both have at least one T and one F value.

Programming example.

void main (int a, int b)

{

if(a<b && a+b<20)

{

Cout<<”welcome to our tutorials website”<<endl;

if(a*b>50)

cout<<”welcome to T4Tutorials.com”<<endl;

}

else

cout<<”Thank you for your time on our website”<<endl;

}

Test Requirements.

If all test requirements were met, then we can say that we have correctly performed CC criteria.

TR# C1 C2 C3
1 T Don’t care Don’t care
2 F Don’t care Don’t care
3 Don’t care T Don’t care
4 Don’t care F Don’t care
5 Don’t care Don’t care T
6 Don’t care Don’t care F

Now, we can generate test cases from these test requirements.

TC# Test Case C1 C2 C3 T.R met
1 (7,8) T T T 1, 3, 5
2 (8,7) F 2
3 (14,15) T F 1,4
4 (5,6) T T F 1,3,6

Some facts about Condition Coverage criteria (CC).

CC ensures that all conditions must have at least one T and one F value.

CC is weaker than CDC.

CC is weaker than MCDC.

CC is weaker than MCC.