140 likes | 162 Views
Effective Slicing. Anne Mulhern Computer Sciences Department University of Wisconsin-Madison Madison, WI USA mulhern@cs.wisc.edu www.cs.wisc.edu/~mulhern. typical. ^. Two Correct Dynamic Slices. ✓. ✓. Union of Slices is Incorrect. Why is This a Problem?.
E N D
Effective Slicing Anne Mulhern Computer Sciences Department University of Wisconsin-Madison Madison, WI USA mulhern@cs.wisc.edu www.cs.wisc.edu/~mulhern
typical ^ Two Correct Dynamic Slices ✓ ✓ Effective Slicing
Union of Slices is Incorrect Effective Slicing
Why is This a Problem? • Given a set of inputs that cause program failure • Want the correct slice for all failures • Given a flag that takes multiple values • Want the correct slice for whenever the flag is set, regardless of its value Effective Slicing
Two Correct Relevant Slices ✓ ✓ Effective Slicing
Union of Relevant Slices is Correct Effective Slicing
We Can Slice Twice • If we take the union of slices as our program and slice again on the same inputs… • we may get a smaller program • Example: the union of relevant slices for inputs 2 and 3… Effective Slicing
Fixpoint Computation ✓ ✓ So long as n in {2,3} choice of n is unimportant Effective Slicing
Effective Slicing • Dynamic slicing algorithms - two arguments • P - the program • σ - the initial state • Effective slicing algorithm - an additional argument • 𝚷 - the nodes to consider when calculating potential dependence • effective(P, σ, ∅ ) = full(P, σ) • effective(P, σ, P) = relevant(P, σ) Effective Slicing
Effective Slicing for Approximation • Potential dependence need only be taken into account when the potential statement is in the union of slices • Choose 𝚷 to be all nodes in the union of execution slices Effective Slicing
Two Correct Effective Slices ✓ ✓ Effective Slicing
Summary • Unions of relevant slices are correct • Take into account potential dependences • Relevant slicing can be used in a fixpoint computation • Semantic information can be extracted from the result • Effective slicing generalizes full and relevant slicing • Possibly potential statements are an explicit parameter • Effective slicing can be used to find an approximation of the fixpoint Effective Slicing
Future Work • Theoretical • How many steps to reach fixpoint? • Practical • How big are unions of relevant slices? • How good an approximation can effective slicing give? • How many dynamic semantic facts can be extracted? • eg., what choices of initial state are irrelevant for this subset? Effective Slicing
Effective Slicing Anne Mulhern Computer Sciences Department University of Wisconsin-Madison Madison, WI USA mulhern@cs.wisc.edu www.cs.wisc.edu/~mulhern