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 are the various techniques you will use as soon as the srs was given to you to speedup the testing?

1791


What is the difference between system testing and integration testing?

908


How to do manual testing of a E-insurance project (end to end process)

3062


How do you determine user soad for a perf test of a Web application?

2136


What is system level testing?

936


What are the different levels of manual testing?

930


How to do integration testing on duster......

1492


what is meant by application server and its functions?

6570


What are the standard you follow in your company to prepare test plan document? Content is same in every standard or not. Also is there any document to read about the testing standards? Thanks in advance for giving me the answer.

1845


What about the test case if the field only takes a certain number of characters or a minimum number?

971


What are the different types of software testing?

936


PLS SEND REAL TIMERS, WHAT IS SOA TESTING..IM TRYING 3+ YR.. I HAVE GOOD KNOWLEDGE ON MANUAL TESTING... NOW IM NEW TO LEARN "SOA TESTING" IS BEST OR NOT? BEFORE LEARNING SOA TESTING ANY SKILLS ARE REQUIRED..... AND NOW WHAT IS THE MARKET FOR SOA TESTING... AND IT IS BASED ON PROGRAMMING OR NOT?

2609


what is a data guidelines?

1948


What is your approach when requirements change continuously?

964


what is API 2.0?

1833