
EXERCISES
10 d=d/2; t=c-(2*x+d);
11 if (t≥0) {
12 x=x+d;
13 c=2*(c-(2*x+d));
14 }
15 else{
16 c=2*c; }
17 }
18 }
19 output (“Square root of p=”, x);
20 }
21 end
For Program P6.21, (a) draw a data-flow graph, (b) develop an
MC/DC-adequate test set T
mcdc
, and (c) enhance T
mcdc
to generate
T that is adequate with respect to the all-uses criterion. (d) There
is an error in Program P6.21. Lines 12 and 13 must be
interchanged to remove this error. Does T reveal the error?
(e) Does T
mcdc
reveal the error? (f) Will every T, adequate with
respect to the all-uses criterion, reveal the error?
6.34 (a) In Example 6.44, what condition must be satisfied by a test
case for Program ...