1 / 9

Graph-Less Dynamic Dependence-Based Dynamic Slicing Algorithms

Explore efficient dynamic slicing algorithms based on dynamic dependence graph for source code analysis. Learn about demand-driven and global algorithms to compute slices effectively, enhancing software comprehension.

Download Presentation

Graph-Less Dynamic Dependence-Based Dynamic Slicing Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06

  3. Two inputs, 6 different algorithms control dependence Algorithm Framework 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06

  4. Demand-Driven Algorithms • 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: (89, y) Forward slicing criterion: (11, a) 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06

  5. 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… 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06

  6. trace 1 2 3 … Slices may by outputted instantly! trace 1 2 3 … Slices may by outputted instantly! 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 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06

  7. 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 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06

  8. Summary of Algorithms C C, Java, GCC/GDB Java 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06

  9. 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 6th International Workshop on Source Code Analysis and Manipulation, SCAM'06

More Related