I have found the following questions regarding statement coverage.
Minimum Test Required for Statement Coverage:
1.Disc = 0
2.Order-qty = 0
3.Read Order-qty
4.If Order-qty >=20 then
5.Disc = 0.05
6.If Order-qty >=100 then
7.Disc =0.1
8.End if
9End if
- Disc = 0
- Order-qty = 0
- Read Order-qty
- If Order-qty >=20 then
- Disc = 0.05
- If Order-qty >=100 then
- Disc =0.1
- End if
- End if
In my opinion, we need 2 statement coverage. But the correct answer is 1 statement based on many websites. Anyway,
I hope anyone is able to explaindon't understand why only one statement coverage is needed?.