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 are reviews(eswar)

3 Answers  


how do u perform monkey testing on website? plz dont give definitions? plz tell me some abnormal actions on website?

9 Answers   Accenture,


define Testing of Procedure, Triggers and Functions in data base testing ?

0 Answers   CSS, Hexaware,


what is framework and what is test methodology? (Asked in Zensar Hyderabad today(17-1-12010))

1 Answers   Zensar,


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,






In a systen design to work out the tax to be paid: An employee has Rs 4000 of salary tax free. the next Rs 1500 is taxed at 10% , the next Rs 28000 is taxed at 22% , any further amount is taxed at 40% , the nearest whole Rs, which of these is a valid boundary value analysis test case ???? a)Rs 1500 b)Rs 32001 c)Rs 33501 d) Rs 28000.

2 Answers   ADITI, LinguaNext,


What is bug leakage?

0 Answers  


How will you link the Defect to the Test case? Explain Bug life cycle ?

1 Answers   Crea,


1. Write configuration tests for a web based application. 2. How does a plane turn on ground? Explain with logic. 3. How would you test the volume control for a music system? 4. You have been given an application and you have only 15 mins to test the application. How would you do the testing? 5. Your machine, which is on a network has been disconnected. How you debug the problem? 6. What is the sum of numbers from 1 to 1000? 7. What is the probability that on rolling four dices same number appears on all dices? 8. You have been given 8 identical balls out of which one of them is heavier. How would find the heavier ball in the least number of tries with the help of a balance? Explain 9. There is a disc which has been painted half black and half white. You have been given sensors which could detect white or black colors. The disc is revolving in either clockwise or anticlockwise direction with variable angular speed. Find the minimum number of sensors required to determine the direction of rotation of the disc. 10. 64,54,42,31,20 which number does not fit in the series?

8 Answers   QLogic,


Please give an example of Black Box Testing?

1 Answers  


a newly launched web site is hosted on web server.It is expected that 100 people visit the website every hour and browse 30 pages spending a total 15 minutes. what is the maximum hits/sec that the web server should support this load?justify your answer. need urgently. by rimesh

0 Answers   TCS,


How does u write test scenarios for Television /Refrigerator?

1 Answers  


Categories