Can anybody explain me branch/decision coverage with a
example.



Can anybody explain me branch/decision coverage with a example...

Answer / nitin

Branch Coverage reveals, if all branches were executed. (For example, an if-instruction has two branches, the then-branch and the else-branch.)
Decision Coverage reveals, if all decisions evaluated to both true and false. (For example, the decision of an if-instruction is what is between the parentheses.)

if (x > y)
print (x)
else if (x < y)
print (y)
else
print (x,y)

in the above example there are three decisions and 5 branches.
stmt 1 if two branches true or false
stmt 3 else if teo branches true or false
stmt 5 else one branch

so pass values like
x = 2,1,2
y = 1,2,2

so that all three decisions and 5 branches are covered.

Is This Answer Correct ?    14 Yes 4 No

Post New Answer

More Manual Testing Interview Questions

What is the STLC process in your company?

1 Answers   RealPage,


What is system testing? when we use system testing in our project?

2 Answers   Infosys, NSS,


What is Integration Testing?What is Bottom Up & Top Down Testing? What actually the Stub & Driver is? Explain me giving practical example?

3 Answers   IBM, MNC,


what is alpha , beta testing ?

9 Answers   CSS,


What is Reliability Testing

3 Answers   FactSet Systems, Genpact,






What are the cases why parameterization is necessary when load testing the Web server and the database server?

0 Answers  


How do you go about testing a project?

0 Answers  


How a test engineer will convince a test lead when he didn't approve the bug as a report ???

0 Answers  


Test cases for Equity,Bond,Futures and options financial instruments

1 Answers   NIIT,


What is difference between web application and non-web applications?

2 Answers  


2. What resources do you use to learn about Web accessibility?

0 Answers  


What techniques will cause double-byte problems to show up?

0 Answers  


Categories