Multiple choice technology testing

Given the following: Switch PC on Start “outlook” IF outlook appears THEN Send an email Close outlook

  1. 1 test for statement coverage, 1 for branch coverage

  2. 1 test for statement coverage, 2 for branch coverage

  3. 1 test for statement coverage. 3 for branch coverage

  4. 2 tests for statement coverage, 2 for branch coverage

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

One test case where the IF condition evaluates to True is sufficient to execute all statements. However, for full branch coverage, a second test case where the condition evaluates to False is required to cover the implicit else branch, making one test for statement coverage and two for branch coverage correct.