Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Engineering Department Graph-Less Dynamic Dependence-Based Dynamic Slicing Algorithms Árpád Beszédes, Tamás Gergely and Tibor Gyimóthy University.

Similar presentations


Presentation on theme: "Software Engineering Department Graph-Less Dynamic Dependence-Based Dynamic Slicing Algorithms Árpád Beszédes, Tamás Gergely and Tibor Gyimóthy University."— Presentation transcript:

1 Software Engineering Department Graph-Less Dynamic Dependence-Based Dynamic Slicing Algorithms Árpád Beszédes, Tamás Gergely and Tibor Gyimóthy University of Szeged, Hungary SCAM’06, Philadelphia, PA, USA

2 University of Szeged – Software Engineering Department 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06 2 27-29 September 2006 Dynamic Slicing Algorithms need to read the execution trace  For an accurate result, it needs to be fine-grained  This implies Gigabytes for its size  An algorithm with proportional space requirements is bad! Dynamic Dependence Graph  Size of the DDG: number of statements executed  Global preprocessing prior to slicing For different purposes, specialized data structures can be used instead of the DDG  More efficient algorithms based on the same (syntactic) dependences  We give 6 new algorithms that compute the same slices

3 University of Szeged – Software Engineering Department 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06 3 27-29 September 2006 Algorithm Framework ProgramDef-useTrace for input a=1 1. read(a) 2. y=0 3. x=1 4. while(a>0) 5. y=x 6. x=2 7. a=a-1 8. z=y a :  y :  x :  p : {a} y : {x,p} x : {p} a : {a,p} z : y 1 1 read(a) 2 2 y=0 3 3 x=1 4 4 while(a>0) 5 5 y=x 6 6 x=2 7 7 a=a-1 4 8 while(a>0) 8 9 z=y control dependence Two inputs, 6 different algorithms

4 University of Szeged – Software Engineering Department 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06 4 27-29 September 2006 Demand-Driven Algorithms Trace+D/U → DDG 1 1 read(a) a:  2 2 y=0 y:  3 3 x=1 x:  4 4 while(a>0) p:{a} 5 5 y=x y:{x,p} 6 6 x=2 x:{p} 7 7 a=a-1 a:{a,p} 4 8 while(a>0) p:{a} 8 9 z=y z:y Backward demand-driven slicing  Go backward  Maintain not yet processed actions in a worklist Forward demand-driven slicing  Go forward  Mark & unmark live variables Trace traversal:  Action-by-action (inefficient)  Jumping to relevant actions Backward slicing criterion: (8 9, y)Forward slicing criterion: (1 1, a)

5 University of Szeged – Software Engineering Department 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06 5 27-29 September 2006 More slices simultaneously? When we traverse the trace for demand-driven slicing,  Many dependences are visited that could be “reused”  More demand-driven slicing? The same dependences are traversed multiple times This is a “no preprocessing” approach. Improvements:  Compressing the trace  Not going action-by-action, but by skipping to relevant trace points  Why not compute more (all) slices? Naïve method: executing many demand-driven algorithms, virtually “in parallel”  Need to store all slices in the memory until the end/start of trace  See later…

6 University of Szeged – Software Engineering Department 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06 6 27-29 September 2006 Global Algorithms A better approach: computing all slices globally  By traversing the trace in a reverse way than the slicing direction Dual algorithms:  Backward slices: use “historical data”  forward processing  Forward slices: use “future data”  backward processing trace 123…123… Slices may by outputted instantly! trace 123…123… Slices may by outputted instantly!

7 University of Szeged – Software Engineering Department 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06 7 27-29 September 2006 Global and Parallel Algorithms Global for backward slices  Dynamic dependence set (of instruction numbers) for each variable Global for forward slices  Live set (of instruction numbers) for each variable Slices can be outputted instantly All slices are produced  a.k.a. full preprocessing Parallel for forward slices  Similar to global for backward slices, but stores actions in the sets Parallel for backward slices  Similar to global for forward slices, but stores actions in the sets Slices can be outputted at the end only

8 University of Szeged – Software Engineering Department 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06 8 27-29 September 2006 Summary of Algorithms No.Global / Demand- driven Slice direction Processing direction Useful? 0Demand-drivenBackward Practical 1Demand-drivenBackwardForwardUnfeasible 2Demand-drivenForwardBackwardUnfeasible 3Demand-drivenForward Practical 4GlobalBackward Parallel 5GlobalBackwardForwardPractical 6GlobalForwardBackwardPractical 7GlobalForward Parallel C C, Java, GCC/GDB Java

9 University of Szeged – Software Engineering Department 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06 9 27-29 September 2006 Discussion and Open Issues Our implementation for C (src instrumentation & GDB) :  Global and Demand-driven for backward slices For Java (VM instrumentation):  Global for backward and parallel for forward slices Parallel algorithms only with some relaxation Which one to use, and when?  Difficult to answer  According to our experiments: if at least 10-20 slices are needed, the global method is more appropriate (trace-to-iteration ratio)  Global algorithms are good for e.g. experimentation with Union slices To-do:  Elaboration on complexities  Possibilities for enhancement (for real languages)  Implementation and empirical investigation


Download ppt "Software Engineering Department Graph-Less Dynamic Dependence-Based Dynamic Slicing Algorithms Árpád Beszédes, Tamás Gergely and Tibor Gyimóthy University."

Similar presentations


Ads by Google