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

explain the 5 types test matrics?

1 Answers   Persistent,


Give me examples for high severity and low priority defects?

3 Answers  


Which are the possible test cases can U write for Combo box validation ?

10 Answers  


Can you tell some body how to test a situation that to sell a share if it reaches 30(present value is 25) and the time limit is 120 days. Every day the market starts from 10 A.M to 3 P.M. it may execute any time with in the time period. Pls tell me the answer.

1 Answers  


what is v.s.s. ?when it is used?

31 Answers   ASO, Infosys, Verisoft,






what is acid testing?

0 Answers   Syntel,


what is Non-Functional testing? & their types?

9 Answers   AppLabs,


IN TEST PLAN DOC, WHAT R THE ASUUMPTIONS MADE BY BY THE TEST ENG?

0 Answers  


what is the test metrics followed if its a small scale company i mean not a cmm level company

1 Answers  


1. what is a test bed ?

2 Answers  


tell me different deft reports ?

0 Answers  


Use-cases can provide useful input into the design of black-box and state-based tests of OO software.is it true

1 Answers   SSC,


Categories