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

What do you mean by Unit Testing, Integration Testing, System Testing, and User Acceptance Testing and when do you do them?

7076


Tell me the algo for convering number into words. Meanse if the number is 4567 then it should print Four Thousand Five Hundred Sixty Seven

1562


What is mean by incident logging system ?

2028


Password is having 6 digit alphanumeric then what are the possible input conditions?

700


what is your daily activities?

1663






can anyone help me in getting unix on manual testing i.e can u forward material & web sites to my mail id (suresh_57599@yahoo.com) to understand how the work flow working on manual testing on unix and the contents.plzzzzzzzz help me its urgent.

1422


To specify the test artifacts involved in testing.

1643


What is bug priority?

829


What are quality assurance and quality control?

657


what are the 3 test tool categories and describe what each can do.

1955


What is baseline testing?

646


what is agile model and spiral maodel?pls explain with an example?

2144


What are some best practices that you should follow when writing test cases?

675


Please send any one latest 3+ years of experience testing tools resumes my mail id is krishnavenimodaliar26@gmail.com

2877


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?

1411