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
Hi All. How can we write negative test cases for Logout Operation ? Please place the answer with a few details and if possible add some related object properties. "A tester exposes his/her ability not only by words he/she also proof it by work"
What is bug priority?
What is the main use of preparing traceability matrix and explain the real time usage?
For any web application, what are the possible login features that should be tested?
What do you mean by Cause Effect Graphing? in which standard its mentioned?
What is date driven testing?
what are the typical problems in web testing?
How can data caching have a negative effect on load testing results?
i want to for technical interview question paper along with in tesrviwe Phases i need
As you are working with cmmi level 5 company ,can you tell me what processes you r following as QA engineer?
What types of testing is specifically important for web testing?
IF ASCII_CODE_OF_ENTERED_CHAR is less than 44 THEN reject it ELSE IF ASCII_CODE_OF_ENTERED_CHAR is greater than 56 THEN reject it ELSE it's a digit, so accept it Which one of the following sets of ASCII codes do you use to test the sample code above WITHOUT redundant coverage?
Hi ALl, Can you please list out Q & A for Test Lead,which Interviewer may ask in interview for Test Lead position
any one please send me any test case examples with tabular columns in manual testing
Can you explain a pair-wise defect?