nerdexam
BCS-ISEB

BH0-010 · Question #292

Consider the following pseudo code: 1 Begin 2 Read Time 3 If Time < 12 Then 4 Print(Time, "am") 5 Endif 6 If Time > 12 Then 7 Print(Time 12, "pm") 8 Endif 9 If Time = 12 Then 10 Print (Time, "noon")…

The correct answer is D. 83% or 5/6. Test case 1 exercises the decision outcomes True, False, False Test case 2 exercises the decision outcomes False, True, False This leaves the True outcome of decision 3 not exercised. Of the 6 possible decision outcomes, 5 have been exercised, so the decision coverage is 5/6

Test design techniques

Question

Consider the following pseudo code:

1 Begin 2 Read Time 3 If Time < 12 Then 4 Print(Time, "am") 5 Endif 6 If Time > 12 Then 7 Print(Time 12, "pm") 8 Endif 9 If Time = 12 Then 10 Print (Time, "noon") 11 Endif 12 End If the test cases Time = 11 and Time = 15 were input, what level of decision coverage would be achieved?

Options

  • A100% or 6/6
  • B50% or 3/6
  • C67% or 4/6
  • D83% or 5/6

How the community answered

(50 responses)
  • A
    4% (2)
  • B
    10% (5)
  • C
    2% (1)
  • D
    84% (42)

Explanation

Test case 1 exercises the decision outcomes True, False, False Test case 2 exercises the decision outcomes False, True, False This leaves the True outcome of decision 3 not exercised. Of the 6 possible decision outcomes, 5 have been exercised, so the decision coverage is 5/6

Topics

#decision coverage#white-box testing#branch coverage#pseudo code analysis

Community Discussion

No community discussion yet for this question.

Full BH0-010 Practice