
Test Selection, Minimization, and Prioritization
Program P.5.7
1 main(){ 1 int f1(int x){
2 int x, y, z; 2 int p;
3 input (x, y); 3 if(x>0)
4 z=f1(x); 4 p=f3(x, y);
5 if(z>0) 5 return(p);
6 z=f2(x); 6 }
7 output (z);
8 end
9}
main f1
f3
Fig. 5.13 Dynamic data dependence graph for P5.7 corresponding to the function
trace: main, f1, f3, f1, and main.
Computing dynamic slices using a DDG based on function traces
can be tricky. First, one needs to ask the proper question. In the
program-variable-based slicing discussed earlier, we are able to specify
a variable and its location for slicing. Against what should the slice be
constructed when traces are based on functions? ...