adspace


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

Is anybody have the telecom systems test cases from start to end?

2177


Hi could some one please send me the testplan testcases(for 2Modules) and testscripts for mercry fliht aplication or gmail. please write those on templates and send me.In testplan plase write Testobjective, test scope, est approach, exlusions assumptios.

2195


iam having 2+yr sof exp in manual testing, at present working in chennai,want to relocte to hyd .if any openings let me know.my id : vaniramymail.com

2226


tell me some major and minor defects in ur net banking project?

3722


Can any one share the domain knwoldege of Telecom Jeeva jeevachr@gmail.com

2581


According to RBI rule how much money can be transferred through online banking at one time...?

2981


Hi, I am planing to give ISTQB - Foundation level exam. Can anyone forward the ISTQB materials at laxmi_002@rediffmail.com mail ID.

2023


tell me 3 defects in FRS document, while doing FRS review which u have found in the last 3 years ? could u plz answer brahma412@yahoo.co.in

2572


Did any one completed CSTE certiication? can u send sample question papers? how to apply that? pls send it to my mail id - dsnathi@gmail.com THANKS IN ADVANCE

2272


Did you ever worked with B.A's and when?

2192


1.what kind of testing have you done ?

2940


Hi there Does anybody can respond to my Questions? Is some one there to answer my Questions posted in Software testing category.pls E-mail to sunitht27@yahoo.com

2253


Hello can anybody list out supported and unsupported browsers for Window OS,Android OS,MAC OS Ubuntu

1714


Write down ten test cases for below scenario: Increase the day by 1 and date format should be mm/dd/yyyy Conditions are : date should not be greater then 31 and date<1 month should not be greater then 12 and month<1 year should not be greater then 10000 and year<1 Thanks in advance

2365


What is neutral test case?

2387