Quality Testing

Quality is delighting customers

Given the following code, which statement 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, 2 for branch coverag

Views: 271

Reply to This

Replies to This Discussion

I think 'd' is correct answer ( d) 2 tests for statement coverage, 2 for branch coverag )
Hi Kiran,

For Statement Coverage 1 testcase
p = 60, q = 50

For Branch Coverage 2 Testcases
p = 60, q = 50 (For IF conditions True)
P=40, q=40 (For IF condition False)

Regards,
Kalyani
b) 1 test for statement coverage, 2 for branch coverage is the correct answer...
correct ans is b
Answer would be "B".
b is the correct ans

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2021   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service