Which of the following sentences is correct?
The following statement refers to decision coverage: “When the code contains only a single ‘if’ statement and no loops or CASE statements, any single test case we run will result in 50% decision coverage.”
- A. The sentence is true. Any single test case provides 100% statement coverage and therefore 50% decision coverage.
- B. The sentence is true. Any single test case would cause the outcome of the “if” statement to be either true or false.
- C. The sentence is false. A single test case can only guarantee 25% decision coverage in this case.
- D. The sentence is false. The statement is too broad. It may be correct or not, depending on the tested software.
Answer: Option B