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

Hello again!! wanted to ask you HOW EXACTLY create stubs and driver in integration testing? 2.whats the difference between integration testing and system integration testing? Thanks!!

1950


As you are working with cmmi level 5 company ,can you tell me what processes you r following as QA engineer?

2242


please give information about ERP Projects and how V-model use in project

2617


functional testing test cases for transfer funds ?

1416


Can anyone please suggest me a online book on manual testing??

1576


what is metrics in software testing? give me a brief detail about it?

4544


hi, I m looking for a career in manual web testing. so PLZ anybody who have the practical knowledge of dis field help me. GIVE ME UR MAIL ID so that i can ask regarding some doubts. my MAIL ID is ankurtester819@gmail.com

1717


plz send the test scenarios and test cases for "user name should contain 4 to 8 chars and they should have only vowels"

1973


What is the difference between code walkthrough and code review? What is the difference between walkthrough and inspection?

2709


What are the challenges you faced in your project (Testing) and in your company?

2814


Can you explian $ pillar of Agile

1049


What's the difference between system testing and acceptance testing?

944


ANY ONE HAS ATTENDED THE INTERVIEW FOR WIT INNOVATION P LTD? THEN KINDLY LET ME KNOW ABOUT THE INTERVIEW PROCESS AND QUESTIONS ASKED.

1990


integration test cases for mouse and keyboard

3446


Tell me agile process in your company

6048