Decision Coverage criteria(DC) for software testing

Prof. Fazal Rehman Shamil
Last modified on May 27th, 2019

Decision Coverage criteria(DC) for software testing

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

Decision D1 Decision D2
T Don’t Care
F Don’t Care
Don’t Care T
Don’t Care F

Table 1: D1 and D2 both have at least one T and one F value.

Programming example of decision coverage criteria

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 for decision coverage criteria:

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

TR# Decision D1 Decision D2
1 T Don’t Care
2 F Don’t Care
3 Don’t Care T
4 Don’t Care F

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

TC# Test Case D1 D2 T.R met
1 (7,8) T T 1, 3
2 (8,7) F 2
3 (4,5) T F 1,4

 

Some facts about Decision Coverage criteria (CC)

  1. DC ensures that all conditions must have at least one T and one F value.
  2. DC is weaker than CDC.
  3. DC is weaker than MCDC.
  4. DC is weaker than MCC.

 

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.