Consider the following program that given i, computes
n, the square of i.
if i < 0 then i := -i;
n := 0
while i > 0 do
i := i-1;
n := n + 2*i + 1
- Give a set of test data (values for i) that constitute a branch
coverage test. Show clearly what steps you take to arrive at these values.
(4 points, 1 page)
- Using this program as an example, explain the concept
(2 points, 0.5 page)
- Is the potential error in this program most likely to be discovered by
inspection, by a branch coverage test, or by a black box test? Why?
(3 points, 0.5 page)