Program Slicing Mark Weiser and Precise Dynamic Slicing Algorithms Xiangyu Zhang, Rajiv Gupta & Youtao Zhang Presented by Harini Ramaprasad.

Slides:



Advertisements
Similar presentations
Analyzing Regression Test Selection Techniques
Advertisements

A Survey of Program Slicing Techniques A Survey of Program Slicing Techniques Sections 3.1,3.6 Swathy Shankar
Program Slicing – Based Techniques
Data-Flow Analysis II CS 671 March 13, CS 671 – Spring Data-Flow Analysis Gather conservative, approximate information about what a program.
P3 / 2004 Register Allocation. Kostis Sagonas 2 Spring 2004 Outline What is register allocation Webs Interference Graphs Graph coloring Spilling Live-Range.
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
Zhiguo Ge, Weng-Fai Wong, and Hock-Beng Lim Proceedings of the Design, Automation, and Test in Europe Conference, 2007 (DATE’07) April /4/17.
 Program Slicing Long Li. Program Slicing ? It is an important way to help developers and maintainers to understand and analyze the structure.
Quick Review of Apr 10 material B+-Tree File Organization –similar to B+-tree index –leaf nodes store records, not pointers to records stored in an original.
Program Slicing; Andreas Linder eXtreme Programming lab course 2004.
A survey of techniques for precise program slicing Komondoor V. Raghavan Indian Institute of Science, Bangalore.
Program Slicing. 2 CS510 S o f t w a r e E n g i n e e r i n g Outline What is slicing? Why use slicing? Static slicing of programs Dynamic Program Slicing.
1 Program Slicing Purvi Patel. 2 Contents Introduction What is program slicing? Principle of dependences Variants of program slicing Slicing classifications.
Presented By: Krishna Balasubramanian
1 Cost Effective Dynamic Program Slicing Xiangyu Zhang Rajiv Gupta The University of Arizona.
CS590F Software Reliability What is a slice? S: …. = f (v)  Slice of v at S is the set of statements involved in computing v’s value at S. [Mark Weiser,
Introduction to Program Slicing Presenter: M. Amin Alipour Software Design Laboratory
Interprocedural Slicing using Dependence Graphs Susan Horwitz, Thomas Reps, and David Binkley University of Wisconsin-Madison.
1 S. Tallam, R. Gupta, and X. Zhang PACT 2005 Extended Whole Program Paths Sriraman Tallam Rajiv Gupta Xiangyu Zhang University of Arizona.
1 Integrating Influence Mechanisms into Impact Analysis for Increased Precision Ben Breech Lori Pollock Mike Tegtmeyer University of Delaware Army Research.
Program Representations Xiangyu Zhang. CS590Z Software Defect Analysis Program Representations  Static program representations Abstract syntax tree;
Machine-Independent Optimizations Ⅰ CS308 Compiler Theory1.
Survey of program slicing techniques
Pointer analysis. Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis Andersen and.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Impact Analysis of Database Schema Changes Andy Maule, Wolfgang Emmerich and David S. Rosenblum London Software Systems Dept. of Computer Science, University.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Topic #10: Optimization EE 456 – Compiling Techniques Prof. Carl Sable Fall 2003.
Presented By Dr. Shazzad Hosain Asst. Prof., EECS, NSU
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
CS654: Digital Image Analysis Lecture 3: Data Structure for Image Analysis.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Bug Localization with Machine Learning Techniques Wujie Zheng
CIS 068 Welcome to CIS 068 ! Stacks and Recursion.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.
1 Program Slicing Amir Saeidi PhD Student UTRECHT UNIVERSITY.
Introduction to Problem Solving. Steps in Programming A Very Simplified Picture –Problem Definition & Analysis – High Level Strategy for a solution –Arriving.
An Efficient Linear Time Triple Patterning Solver Haitong Tian Hongbo Zhang Zigang Xiao Martin D.F. Wong ASP-DAC’15.
Slicing AspectJ Woven Code Luca Cavallaro Mattia Monga Antonio Castaldo D'Ursi Davide Balzarotti Politecnico di Milano.
Chapter 11: Dynamic Analysis Omar Meqdadi SE 3860 Lecture 11 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
CASE/Re-factoring and program slicing
Replicating Memory Behavior for Performance Skeletons Aditya Toomula PC-Doctor Inc. Reno, NV Jaspal Subhlok University of Houston Houston, TX By.
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University A Slicing Method for Object-Oriented Programs Using Lightweight.
Software Engineering Department Graph-Less Dynamic Dependence-Based Dynamic Slicing Algorithms Árpád Beszédes, Tamás Gergely and Tibor Gyimóthy University.
Program Slicing Techniques CSE 6329 Spring 2013 Parikksit Bhisay
Pruning Dynamic Slices With Confidence Original by: Xiangyu Zhang Neelam Gupta Rajiv Gupta The University of Arizona Presented by: David Carrillo.
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
Comparison of Algorithms Objective: Understand how and why algorithms are compared. Imagine you own a company. You’re trying to buy software to process.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Virtual memory.
Data Flow Analysis Suman Jana
Control Flow Testing Handouts
Static Slicing Static slice is the set of statements that COULD influence the value of a variable for ANY input. Construct static dependence graph Control.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Data Structure and Algorithms
Data Structures Interview / VIVA Questions and Answers
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Aditya P. Mathur Purdue University
SwE 455 Program Slicing.
Mark Weiser University of Maryland, College Park IEEE CHI, 1981
A Survey of Program Slicing Techniques: Section 4
Program Slicing Baishakhi Ray University of Virginia
University Of Virginia
White-Box Testing.
Dongyun Jin, Patrick Meredith, Dennis Griffith, Grigore Rosu
CSE 373: Data Structures and Algorithms
C. M. Overstreet Old Dominion University Fall 2005
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Presentation transcript:

Program Slicing Mark Weiser and Precise Dynamic Slicing Algorithms Xiangyu Zhang, Rajiv Gupta & Youtao Zhang Presented by Harini Ramaprasad

Program slicing–basic idea… Method used for abstracting from programs. –Start with a subset of a program’s behavior and reduce it to a minimal form that still produces that behavior. The reduced program is called a “slice”. Problem – finding a slice is in general unsolvable.

Automatic slicing Specifying what behavior is of interest to us… –Usually expressed as the values of some variables at some statement in the program…called a “slicing criterion”. To find what all code could influence a variable in a statement, data flow analysis is extremely useful!

Slices & slicing criteria Slicing criterion – a pair –“i” is the number of the statement & “v” is the set of variables to be observed at statement “i”. Desirable properties of a slice: –Must have been got from the actual program by deletion. –Behavior of slice as observed thro’ the window of the criterion must correspond to original program behavior!

Examples of slices A program may have several slices depending on the criterion for slicing… Original program: 1 begin 2 read(x,y) 3 total := sum := if x <= 1 6then sum := y 7else begin 8 read(z) 9 total := x*y 10 end 11 write(total, sum) 12 end. Criterion: begin read(x,y) if x <= 1 then else read(z) end. Criterion: begin read(x,y) end. Criterion: begin read(x,y) total := 0 if x <= 1 then else total := x*y end.

Dataflow Data flow analysis –To find slices, a program is traced backwards, finding possible influences on variables…similar to reaching definition analysis. –In this analysis, the following definitions are most important: USE(n) – set of variables whose values may be referenced at node (or statement) n. DEF(n) – set of variables whose values may be changed at node n.

Inter-procedural slicing Consists basically of two steps: –A single slice of the procedure containing the slicing criterion is made. –Procedure calls from within this procedure are sliced using new criteria.

Slicing techniques Static –Here, slices are computed statically using a dependence graph. Dynamic –Dynamic data dependence information is traversed to compute the slices…this info is constructed using an execution trace of the program. –Hence, a dynamic slice is a set of statements that did affect the value of a variable for one specific input.

Effectiveness of dynamic slicing Sometimes, both get similar results… Sometimes, static gets really huge results On an average, static slices are much larger!

Example Static Slice ( ) = {1, 2, 3, 4, 7, 8, 9, 10} Dynamic Slice ( ) = {3, 4, 9, 10}

Imprecision in algorithms Data dependence analysis is sometimes conservative…this results in imprecise, larger slices. More precision implies more expensive computation… 

Precision comparison Imprecise algorithms to precise algorithm comparison …w.r.t. slice sizes

Precise Dynamic Slicing Algorithms This paper presents algorithms that are precise and yet have reasonable computation cost.

Basic approach… Execution trace –Captures runtime info that can be used for dynamic slicing…control flow trace + memory reference trace. Slice computation… –Execution trace is processed to identify dynamic dependences that are exercised during the program execution. –Slicing request given in terms of a variable & a memory address. Goals –Allow for computation of precise dynamic slices. –Support computation of a slice for any variable/memory address at any execution point.

The three algorithms… Full preprocessing –Execution trace is completely processed to generate all dependence information. No preprocessing –Execution trace is not at all preprocessed. All dependence info is generated dynamically as required. Limited preprocessing –Some amount of preprocessing is performed.

Full preprocessing (FP) Preprocessing –Execution trace is preprocessed completely… dependence edges in the graph are labeled with instance numbers. Slicing –Instance labels are used to traverse only relevant edges.

Example

Execution trace…

Characteristics Advantages –Very easy and fast to compute a dynamic slice at any execution point. Disadvantages –Dynamic dependence graph is very large for real programs…so, this scheme is not practical.

No preprocessing (NP) Completely demand-driven Space requirements are very less when compared to FP. Slower than FP. Computations may be repetitive at times. Caching may be used to try and avoid this.

Limited preprocessing (LP) Strikes a balance between preprocessing and slicing costs. Process: –Trace is divided into trace blocks of a fixed size. –Every trace block stores a summary of downward exposed definitions of variables & memory addresses. –This summary helps reduce slicing time.

Effectiveness of LP Trace blocks skipped by LP

Experimental results Precise slicing algorithms –Slice sizes Number of statements in dynamic slice is much less than actual number of program lines, as expected! This is consistent for all inputs considered. –Slicing time…comparison between FP, NP and LP FP usually runs out of memory…never reaches slicing stage. For NP, caching sometimes help and sometimes doesn’t. LP execution times increase much more slowly than NP. Preprocessing cost is more than compensated by slicing time reduction.

Result graphs Comparison of execution times for each algorithm for a benchmark.

LP vs imprecise algorithm Both solve the slicing problem fully…no memory issues. Results: –Slice sizes much smaller for LP algorithm. –Slice independent comparison shows that the imprecise algorithm has several unnecessary dependences… hence the imprecision! –Execution times are greater for LP for large slices and smaller than the imprecise algorithm for smaller slices.

Results Execution time comparison between imprecise & LP algorithms.

Our goal… Use an existing tool that computes data dependences statically per procedure. Perform inter-procedural slicing using this pre- computed information. We could use either static or dynamic analysis… We hope to achieve a higher speed than existing algorithms due to pre-computed intra-procedural data flow information.

Thank you!