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?

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

### Replies to This Discussion

Hi KK,

Option d is correct.

-S Sarita
HI Kiran,

The option is a.

Best Regards,
Sireesha/-
What is the correct ans KK ji?
I think correct answer is "D"
D - is the correct answer
@ Sarita, Rashmi, Malini,

Could you please explain the answer in detail why correct ans is 'd' ? thanks!
Correct answer is B: 1 test for statement coverage, 2 for branch coverage
Hi Kiran,

To exercise p + q > 100 & p > 50

I have considered these values.
1) p = 40, q = 50
2) p = 50 , q = 60
3) p = 60, q = 40
4) p = 60, q = 50

that's how i concluded it to be option a.

Best Regards,
Sireesha/-
Hi

Correct answer is (b) 1 test for statement coverage, 2 for branch coverage

This is been asked in ISTQB exam as well

Thanks
Pooja
Hi Pooja,

Best Regards,
Sireesha/-
Hi Mohan ...

Thanks for explaining this ........ I gave the answer as per ISTQB .....

"100% decision coverage always means 100% statement coverage" -- that's true ...

But Decision coverage measures the coverage of conditional branches and Branch coverage measure both conditional and unconditional branshes.

And at 100% coverage they will exactly the same results

Pooja