Dynamic Slicing Khanh Nguyen Donald Bren School of Information & Computer Science University of California, Irvine.

Slides:



Advertisements
Similar presentations
DATAFLOW TESTING DONE BY A.PRIYA, 08CSEE17, II- M.s.c [C.S].
Advertisements

Overview Structural Testing Introduction – General Concepts
Program Slicing – Based Techniques
School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) SSA Guo, Yao.
Slicing Methods Using Static and Dynamic Information Yoshiyuki Ashida, Fumiaki Ohata, † † † ‡ †‡ Katsuro Inoue Osaka University Nara Institute of Science.
SSA.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
Chair of Software Engineering From Program slicing to Abstract Interpretation Dr. Manuel Oriol.
1 Ivan Marsic Rutgers University LECTURE 15: Software Complexity Metrics.
Introduction to Programming Languages Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University.
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.
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,
White Box Testing and Symbolic Execution Written by Michael Beder.
November 29, 2005Christopher Tuttle1 Linear Scan Register Allocation Massimiliano Poletto (MIT) and Vivek Sarkar (IBM Watson)
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
Data Dependence Based Testability Transformation in Automated Test Generation Presented by: Qi Zhang.
CACHETOR Detecting Cacheable Data to Remove Bloat Khanh Nguyen Guoqing Xu UC Irvine USA.
Linear Scan Register Allocation POLETTO ET AL. PRESENTED BY MUHAMMAD HUZAIFA (MOST) SLIDES BORROWED FROM CHRISTOPHER TUTTLE 1.
Data Flow Testing Data flow testing(DFT) is NOT directly related to the design diagrams of data-flow-diagrams(DFD). It is a form of structural testing.
MATH 224 – Discrete Mathematics
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University ICSE 2003 Java.
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
1 A Static Analysis Approach for Automatically Generating Test Cases for Web Applications Presented by: Beverly Leung Fahim Rahman.
An Autonomic Framework in Cloud Environment Jiedan Zhu Advisor: Prof. Gagan Agrawal.
The Rectangle Method. Introduction Definite integral (High School material): A definite integral a ∫ b f(x) dx is the integral of a function f(x) with.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Design and Implementation.
CMSC 1041 Algorithms III Problem Solving and Pseudocode.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.
Statistical Analysis of Inlining Heuristics in Jikes RVM Jing Yang Department of Computer Science, University of Virginia.
Zhuo Peng, Chaokun Wang, Lu Han, Jingchao Hao and Yiyuan Ba Proceedings of the Third International Conference on Emerging Databases, Incheon, Korea (August.
D Nagesh Kumar, IIScOptimization Methods: M2L4 1 Optimization using Calculus Optimization of Functions of Multiple Variables subject to Equality Constraints.
Chapter 11: Dynamic Analysis Omar Meqdadi SE 3860 Lecture 11 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Lecture Notes - Copyright © S. C. Kothari, All rights reserved.1 Efficient Debugging CPRE 556 Lecture 19.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Chapter 3 - Language Design Principles
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University A Slicing Method for Object-Oriented Programs Using Lightweight.
Generators Lesson!  This will be broken into multiple parts  The kids will be attempting to recreate a graph based on given data, but not being allowed.
DIRECTED ACYCLIC GRAPHS AND TOPOLOGICAL SORT CS16: Introduction to Data Structures & Algorithms Tuesday, March 10,
CS412/413 Introduction to Compilers Radu Rugina Lecture 18: Control Flow Graphs 29 Feb 02.
1 Control Flow Graphs. 2 Optimizations Code transformations to improve program –Mainly: improve execution time –Also: reduce program size Can be done.
Bell Ringer: Simplify each expression
Recursive Methods for Finding Roots of Functions Bisection & Newton’s Method.
Vertical Profiling : Understanding the Behavior of Object-Oriented Applications Sookmyung Women’s Univ. PsLab Sewon,Moon.
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
Chapter 12 Theory of Computation Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Last Answer LETTER I h(x) = 3x 4 – 8x Last Answer LETTER R Without graphing, solve this polynomial: y = x 3 – 12x x.
SAT/ACT MATH UNIT 10 Equation with More Than One Variable.
Phoenix Based Dynamic Slicing Debugging Tool Eric Cheng Lin Xu Matt Gruskin Ravi Ramaseshan Microsoft Phoenix Intern Team (Summer '06)
Summarize the Rational Function Task
Sec. 4-3: Matrix Multiplication 8/24/17
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.
Science and the Scientific Method!
Lesson: Extension Cubic Functions and Equations
CACHETOR Detecting Cacheable Data to Remove Bloat
The Simplest Heuristics May Be The Best in Java JIT Compilers
A Survey of Program Slicing Techniques: Section 4
Program Slicing Baishakhi Ray University of Virginia
Chapter 10 Data Flow Testing Slice Testing
Adaptive Code Unloading for Resource-Constrained JVMs
Lesson 6-1b Area Between Curves.
Math 083 – Intermediate Algebra
Replacing f(x) with f(x)+k and f(x+k) (2.6.1)
CPRE 416-Software Evolution and Maintenance-Lecture 11
Introduction to Functions
Exponential Functions and Their Graphs
Accelerating Regular Path Queries using FPGA
Presentation transcript:

Dynamic Slicing Khanh Nguyen Donald Bren School of Information & Computer Science University of California, Irvine

Outline Introduction 4 approaches to conduct dynamic slicing Jikes RVM

Dynamic Slicing Introduction 4 approaches to conduct dynamic slicing Jikes RVM

Introduction Program slicing: Divide into set of statements with regard to a specific variable Must give the identical result as original program Benefits: Testing Understanding - Verification Performance improvement Debugging etc... Slicing Program

Static & Dynamic Slicing Static Slice: the set of all statements that might affect the value of a given variable occurrence Dynamic Slice: all statements that actually affect the value of a variable occurrence for a given program input

Dynamic Slice More helpful than static slice The process: o Inputs → execution history: all statements executed based on the inputs o Build Dynamic Dependence Graph o Construct the slice using Dynamic Dependence Graph

Dynamic Dependence Graph A set of such that Vertices are statements Edges o Control Dependence o dashed line o if, while, for, etc... o Data Dependence o regular line o definition and usage

Dynamic Slicing Introduction 4 approaches to conduct dynamic slicing Jikes RVM

Example: Static Slicing S1:read(X); S2:if (X < 0) then S3:Y := a(X); S4:Z := b(X); else S5:if (X = 0) then S6:Y := c(X); S7:Z := d(X); else S8:Y := e(X); S9:Z := f(X); end_if; S10:write(Y); S11:write(Z);

1 st Approach S1:read(X); S2:if (X < 0) then S3:Y := a(X); S4:Z := b(X); else S5:if (X = 0) then S6:Y := c(X); S7:Z := d(X); else S8:Y := e(X); S9:Z := f(X); end_if; S10:write(Y); S11:write(Z); Input X = -1 : Execution history =

Sounds good? - No! - What went wrong? A statement may have multiple reaching definitions of the same variable, hence it may have multiple out-going data dependence edges for the same variable Selection of such a node triggers domino effect in which all nodes to which it has out-going data-dependence edges also be selected regardless

That means... S1:read(N); S2:Z := 0; S3:Y := 0; S4:I := 1; S5:while (I <= N) do S6:Z := f(Z,Y) S7:Y := g(Y); S8:I := I + 1; end_while; S9:write(Z); Input N = 1 : Execution history =

2 nd Approach S1:read(N); S2:Z := 0; S3:Y := 0; S4:I := 1; S5:while (I <= N) do S6:Z := f(Z,Y) S7:Y := g(Y); S8:I := I + 1; end_while; S9:write(Z); Input N = 1 : Execution history =

- It works? - No! A statement may have multiple occurrences in an execution history Different occurrences may have different reaching definitions thus different dependencies It is possible that one occurrence contributes to the slice and another does not.

3 rd Try S1:read(N); S2:I := 1; S3:while (I <= N) do S4:read(X); S5:if (X < 0) then S6:Y := f(X); else S7:Y := g(X); end_if; S8:Z := h(Y); S9:write(Z); S10:I := I +1; end_while; Input N = 3, X = -4, 3, -2 Execution history =

There is still a problem! What is the problem? STORAGE! STORAGE! STORAGE! The size of the graph is unbounded! Number of nodes in the graph = number of statements in the execution history = values of run-time inputs = n

4 th Approach Reduced Dynamic Dependence Graph: S1:read(N); S2:I := 1; S3:while (I <= N) do S4:read(X); S5:if (X < 0) then S6:Y := f(X); else S7:Y := g(X); end_if; S8:Z := h(Y); S9:write(Z); S10:I := I +1; end_while;

Dynamic Slicing Introduction 4 approaches to conduct dynamic slicing Jikes RVM

Research Virtual Machine Written in Java Originally under control of IBM - Now open source Hack/Modify Jikes RVM to extract runtime information

Conclusion The first two approaches: are extension of Static Slicing: simple but yield bigger slice than necessary. The third approach: depends on the length of execution history. The forth approach: is proportional to actual number of dynamic slices that arose during execution history

Conclusion Dynamic Slicing is helpful and effective while debugging, testing and understanding Despite various approaches, optimal dynamic slicing has not been discovered yet! Always consider trade offs: precision, speed, storage.

Reference Agrawal, Hiralal and Joseph R. Horgan. “Dynamic Program Slicing”. Proceedings of the ACM SIGPLAN’90 Conference. White Plains, New York. June 20-22, 1990

THANK YOU!