Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Hi, Below is a question on white box testing. Kindly help
me in answering it. How many test cases are needed to
obtain 100% branch coverage. This question was asked in
ISTQB foudation level exam - Dec21 2008.

Read(A,C)

If(A<10) then Print A;

Endif

If(C>100) then Print C is greater then A

else if(C<100) then print only C

Endif else

Options -
a. 4
b. 3
c. 2
d. 1

Kindly answer with explanation so that it would be easy to
understand

Answer Posted / hima bindu

Number of testcases required for branch coverage will be 2.

In branch coverage we need to check whether all the
branches are exercised.
Here we have 3 branches all If statements we need to
consider.They are A<10,C>100,C<100

Line 1 - Read(A,C)
Line 2 - If(A<10) then
Line 3 - Print A;
Line 4 - Endif
Line 5 - If(C>100)then
Line 6 - Print C is greater then A
Line 7 - else if(C<100) then
Line 8 - print C
Line 9 - End if

So take the values as follows
Testcase 1 : A=5 and C=120
For this set of values Line1 - Line6 are executed

Now for the Line7 - Line9 to be executed take the value of
c as less than 100
So Testcase 2 : A=5(can be any value as Line 2,3,4 are
already exercised in testcase1)and c=80
For this set of values Line7-Line9 will be exercised

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why would we not include these?

1089


iwant know IEEE formate ,how it is used and exactly where it is used? i have details it follows test plan, testcases...etc. i want real time explanation. pls any one give?

1833


Beyond the customary advantages of having a testing group, what are the benefits does a company receive from a well run, automated testing group?

3359


what are the prerequisite conditins to test clientserver and web applications

2072


Can Anbody please send me Daily Work status format in which I can save my daily work activity

2491


Are there more defects in the design phase or in the coding phase?

1362


What are the various techniques in white box testing?

1049


What is the difference between latent and masked defects?

1110


What is showstopper defect?

1138


What are the Important test scenarios which can be used for testing a web site?

1189


Diffrence b/w functional testing,functionality testing,system testing?

2036


What is mean by incident logging system ?

2516


What is difference between cmmi and cmm levels?

1155


write testcases for open dialogbox

1967


Hi, this is not a tech question, i have 4 yrs of experience in Mainframe systems, presently as a mainframe tester in pune, i just want to step towards south locatios(preferable hyd), suggest me the best way to get calls from hyd.

2071