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
Can you do system testing at any stage of sdlc?
Hi, My name is Dinesh.I want to prepare for ISTQB certification , So can anyone please email me the syllabus of it and what is criteria for giving exam.Please email me answers at: dinesh0323@live.com
how to test the case with 5 combination and inputs
Being an Manual tester, what will be the role or activity in test plan ?
What is quality center?
Hi, I am planing to give ISTQB - Foundation level exam. Can anyone forward the ISTQB materials at laxmi_002@rediffmail.com mail ID.
Zenq interview questions for manual testing
can u merge 10GUI map files into a single GUI map file in winrunner?
What is Independant Testing? When and where this type of testing will be performed?
What is the difference between SIT AND IST?
What is an end-to-end testing?
I have an Interview about Guidewire claimcenter,so could you provide any info regd it?.I would really appreciate any kind of help- email at hvshah2001@gmail.com
Can anyone please answer the below question on Manual Testing: Tell me about atleast 5 bugs you come across in your last testing?
There is an opening in our organization Sierra Atlantic, Hyderabad. All Manual test engineers with 2-3 years of experience can forward your resumes to mah_cs82@yahoo.com before May 01, 2008. (Only manual testers) with a covering letter, current CTC and Expected CTC.
What is Test Design?