Given the following code, which is true about the minimum number of test casesrequired for full statement and branch coverageRead PRead QIF P+Q > 100 THENPrint "Large"ENDIFIF P > 50 THENPrint "P Large"ENDIFa) 1 test for statement coverage, 3 for branch coverageb) 1 test for statement coverage, 2 for branch coveragec) 1 test for statement coverage, 1 for branch coveraged) 2 tests for statement coverage, 3 for branch coveragee) 2 tests for statement coverage, 2 for branch coverage

Questions by durga_geek

Showing Answers 1 - 21 of 21 Answers

sumit

  • Jan 23rd, 2007
 

option -b

  Was this answer useful?  Yes

Answer is B since we need minimum number of test cases..


For Branch Coverage: As we have two If statements, we need 2 test cases.

One to test If P+Q>100 and another for If P>50.

  Was this answer useful?  Yes

tara

  • Aug 9th, 2007
 

hi,
i have just read the question.
some of our friends saying that we require only one testcase for statement coverage.
this is ok for positive testing.for the negative testing we need one more test case.
example:if they are numbers it is ok.but when we give other other than numbers it must give some error message.
    and also i think for black box testing we need 2 test cases for statement coverage for this example/code.as this is white box testing do we need only one statement coverage.
my answer is option e
if my answer is wrong please let me know.
Tara.

  Was this answer useful?  Yes

option - b) is the correct answer.

1) if p = 51, Q= 50 it will cover all the statements. so, one test for statement coverage.

2) for branch coverage:

a)  P+Q> 100 AND P>50 (True)
b)  P+Q < 100 AND P<50 (False)

a) & b) will cover both the branch conditions
yes, it is an ISTQB question.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions