Statement and Decision Coverage

Considering the following pseudo-code, calculate the MINIMUM number of test cases for statement coverage, and the MINIMUM number of test cases for decision coverage respectively.

READ A
READ B
READ C
IF C>A THEN
IF C>B THEN
PRINT "C must be smaller than at least one number"
ELSE
PRINT "Proceed to next stage"
ENDIF
ELSE
PRINT "B can be smaller than C"
ENDIF

A. 3, 3.
B. 2, 3.
C. 2, 4.
D. 3, 2.

Questions by lukaM2i3

Showing Answers 1 - 15 of 15 Answers

ramkumar

  • Aug 1st, 2012
 

A

  Was this answer useful?  Yes

saurabh

  • Jun 27th, 2013
 

Answer id A 3,3
For Statement coverage
First statement is for Read A, Read B, Read C.
2nd Statement is "Print C must be smaller..." and its else part "Proceed to next stage"
3rd Statement is "Print B can be ..."

For Decision Coverage
1st IF C>A
2nd IF C>B
3rd ELSE Part, for decision of IF C>B (In case if C is not > A) is also a decision
Please correct if wrong or explain in detail if my explanation is less.

  Was this answer useful?  Yes

Pradeep

  • Jun 29th, 2015
 

Why we did not consider the else for C not > A in case of branch coverage?

  Was this answer useful?  Yes

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