@ExpertWave, am I right that statement coverage is 100% if every statement (but not decision) is covered with test case at least once? In this case I don't understand why do you need 2nd case - because "P>5000" and "N>4" statements were covered during first one.
first: a decision is also a statement ... so you can't say (but not decision) ...because it's you should also make sure you visit all statement including decisions during statement coverage. second:with one test case, you will miss either either step 8 or 10...so you need an extra test case to cover that
@@ExpertWave I am doubt that decision is also a statemen. In this case there is no difference between decision coverage and statement coverage. According ISTQB Syllabus 2018: 4.3.3 "Achieving 100% decision coverage guarantees 100% statement coverage (but not vice versa)"
@@MrOgnevoi decision coverage covered statement coverage. Maybe you can think like that, statement is a bus station, decisions are ways which goes to station. If you use two way, you went to bus station.
I think the right answer is 4 the missing test case is P > 1000 and P < 5000 In that case you will skip the statement D= 0 and pass to O, If O=1 then D= 25 else D= 10 Can you re-check please ?
I thought you were asking about branch covering which needs 4 test cases. under P > 1000 and P < 5000 there're no statement...so nothing there to cover, so we don't need it when counting test cases for statement coverage. if we are talking about branch covering then this branch needs a test case whether it has a statement or not..that's why we need 4 test cases for branch coverage