Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.

Slides:



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

Program Slicing – Based Techniques
Slicing Methods Using Static and Dynamic Information Yoshiyuki Ashida, Fumiaki Ohata, † † † ‡ †‡ Katsuro Inoue Osaka University Nara Institute of Science.
Chair of Software Engineering From Program slicing to Abstract Interpretation Dr. Manuel Oriol.
Introduction to Programming Languages Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University.
 Program Slicing Long Li. Program Slicing ? It is an important way to help developers and maintainers to understand and analyze the structure.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Principles of programming languages 4: Parameter passing, Scope rules Department of Information Science and Engineering Isao Sasano.
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
Reference Book: Modern Compiler Design by Grune, Bal, Jacobs and Langendoen Wiley 2000.
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
PJSISSTA '001 Black-Box Test Reduction Using Input-Output Analysis ISSTA ‘00 Patrick J. Schroeder, Bogdan Korel Department of Computer Science Illinois.
OOSE 01/17 Institute of Computer Science and Information Engineering, National Cheng Kung University Member:Q 薛弘志 P 蔡文豪 F 周詩御.
5.3 Machine-Independent Compiler Features
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.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Debugging Support.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University ICSE 2003 Java.
*Graduate School of Engineering Science, Osaka University
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
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.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A lightweight.
2006/09/19AOAsia 21 Towards Locating a Functional Concern Based on a Program Slicing Technique Takashi Ishio 1,2, Ryusuke Niitani 2 and Katsuro Inoue 2.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Refactoring.
1 Software Quality CIS 375 Bruce R. Maxim UM-Dearborn.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A Criterion for.
Chapter 10: Compilers and Language Translation Invitation to Computer Science, Java Version, Third Edition.
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University Analysis and Implementation Method of Program to Detect Inappropriate.
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
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 2.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Design and Implementation.
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University 1 Evaluation of a Business Application Framework Using Complexity.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
1 Program Slicing Amir Saeidi PhD Student UTRECHT UNIVERSITY.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Towards Program.
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University July 21, 2008WODA.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Chapter 11: Dynamic Analysis Omar Meqdadi SE 3860 Lecture 11 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University A Slicing Method for Object-Oriented Programs Using Lightweight.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Classification.
Principle of Programming Lanugages 3: Compilation of statements Statements in C Assertion Hoare logic Department of Information Science and Engineering.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Extraction of.
Program Slicing Techniques CSE 6329 Spring 2013 Parikksit Bhisay
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Extracting Sequence.
Software Quality Assurance and Testing Fazal Rehman Shamil.
Software Development Introduction
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A Metric-based Approach for Reconstructing Methods.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Phoenix Based Dynamic Slicing Debugging Tool Eric Cheng Lin Xu Matt Gruskin Ravi Ramaseshan Microsoft Phoenix Intern Team (Summer '06)
Principles of programming languages 4: Parameter passing, Scope rules
A Survey of Program Slicing Techniques: Section 4
Program Slicing Baishakhi Ray University of Virginia
Chapter 10 Data Flow Testing Slice Testing
Chapter 10: Compilers and Language Translation
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:

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache Slicing: A Slicing Method Using Lightweight Dynamic Information Tomonori Takada, Fumiaki Ohata, Katsuro Inoue Osaka University

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Background of Research Software Systems are becoming large and complex Debugging, testing, and maintaining costs are increasing To reduce development costs, techniques for improving efficiency of such activities are essential

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Comprehension Comprehending large source programs is difficult If we could select specific portions in the source programs and we can concentrate our attentions only to those portions, the performance of the activities would increase

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University A technique of extracting all program statements affecting the value of a variable Slicing: Extraction Slice: Collection of extracted statements Developers can concentrate their attentions to the extracted statements Program Slicing

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Kusumoto, S., Nishimatsu, A., Nishie, K. and Inoue, K. : ``Experimental Evaluation of Program Slicing for Fault Localization'', Empirical Software Engineering, Vol.7, No.1, pp (2002). To evaluate the validity of slice With two independent groups Measured bug detection time with slice: 122 minutes without slice: 165 minutes Experiment Using Program Slice

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Static Slicing Program is analysed statically (without execution) All possible input data sets are assumed. Extract all possible statements affecting the value of the focused statement. Program Dependence Graph (PDG) is used. Static slices are extracted by traversing edges in PDG.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Program Dependence Graph PDG shows dependence relations between statements in a source program. nodes statements conditional predicates edges control dependence edges data dependence edges

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependences Control Dependence (CD) Statement s1 has a control dependence to statement s2 if the execution of s2 is decided by s1’s result. Data Dependence (DD) Def-Use relation. s1: if a=0 then s2: b :=1; s1s2 s3: a := 1; s4: writeln(a); s3s4 a

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Example of PDG program test(input, output); var a : array [0..9] of integer; var b, i, c : integer; begin writeln("input array : "); for i:=0 to 9 do a[i] := i * i; writeln("input number : "); readln(b); if b < 10 then c := a[b] else c := -1; writeln(c) end. writeln(“inp.. a[i] := i * i readln(b) writeln(“inp.. c := a[b] a[] b i if b<10 c := -1 writeln(c) c c for i:=0 to 9 CD DD b

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Example of static slice program test(input, output); var a : array [0..9] of integer; var b, i, c : integer; begin writeln("input array : "); for i:=0 to 9 do a[i] := i * i; writeln("input number : "); readln(b); if b < 10 then c := a[b] else c := -1; writeln(c) end. writeln(“inp.. a[i] := i * i readln(b) writeln(“inp.. c := a[b] a[]b i if b<10 c := -1 writeln(c) c c for i:=0 to 9 b Slicing Criteria writeln(c) for i:=0 to 9 do a[i] := i * i; readln(b); if b < 10 then c := a[b] else c := -1;

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dynamic Slicing Program is analysed dynamically (executed with a particular input data) Extract statements actually affecting the value of a slicing criteria Execution trace is recorded Dynamic Dependence Graph(DDG) is constructed from the exection trace. Dynamic slices are extracted by traversing edges in DDG.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University writeln("input array : "); for i:=0 to 9 do a[0] := 0 *0; for i:=0 to 9 do a[1] := 1 *1; for i:=0 to 9 do a[2] :=2 *2; for i:=0 to 9 do a[3] := 3 *3; for i:=0 to 9 do a[4] := 4 *4; for i:=0 to 9 do a[5] := 5 *5; for i:=0 to 9 do a[6] := 6 *6; for i:=0 to 9 do a[7] := 7 *7; for i:=0 to 9 do a[8] := 8 *8; for i:=0 to 9 do a[9] := 9 *9; writeln("input number : "); readln(b); if b < 10 then c := a[b] writeln(c) Example of dynamic slice program test(input, output); var a : array [0..9] of integer; var b, i, c : integer; begin writeln("input array : "); for i:=0 to 9 do a[i] := i * i; writeln("input number : "); readln(b); if b < 10 then c := a[b] else c := -1; writeln(c) end. for i:=0 to 9 do a[i] := i * i; readln(b); if b < 10 then c := a[b] readln(b) writeln(“inp.. c := a[5] a[] b i if b<10 writeln(c) c b b a[5] for i:=0 to 9 writeln(“inp.. a[0] := 0*0 for a[1] := 1 * 1 for a[2] := 2 * 2 for a[3] := 3 * 3 for a[4] := 4 * 4 for a[5] := 5 * 5 for a[6] := 6 * 6 for a[7] := 7 * 7 for a[8] := 8 * 8 for a[9] := 9 * 9 input b=5 writeln(c)

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Static and Dynamic Slicing Analysis cost: static < dynamic Recording execution trace is exhaustive Determining data dependence and cotrol dependence on execution trace is expensive Slice size: static > dynamic Static slicing considers all possible flows Dynamic slicing only considers one trace Efficient and Effective Slicing unify

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Unified Slicing Methods Focusing on Dynamic Control-Flow Information Hybird Slicing (Gupta, 1997) Collect all traces between break points and procedure calls Need to specify break points / Trace can be huge Call-Mark Slicing (Nishimatsu, 1999; our group) Dynamically set call-marks (flags that shows a caller statement is executed or not) Eliminate non-executed statements from PDG by using call-mark and execution dependence relations. Focusing on Dynamic Data-Flow Information Reduced DDG Method (Agrawal, 1990) The same sub-structure of DDG is shared with one structure. Run-time overhead is serious. Dependence-Cache Slicing

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache Slicing Dependence-Cache Slicing (DC slicing) : A slicing method focused on dynamic data- flow information Control Dependence Easily obtained by syntax analysis Data Dependence static analysis is difficult Computation Step1: Pre-Execution Analysis Statically compute control dependence relations and construct PDG having control dependence edges and nodes Computation Step2: Execution-time Analysis Collect dynamic data dependence relations by using Caches and add data dependence edges to PDG

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University s1: a[0]:=0; s2: a[1]:=3; s3: readln(b); s4: a[b]:=2; s5: c:=a[0]+4; s6: writeln(c); a[0]a[1]bc s1 s2s1s2s3 Data Dependence Collection Input: b=0 b a[0] c Value of cache s4s2s3s4s2s3s5 Each cache holds the statement where the variable is defined

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Example of DC slice program test(input, output); var a : array [0..9] of integer; var b, i, c : integer; begin writeln("input array : "); for i:=0 to 9 do a[i] := i * i; writeln("input number : "); readln(b); if b < 10 then c := a[b] else c := -1; writeln(c) end. writeln(“inp.. a[i] := i * i readln(b) writeln(“inp.. c := a[b] if b<10 c := -1 writeln(c) for i:=0 to 9 input b=5 a[5] b i c b writeln(c) for i:=0 to 9 do a[i] := i * i; readln(b); if b < 10 then c := a[b]

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Experiment Measured some metric values on our slicing system “Osaka Slicing System (OSS)” OSS had already implemented features to extract static, call-mark and dynamic slices. Add function to compute DC slice Three sample PASCAL programs P1: calendar program (85 lines) P2 : wholesaler program (387 lines) P3 : wholesaler program2 (871 lines) Slicing criterion were randomly chosen

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Slice Size P1P2P3 static call-mark dependence-cache dynamic lines static > call-mark >> DC > dynamic DC and dynamic slicing can analyze actual dependence. P2, P3 use array variables.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Pre-Execution Analysis Time N/A P1P2P3 static call-mark dependence-cache dynamic time (ms) static ≒ call-mark > DC DC slicing analyses only control dependence relations.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University P1P2P3 static call-mark dependence-cache dynamic Execution time time (ms) Static ≒ CM ≒ DC << Dynamic DC slicing can be computed with small overhead increase. Execution time for static slicing shows the execution time for “original” program.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Slice Computation Time P1P2P3 static call-mark dependence- cache dynamic time (ms) DC < static ≒ call-mark << dynamic DC slicing uses PDG that has less DD edges than that of static slicing.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Discussion Analysis cost:static  DC << dynamic Collect dynamic data dependence relatios by simple method Slice size:static  DC  dynamic only “actual” data dependence relations are added to PDG Reasonable slice results with reasonable analysis time Promising approach to get effective program localization

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Limit of DC slicing DC slice’s accuracy is less than dynamic slice’s. s1: a[0] := 0; s2: a[1] := 1; s3: i:= 0; s4: while i<2 do begin s5: b := a[i]; s6: i := i + 1 end; s7: writeln(b); DC slicing analyse dependence relations between statements, not between execution trace. For this program, DC slicing can’t distinct between first and second execution of s5. (Dynamic slicing can distinct it.)

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Applications We have applied DC slicing to several language environments. Pascal (Interpreter) OSS mentioned before. Java source code (Preprocessor) Translate program to collect dynamic data dependence relations. Java byte code (Compiler, VM) Virtual Machine collects dynamic data dependence Relations Most of Java libraries are provided by byte code

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Conclusions and Future Works Proposed dependence-cache slicing Practical and efficient approach to get reasonable slices Confirmed validity through an experiment Applicable to various environments Future Works Evaluation through user testing Apply to other language environments

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University

Example of DC slice(2) program test(input, output); var a : array [0..9] of integer; var b, i, c : integer; begin writeln("input array : "); for i:=0 to 9 do a[i] := i * i; writeln("input number : "); readln(b); if b < 10 then c := a[b] else c := -1; writeln(c) end. writeln(“inp.. a[i] := i * i readln(b) writeln(“inp.. c := a[b] i if b<10 c := -1 writeln(c) c for i:=0 to 9 input b=10 b

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University

Static Slicing All statements possibly affecting the value of Slice Criterion (a variable concerned) Method (1) Construct Program Dependence Graph (PDG) Nodes: statements in program Edges: Data Dependence (DD): variable definition and its reference Control Dependence (CD): predicate and statement dominated by the predicate (2) Collect all reachable nodes on PDG to a slice criterion (statement, variable)

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University s1begin s2a:=3; s3b:=3; s4readln(c); s5if c=0 then s6begin s7d:=functionA(a); s8e:=d s9end; s10else s11begin s12d:=functionB(b); s13e:=d s14end; s15writeln(e) s16end. Example of PDG

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Example of Static Slice Slicing criterion (s13, d) s1begin s2a:=3; s3b:=3; s4readln(c); s5if c=0 then s6begin s7d:=functionA(a); s8e:=d s9end; s10else s11begin s12d:=functionB(b); s13e:=d s14end; s15writeln(e) s16end.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Example of Static Slice (2) Slicing criterion (s15, e) s1begin s2a:=3; s3b:=3; s4readln(c); s5if c=0 then s6begin s7d:=functionA(a); s8e:=d s9end; s10else s11begin s12d:=functionB(b); s13e:=d s14end; s15writeln(e) s16end.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University s1begin s2a:=3; s3b:=3; s4readln(c); s5if c=0 then s6begin s7d:=functionA(a); s8e:=d s9end; s10else s11begin s12d:=functionB(b); s13e:=d s14end; s15writeln(e) s16end. e1begin e2a:=3; e3b:=3; e4readln(c); e5if c=0 then e6begin e7d:=functionA(a); e8e:=d e9end; e15writeln(e) e16end. Source (1) Execute Trace with Input c=0 Example of Dynamic Slicing

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University e1begin e2a:=3; e3b:=3; e4readln(c); e5if c=0 then e6begin e7d:=functionA(a); e8e:=d e9end; e15writeln(e) e16end. CD DD a c d e Example of Dynamic Slicing (cont.) (2) Determine DD and CD s1begin s2a:=3; s3b:=3; s4readln(c); s5if c=0 then s6begin s7d:=functionA(a); s8e:=d s9end; s10else s11begin s12d:=functionB(b); s13e:=d s14end; s15writeln(e) s16end. (3) Collect Statements Slicing Criterion (c=0, s15, e)

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Architecture of Osaka Slicing System Osaka Slicing System

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Snapshot of Osaka Slicing System

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Call-Mark Slicing Dependences Control Dependence Data Dependence Execution Dependence shows relation that statement A is never executed if statement B is not executed. Dynamically set call-marks (flags that shows a caller statement is executed or not). Eliminate non-executed statements from PDG by using call-mark and ED relations.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Kusumoto, S., Nishimatsu, A., Nishie, K. and Inoue, K. : ``Experimental Evaluation of Program Slicing for Fault Localization'', Empirical Software Engineering, Vol.7, No.1, pp (2002). To evaluate the validity of slice With two independent groups Measured bug detection time Two sub-experiments were conducted. trial-1 : Group A used slice trial-2 : Group B used slice Experiment Using Program Slice trial-1 with Slicewithout Slice subjects A1A2A3B1B2B3 time average trial-2 without Slicewith Slice subjects A1A2A3B1B2B3 time average

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Characteristics of DC slice Effectiveness only “actual” Data Dependence relations are added to PDG slice size would be small Efficiency no execution trace is recorded faster execution than dynamic slicing PDG size is smaller than PDG size of static slice faster slice-extraction than static slicing