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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the Difference between Network testing and Web Testing?

1728


Can anyone please answer the below question on Manual Testing: Tell me about atleast 5 bugs you come across in your last testing?

1589


what are all the possible Test Cases for VoIP based applications

1264


What is the different between SIT and UIT?

885


There are some features to improve the performance of a Product. What are those factors?

1611






1.what is the approach while writing test cases in your project. 2.tell some intresting scenareo in your project

1825


Explain stub in testing point of view?

708


what is entry and exit criteria and explain it?

1028


What is localization testing (l10n testing)?

751


Test cases have written according to Flow of the software working or according to Screens?

1458


What is Traditional testing & Object Oriented testing?

1965


What is neutral test case?

1815


from where do u collect test data if u miss some data what will happen

2188


What are the bugs we cannot find in black box?

692


Relative to other technical groups in the company? Relative to your staff?

1509