A Survey of Program Slicing Techniques: Section 4

Slides:



Advertisements
Similar presentations
Analyzing Regression Test Selection Techniques
Advertisements

DATAFLOW TESTING DONE BY A.PRIYA, 08CSEE17, II- M.s.c [C.S].
Overview Structural Testing Introduction – General Concepts
A Survey of Program Slicing Techniques A Survey of Program Slicing Techniques Sections 3.1,3.6 Swathy Shankar
Program Slicing – Based Techniques
Chapter 9 Code optimization Section 0 overview 1.Position of code optimizer 2.Purpose of code optimizer to get better efficiency –Run faster –Take less.
Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers Presentation by Patrick Kaleem Justin.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
1.6 Behavioral Equivalence. 2 Two very important concepts in the study and analysis of programs –Equivalence between programs –Congruence between statements.
 Program Slicing Long Li. Program Slicing ? It is an important way to help developers and maintainers to understand and analyze the structure.
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.
Program Slicing Mark Weiser and Precise Dynamic Slicing Algorithms Xiangyu Zhang, Rajiv Gupta & Youtao Zhang Presented by Harini Ramaprasad.
1 Program Slicing Purvi Patel. 2 Contents Introduction What is program slicing? Principle of dependences Variants of program slicing Slicing classifications.
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.
The Application of Graph Criteria: Source Code  It is usually defined with the control flow graph (CFG)  Node coverage is used to execute every statement.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
Program Representations Xiangyu Zhang. CS590F Software Reliability Why Program Representations  Initial representations Source code (across languages).
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
Stanford University CS243 Winter 2006 Wei Li 1 Data Dependences and Parallelization.
Aho-Corasick String Matching An Efficient String Matching.
Program Representations Xiangyu Zhang. CS590Z Software Defect Analysis Program Representations  Static program representations Abstract syntax tree;
SubSea: An Efficient Heuristic Algorithm for Subgraph Isomorphism Vladimir Lipets Ben-Gurion University of the Negev Joint work with Prof. Ehud Gudes.
Data Flow Analysis Compiler Design Nov. 8, 2005.
Data Flow Analysis Compiler Design Nov. 8, 2005.
Survey of program slicing techniques
Applied Discrete Mathematics Week 10: Equivalence Relations
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
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.
Static Program Analysis of Embedded Software Ramakrishnan Venkitaraman Graduate Student, Computer Science Advisor: Dr. Gopal Gupta
Detecting Equality of Variables in Programs Bowen Alpern, Mark N. Wegman, F. Kenneth Zadeck Presented by: Abdulrahman Mahmoud.
Chapter 11: Dynamic Analysis Omar Meqdadi SE 3860 Lecture 11 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
COSC 3101NJ. Elder Announcements Midterms are marked Assignment 2: –Still analyzing.
Program Slicing Techniques CSE 6329 Spring 2013 Parikksit Bhisay
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
Control Flow Graphs : The if Statement 1 if (x < y) { y = 0; x = x + 1; } else { x = y; } x >= yx < y x = y y = 0 x = x + 1 if (x < y) { y = 0;
Dynamically Computing Fastest Paths for Intelligent Transportation Systems - ADITI BHAUMICK ab3585.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Phoenix Based Dynamic Slicing Debugging Tool Eric Cheng Lin Xu Matt Gruskin Ravi Ramaseshan Microsoft Phoenix Intern Team (Summer '06)
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Chapter 4: Induction and Recursion
Applied Discrete Mathematics Week 2: Functions and Sequences
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.
“Language Mechanism for Synchronization”
Software Testing and Maintenance 1
Induction and Recursion
Design and Analysis of Algorithm
Aditya P. Mathur Purdue University
Structural testing, Path Testing
CHAPTER 4 Test Design Techniques
Mark Weiser University of Maryland, College Park IEEE CHI, 1981
Program Slicing Baishakhi Ray University of Virginia
ICS 353: Design and Analysis of Algorithms
Chapter 10 Data Flow Testing Slice Testing
Connected Components, Directed Graphs, Topological Sort
NP-Complete Problems.
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Copyright © Cengage Learning. All rights reserved.
CSE P 501 – Compilers SSA Hal Perkins Autumn /31/2019
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:

A Survey of Program Slicing Techniques: Section 4 Methods for Dynamic Slicing Krunal M. Jadeja 1000834700

What is Program Slicing? In computer programming, program slicing is the computation of the set of programs statements, the program slice, that may affect the values at some point of interest, referred to as a slicing criterion. Program slicing can be used in debugging to locate source of errors more easily Other uses include software maintenance, optimization, program analysis and information flow control

Dynamic Slicing Makes use of information about a particular execution of a program  A dynamic slice contains all statements that actually affect the value of a variable at a program point for a particular execution of the program rather than all statements that may have affected the value of a variable at a program point for any arbitrary execution of the program. Korel and Laski introduce how Dynamic slices can be computed

Basic Algorithms for Dynamic Slicing Dynamic Flow Concepts Dynamic Dependence Relations Dependence Graphs

Dynamic Flow Concepts A dynamic slicing criterion is specified as a triple (x, Iq , V), where x denotes input of program, statement occurrence Iq is the qth element of the trajectory, and V is subset of variables of the program A dynamic slice is defined as an executable program that is obtained from original program by deleting zero or one statements

Requirements imposed on Dynamic Slice The Statement corresponding to criterion Iq occurs in slice If a loop occurs in the slice, it is traversed the same number of times as in the original program

Example Trajectory for input n=2, (n=2, 81, {x})

Types of Dynamic Flow Concepts The Definition Use(DU) relation associates a use of a variable with its last definition The Test Control(TC) relation associates the most recent occurrence of a control predicate with the statement occurrences in the trajectory that are control dependent on it. The symmetric Identity(IR) relation associates occurrences of same statements.

Example of types of Dynamic Flow Concepts

Dynamic Dependence Relations Dynamic versions of Bergeretti and Carre’s information flow are introduced by Gopal For empty statements, assignments, and statement sequences, Gopal’s Dependence relations are same as static case For Dynamic Dependence relations, however, only the dependences that arise in a branch that is actually executed are taken into account.

Example of Dynamic Dependence Relations Dynamic Slice computed w.r.to n=1

Dependence Graphs Agrawal and horgan developed an approach for using dependence graphs to compute dynamic slices They proposed two algorithms though they are inaccurate In first algorithm, the dynamic slice is computed by computing a static slice in subgraph of PDG that is induced by marked vertices This slice only contains vertices that were executed

Inaccurate as all vertices are marked, though x=18 is irrelevant Example of Algorithm 1(PDG) Inaccurate as all vertices are marked, though x=18 is irrelevant

Dependence Graphs(contd.) The second algorithm consists of marking edges as corresponding dependences arise during execution This method is still produces imprecise slices as it marks edges during loop executions, though it will recur or not This algorithm produces identical results as algorithm proposed by korel and laski

Solution to imprecise PDG algorithms A third approach was taken into account which creates a distinct vertex in dependence graph for each occurrence of statement in execution history This is also called Dynamic Dependence Graph(DDG) A dynamic slicing criterion is identified with a vertex in the DDG, and dynamic slice can be computed by determining all vertices from where criterion can be reached

Example of DDG

Reduced DDG(RDDG) Disadvantage of DDG is number of vertices equals number of statements executed. Reduced DDG was proposed to reduce vertices in DDG Vertices for which transitive dependences map to same statements are merged RDDG have same preciseness as DDGs

Interprocedural Dynamic Slicing Dynamic Dependence Summary graph is constructed during execution. The vertices of graph are referred to as procedure instances The edges of graph refer to procedure calls or summary dependences Slicing criterion is defined as a pair consisting of procedure instance and an input or output parameter of associated procedure

Interprocedural Dynamic Slicing(contd.) Three approaches are considered for creating summary graphs Static Dynamic Combined Static/Dynamic

Approaches for creating Summary Graphs Static: Intraprocedural data dependences are determined statically, which may be inaccurate in presence of conditionals Dynamic: Dependences are determined at run time, but requires re computation every time when procedure P is called Combined Static/Dynamic: Attempts to make use of efficiency of static approach with accuracy of dynamic approach. It computes dependencies statically inside block while computing inter-block dependencies dynamically

Dynamic Slicing of Distributed Programs A dynamic slicing criterion of a distributed program specifies: Input of each task A distributed program path P A task w A statement occurrence q in trajectory of w A variable v A dynamic slice with respect to such criterion is executable projection of program

Dynamic Slicing of Distributed Programs(contd.) A distributed program P consists of a set of processes P1,…,Pn. Communication between processes is assumed to be synchronous and non deterministic and is expressed by way of send and receive statements. A dynamic slice criterion (I1,X1), (I2,X2),…, (In,Xn) specifies process Pi, its input Ii, and set of statements Xi. A distributed dynamic slice S is executable set of processes P1’,…,Pn’

Overview of Dynamic Slicing Methods

References http://en.wikipedia.org/wiki/Program_slicing http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.167.3388 F. Tip, A Survey of Program Slicing Techniques, CS-R9438, Computer Science/Department of Software Technology, 1994

QUESTIONS