0

Do
If X<10
X=X*4
Endif
X=X+1
Until X>40

As per my knowledge of Statement coverage and branch coverage Answer should be (a) .But to be very frank still flow chart for this is not clear to me. Can someone pls help me with flow chat.

1 Answers1

1

Flow chart with one test case to achieve 100% statement and decision coverage. Btw, I called it branch coverage (aka decision cov)

Flow chart showing 100% statement and decision coverage

TestPete
  • 106
  • 5
  • Thank You So much. ! This gives me much better clarity to the question. – Pushpanjali Feb 17 '22 at 12:53
  • Jus one doubt why DC=1.When we have two branches from If condition. Because if we follow red edges (in flow chart these are two branches that can be achieved with Two test cases. Could you please give some clarity here with respect to Decision Coverage Please! – Pushpanjali Feb 17 '22 at 13:15
  • Glad it helped. The reason 100% DC is possible to achieve with one test is because you can re-enter the first decision gate via the last decision point, if no there. You always aim to achieve the highest coverage with the fewest tests (effort) possible. – TestPete Feb 17 '22 at 14:00
  • Thanks. This makes sense. – Pushpanjali Feb 17 '22 at 14:57