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

write the negative test cases for pencil based on it's functionality

2 Answers   TCS,


Metrics for Evaluating Application System Testing?

1 Answers   Crea,


plz tell me the difference b/w PB/MF based appl.with examples. Thanks

0 Answers  


what is the difference between Test strategy and test plan?

1 Answers   Crea,


diff b/w test case and test script?

3 Answers   IBM,






!. what are the entry eriteria for functiondity and performance testing ?

1 Answers  


What is interface in software testing???

5 Answers  


Formate of weekly & daily status report means contents in that report

1 Answers   Satyam,


How will you determine if the architecture of any web site is of two tiers, three tiers or multi tier?

0 Answers  


In which way tester get Build A, BUild B, ....Build Z of an application, just explain the process..

5 Answers  


What are drawbacks in system development life cycle

0 Answers  


What is a test requirement?

5 Answers   Covansys,


Categories