Slicing Methods Using Static and Dynamic Information Yoshiyuki Ashida, Fumiaki Ohata, † † † ‡ †‡ Katsuro Inoue Osaka University Nara Institute of Science.

Slides:



Advertisements
Similar presentations
Program Slicing and Debugging Elton Alves Informatics Center Federal University of Pernambuco (UFPE) V Encontro Brasilieiro de Testes de Software (EBTS),
Advertisements

Selection Process If … then … else.... Condition Process 2 Process 1 Y.
Program Slicing – Based Techniques
School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) SSA Guo, Yao.
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
An Evaluation of MC/DC Coverage for Pair-wise Test Cases By David Anderson Software Testing Research Group (STRG)
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.
Principles of programming languages 4: Parameter passing, Scope rules Department of Information Science and Engineering Isao Sasano.
Program Representations. Representing programs Goals.
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.
Dynamic Slicing Khanh Nguyen Donald Bren School of Information & Computer Science University of California, Irvine.
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. CS590F Software Reliability Why Program Representations  Initial representations Source code (across languages).
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 9: Pass-by-Value.
Arrays--data structure. Arrays 7 zConsider how you would store five integer values in the memory of the computer. zOne way to do this is to create five.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
PJSISSTA '001 Black-Box Test Reduction Using Input-Output Analysis ISSTA ‘00 Patrick J. Schroeder, Bogdan Korel Department of Computer Science Illinois.
Impact Analysis of Database Schema Changes Andy Maule, Wolfgang Emmerich and David S. Rosenblum London Software Systems Dept. of Computer Science, University.
Reverse Engineering State Machines by Interactive Grammar Inference Neil Walkinshaw, Kirill Bogdanov, Mike Holcombe, Sarah Salahuddin.
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.
Presented By Dr. Shazzad Hosain Asst. Prof., EECS, NSU
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.
Do … while ( continue_cond ) Syntax: do { stuff you want to happen in the loop } while (continue_condition);
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University Analysis and Implementation Method of Program to Detect Inappropriate.
Bug Localization with Machine Learning Techniques Wujie Zheng
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 19: Searching and Sorting Algorithms.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Design and Implementation.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University Inoue Laboratory Eunjong Choi 1 Investigating Clone.
Fast Points-to Analysis for Languages with Structured Types Michael Jung and Sorin A. Huss Integrated Circuits and Systems Lab. Department of Computer.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.
Mark Marron 1, Deepak Kapur 2, Manuel Hermenegildo 1 1 Imdea-Software (Spain) 2 University of New Mexico 1.
1 Program Slicing Amir Saeidi PhD Student UTRECHT UNIVERSITY.
IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University.
Static Program Analysis of Embedded Software Ramakrishnan Venkitaraman Graduate Student, Computer Science Advisor: Dr. Gopal Gupta
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University July 21, 2008WODA.
Copyright © 2015 NTT DATA Corporation Kazuo Kobori, NTT DATA Corporation Makoto Matsushita, Osaka University Katsuro Inoue, Osaka University SANER2015.
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.
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University A Slicing Method for Object-Oriented Programs Using Lightweight.
Comparing model-based and dynamic event-extraction based GUI testing techniques : An empirical study Gigon Bae, Gregg Rothermel, Doo-Hwan Bae The Journal.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Extraction of.
SAFEWARE System Safety and Computers Chap18:Verification of Safety Author : Nancy G. Leveson University of Washington 1995 by Addison-Wesley Publishing.
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.
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
1 Iterative Program Analysis Mooly Sagiv Tel Aviv University Textbook: Principles of Program.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A Metric-based Approach for Reconstructing Methods.
Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
Phoenix Based Dynamic Slicing Debugging Tool Eric Cheng Lin Xu Matt Gruskin Ravi Ramaseshan Microsoft Phoenix Intern Team (Summer '06)
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Chapter 3 of Programming Languages by Ravi Sethi
Principles of programming languages 4: Parameter passing, Scope rules
A Survey of Program Slicing Techniques: Section 4
○Yuichi Semura1, Norihiro Yoshida2, Eunjong Choi3, Katsuro Inoue1
Program Slicing Baishakhi Ray University of Virginia
Test Case Purification for Improving Fault Localization
Closure Representations in Higher-Order Programming Languages
Predicting Fault-Prone Modules Based on Metrics Transitions
Can Carlak, Jiwon Joung, Brandon Nguyen, Won Park
CPRE 416-Software Evolution and Maintenance-Lecture 11
George Mason University
Precise Condition Synthesis for Program Repair
Dotri Quoc†, Kazuo Kobori†, Norihiro Yoshida
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:

Slicing Methods Using Static and Dynamic Information Yoshiyuki Ashida, Fumiaki Ohata, † † † ‡ †‡ Katsuro Inoue Osaka University Nara Institute of Science and Technology

Contents zProgram slice ystatic slice, dynamic slice, their problems zProposal of methods using both static and dynamic information yPartial analysis yDynamic data dependence analysis

Background zSoftware systems are becoming large and complex. zDevelopers are spending a large amount of time to test their systems. Various techniques for improving the efficiency of debugging

Localization zDetecting faults in large source programs are difficult. zIf we could... yselect specific portions in a source code, and yconcentrate out attention only to those potions, performance of the activities would increase. Program slice is proposed to localize faults.

Program slice Definition: a set of statements that affects the value of a variable v in a statement s (v, s ): slicing criterion If we specify a concerned variable, all the affecting statements are extracted. effective for debugging

Kinds of program slicing zStatic slicing yusing static information(a source program) zDynamic slicing yusing dynamic information(an execution trace)

DD(s, v, t ): zVariable v is defined in a statement s. zv is referred in a statement t, and zat least one execution path without re-definition between s and t exists. Data dependence 1: a:=5; 2: b:=a+a; 3: if b>0 then 4: c:=a 5: else 6: d:=b; DD a b b a

Control dependence CD(s, t ): zs is a conditional predicate, and zthe result of s determines whether statement t is executed or not. 1: a:=5; 2: b:=a+a; 3: if b>0 then 4: c:=a 5: else 6: d:=b; CD

1: a:=3; 2: b:=2; 3: readln(c); 4: if c=0 then 5: d:=a 6:else 7: d:=a+1; 8: e:=b+a; 9: writeln(d); 10: writeln(e); 1: a:=3; 2: b:=2; 3: readln(c); 4: if c=0 then 5: d:=a 6:else 7: d:=a+1; 8: e:=b+a; 10: writeln(e); slicing criterion(9, d) S5S7 S4 S1 S3 S9 S2 S8 S10 CD DD a dd c a a b e Process of static slicing S5S7 S1 S3 S4 S9 9: writeln(d);

1: a:=3; 2: b:=2; 3: readln(c); 4: if c=0 then 5: d:=a 6:else 7: d:=a+1; 8: e:=b+a; 9: writeln(d); 10: writeln(e); 1: a:=3; 2: b:=2; 3: readln(c); 4: if c=0 then 5: d:=a 6:else 7: d:=a+1; 8: e:=b+a; 9: writeln(d); 10: writeln(e); e8: writeln(e); e6: e:=b+a; e4: if c=0 then e2: b:=2; e1: a:=3; e3: readln(c); e5: d:=a e7: writeln(d); Execution trace with input c=0 Process of dynamic slicing 9: writeln(d); e7: writeln(d); e5: d:=a e4: if c=0 then e3: readln(c); e1: a:=3; a b a e a c

Comparison zSlice size: static > dynamic yStatic slicing considers all possible paths. yDynamic slicing only considers a specified executed path. zSlicing cost: static ≪ dynamic yRecording an execution trace needs much cost.

Motivation Small slice size Effective localization Expensive slicing cost Slicing methods mixing both static and dynamic information

Contents zProgram slice ystatic slice, dynamic slice, their problems zProposal of methods using both static and dynamic information yPartial analysis yDynamic data dependence analysis

Features of partial analysis zCut down non-executed statements yreduce a slice size zAnalyze only necessary(executed) statements yreduce the cost of constructing PDG zUse simple dynamic information yprevent the execution time from rising

Process of partial analysis a source program a reduced source program dynamic information execution PDG cutting down analysis

Evaluation of partial analysis(1) z Measurement yslice size yexecution time yanalysis time We implemented this method within our Osaka Slicing System (target language: Pascal). zMethods ystatic slice ydynamic slice ypartial analysis

Evaluation of partial analysis(2) slice size(LOC) static pa dynamic P P P execution time(ms) static pa dynamic P P P3 4,046 4,104 3,1635 analysis time(ms) static pa dynamic P N/A P2 1,602 1,142 N/A P3 8,125 3,957 N/A program size(LOC) P1: 88 P2: 387 P3: 941

Discussion zSlice size:static > pa > dynamic yin between static and dynamic slice zExecution time:static ≦ pa ≪ dynamic yalmost the same as static slicing zAnalysis time:static > pa y50-70% of static slicing zreasonable slicing results and good analysis time with a slight additional execution time

Contents zProgram slice ystatic slice, dynamic slice, their problems zProposal of methods using both static and dynamic information yPartial analysis yDynamic data dependence analysis

Array and pointer analysis Limits of static analyses zarray variables 1: a[0]:=0; 2: a[1]:=3; 3: readln(b); 4: a[b]:=2; 5: c:=a[0]+4; 6: writeln(c); zpointer variables 1: a:=0; 2: b:=2; 3: c:=&a; 4: d:=&b; 5: *c:=4; 6: writeln(a); b a a a a

Static analyses of array and pointer variables needs much cost, and the produced result is low precision. zDynamic data dependence analysis yData dependence analysis: dynamic yControl dependence analysis: static yNodes in dependence graph: statements in a source program Dynamic data dependence analysis

a source program data dependence execution & analysis PDG analysis control dependence mixing Process of dynamic data dependence analysis

How to analyze data dependence 1: a[0]:=0; 2: a[1]:=3; 3: readln(b); 4: a[b]:=2; 5: c:=a[0]+4; 6: writeln(c); 2: a[1]:=3; 3: readln(b); 4: a[b]:=2; 5: c:=a[0]+4; 6: writeln(c); 1: a[0]:=0; Execution with input b=0 where variables are defined a[0] a[1] b c e1 s e2 s1 s2 - - e3 s1 s2 s3 - e4 s4 s2 s3 - e5 s4 s2 s3 s5 e6 s4 s2 s3 s5 b a[0] c

Evaluation of dynamic data dependence analysis normal 356 1,955 22,241 all DD 1,159 14, ,808 array & pointer 643 7, ,410 1, Execution time of merge sort(ms) 10,000 # of input data to sample program

Discussion zNeed some additional execution time to extract DDRs yThe execution time of dynamic data dependence analysis is 3-9 times slower than normal execution time. yIf we only analyze array & pointer variables, the execution time is 2-5 times slower. zAnalyze array & pointer variables precisely

Conclusions and Future Works zPropose and evaluate two slicing methods yPartial analysis yDynamic data dependence analysis zPromising approaches to get effective program localization zImplement our methods within our Java Slicing System(under construction)