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.
Asked
Active
Viewed 533 times
0
-
Not sure what you are looking for. Do you want to understand the flow through the code that gives you 100 % SC and DC, or do you need a drawn flow chart? Ps. (a) is correct – TestPete Feb 17 '22 at 08:48
-
Flow chart will help me better. – Pushpanjali Feb 17 '22 at 09:55
1 Answers
1
Flow chart with one test case to achieve 100% statement and decision coverage. Btw, I called it branch coverage (aka decision cov)

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
-