View Single Post
Old 05-08-08, 08:42 PM   #32 (permalink)
raakeysh
Junior Member
 
raakeysh's Avatar
 
Join Date: Jul 2008
Posts: 18
Thanks: 2
Thanked 0 Times in 0 Posts
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 1 raakeysh is on a distinguished road
Re: ISTQB Questions Papers

Quote:
Originally Posted by mailramaa@gmail.com View Post
Given the following code, which is true about the minimum number of test cases required for full statement and branch coverage:
Read P
Read Q
IF P+Q > 100 THEN
Print “Large”
ENDIF
If P > 50 THEN
Print “P Large”
ENDIF

a) 1 test for statement coverage, 3 for branch coverage
b) 1 test for statement coverage, 2 for branch coverage
c) 1 test for statement coverage, 1 for branch coverage
d) 2 tests for statement coverage, 3 for branch coverage
e) 2 tests for statement coverage, 2 for branch coverage

Answer:
I think
"1 test for statement coverage, 2 for branch coverage" Option "b" is the correct answer,
Any suggestions?

Hi Rama,

I think the correct answer is
c) 1 test for statement coverage, 1 for branch coverage
Explaination -
1. consider value for p = 60 (which is greater than 50, that fulfills 2nd condition)
2. Consider value for Q = 50 (Which fulfills 1st condition, P+Q > 100)

So single test case would cover all statements and all branches.
Please correct me. if I am wrong.
raakeysh is offline   Reply With Quote