References: “Pruning Dynamic Slices With Confidence’’, by X. Zhang, N. Gupta and R. Gupta (PLDI 2006). “Locating Faults Through Automated Predicate Switching’’,

Slides:



Advertisements
Similar presentations
Problems and Their Classes
Advertisements

Delta Debugging and Model Checkers for fault localization
Delta Debugging AAIS 05 Curino, Giusti Delta Debugging Authors: Carlo Curino, Alessandro Giusti Politecnico di Milano An advanced debugging technique.
Automated Documentation Inference to Explain Failed Tests Sai Zhang University of Washington Joint work with: Cheng Zhang, Michael D. Ernst.
Programming Types of Testing.
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.
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,
Program Slicing Xiangyu Zhang. CS590F Software Reliability What is a slice? S: …. = f (v)  Slice of v at S is the set of statements involved in computing.
Pruning Dynamic Slices With Confidence Xiangyu Zhang Neelam Gupta Rajiv Gupta The University of Arizona.
02/13/20071 Indexing Noncrashing Failures: A Dynamic Program Slicing-Based Approach Chao Liu, Xiangyu Zhang, Jiawei Han, Yu Zhang, Bharat K. Bhargava University.
Delta Debugging - Demo Presented by: Xia Cheng. Motivation Automation is difficult Automation is difficult fail analysis needs complete understanding.
Testing an individual module
Describing Syntax and Semantics
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Automated Diagnosis of Software Configuration Errors
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
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.
Modular Programming Chapter Value and Reference Parameters t Function declaration: void computesumave(float num1, float num2, float& sum, float&
Objectives Understand the basic concepts and definitions relating to testing, like error, fault, failure, test case, test suite, test harness. Explore.
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.
Locating Causes of Program Failures Texas State University CS 5393 Software Quality Project Yin Deng.
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
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
School of Electrical Engineering and Computer Science University of Central Florida Anomaly-Based Bug Prediction, Isolation, and Validation: An Automated.
Scalable Dynamic Analysis for Automated Fault Location and Avoidance Rajiv Gupta Funded by NSF grants from CPA, CSR, & CRI programs and grants from Microsoft.
Interactive Debugging QuickZoom: A State Alteration and Inspection-based Interactive Debugger 1.
Chapter 13: Regression Testing Omar Meqdadi SE 3860 Lecture 13 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 Program Slicing Amir Saeidi PhD Student UTRECHT UNIVERSITY.
1 Test Selection for Result Inspection via Mining Predicate Rules Wujie Zheng
Xusheng Xiao North Carolina State University CSC 720 Project Presentation 1.
Chapter 11: Dynamic Analysis Omar Meqdadi SE 3860 Lecture 11 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
“Isolating Failure Causes through Test Case Generation “ Jeremias Rößler Gordon Fraser Andreas Zeller Alessandro Orso Presented by John-Paul Ore.
How to isolate cause of failure? 최윤라. Contents Introduction Isolating relevant input Isolating relevant states Isolating the error Experiments.
Author: Alex Groce, Daniel Kroening, and Flavio Lerda Computer Science Department, Carnegie Mellon University Pittsburgh, PA Source: R. Alur and.
Bug Localization with Association Rule Mining Wujie Zheng
Fixing the Defect CEN4072 – Software Testing. From Defect to Failure How a defect becomes a failure: 1. The programmer creates a defect 2. The defect.
1 CEN 4072 Software Testing PPT12: Fixing the defect.
 介紹 5 種錯誤定位技巧  Tarantula  Set-union  Set-intersection  Nearest Neighbor  Cause Transition.
Program Slicing Techniques CSE 6329 Spring 2013 Parikksit Bhisay
Automated Debugging with Error Invariants TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA A A A AA A A Chanseok Oh.
Pruning Dynamic Slices With Confidence Original by: Xiangyu Zhang Neelam Gupta Rajiv Gupta The University of Arizona Presented by: David Carrillo.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
Simplifying and Isolating Failure-Inducing Input Andreas Zeller and Ralf Hildebrandt IEEE Transactions on Software Engineering (TSE) 2002.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
On the Relation Between Simulation-based and SAT-based Diagnosis CMPE 58Q Giray Kömürcü Boğaziçi University.
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Testing and Debugging PPT By :Dr. R. Mall.
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.
Localizing Errors in Counterexample Traces
Chapter 8 – Software Testing
Verification and Testing
Aditya P. Mathur Purdue University
SwE 455 Program Slicing.
A Survey of Program Slicing Techniques: Section 4
Program Slicing Baishakhi Ray University of Virginia
Improving Test Suites for Efficient Fault Localization
Test Case Purification for Improving Fault Localization
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
BugHint: A Visual Debugger Based on Graph Mining
50.530: Software Engineering
Automatically Diagnosing and Repairing Error Handling Bugs in C
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:

References: “Pruning Dynamic Slices With Confidence’’, by X. Zhang, N. Gupta and R. Gupta (PLDI 2006). “Locating Faults Through Automated Predicate Switching’’, by X. Zhang, N. Gupta and R. Gupta (ICSE 2006). “Locating Faulty Code Using Failure-Inducing Chops’’, by N. Gupta, H. He, X. Zhang, N. Gupta and R. Gupta (ASE 2005). Automated Debugging

2 Problem Statement Given a faulty program and an input for which the program fails, identify as small as possible a subset of executed statements that is likely to contain the faulty code.

3 Prior Approaches Backward Dynamic Slicing [Korel and Laski IPL’98], [Agrawal and Horgan PLDI’90] [Zhang, Gupta, Zhang, ICSE’03, ICSE’04] Delta Debugging [Zeller and Hildebrandt TSE’02], [Zeller FSE’02 ]

4 Program Slice Backward Program Slice of a variable at a point in a program is the set of statements that might affect the value of the variable at that point. (static slice) “Program Slices: Formal, psychological, and practical investigations of an automatic program abstraction method”, Mark Wiser – [PhD Thesis, 1979]. “Programmers use Slicing when Debugging”, by Mark Wiser -- [CACM ’82]. “Program Slicing”, by M. Wiser -- [IEEE TSE, 1984].

5 Dynamic Program Slice Dynamic Program Slice of a variable at a point in the execution trace for an input is the set of statements that actually affected the value of the variable at that point during the execution. “Dynamic Program Slicing”, by B. Korel and J. Laski -- [IPL, 1988]. “Dynamic Program Slicing”, by H. Agrawal and J. Horgan -- [PLDI, 1990]. “Precise Dynamic Algorithms”, by X. Zhang, R.Gupta, Y. Zhang -- [ICSE 2003].

6 Backward Dynamic Slicing Construct a dynamic dependence graph and compute a transitive closure over dynamic control and data dependences to compute the slice Backward dynamic slice of a faulty output is expected to contain the faulty code. However, backward dynamic slices can be much larger than the faulty code.

7 Delta Debugging Given a faulty program and a failed run, Simplify or Isolate a minimal failure-inducing input. [Zeller and Hildebrandt TSE’02] Isolate minimal failure-inducing differences in program states of a failed run and a successful run and build a cause effect chain in terms of relevant state differences [Zeller FSE’02] It is not easy to link cause effect chains to faulty source code.

8 Delta Debugging: Cause Effect Chains Cause Effect Chain

9 Motivation To narrow the search for faulty code by combining the potential of Delta Debugging in identifying a minimal failure- inducing input Dynamic program slicing in able to link a failed output directly to the source code causing the failure

10 Our Approach Given a failed run: Identify a minimal failure- inducing input Compute forward dynamic slice (FS) of the input identified above Compute backward dynamic slice (BS) of the faulty output Intersect FS and BS to compute Failure Inducing Chop “Locating Faulty Code Using Failure-Inducing Chops’’, by N. Gupta, H. He, X. Zhang, N. Gupta and R. Gupta (ASE 2005).

11 Minimal Failure Inducing Input  Simplify Input for Failed Run ( I f ) to produce minimal Input I f ’ such that removing any single input entity from I f ’ causes the failure to disappear.  Isolate minimum failure-inducing input difference between inputs for a failing and a passing run. Given inputs I f and I s for a failed and a passing run respectively, compute I f ’ and I s ’ such that any single part of I f ’- I s ’ if removed from I f ’ will cause the failure to disappear if added to I s ’ will cause the failure to appear.

12 Computing Minimal Failure-Inducing input Instead of binary input division algorithms ddmin and dd from [Zeller TSE’02], a linear search algorithm by removing input from one end may also be used to identify minimal-failure inducing input. In fact, removal of input from one end may also be done in a binary manner to speed up the search for failure inducing input.

13 Experiments: Siemens Suite

14 Experiments: Siemens Suite

15 Experiments: Siemens Suite

16 Experiments: Siemens Suite

17 Experiments: Memory Related Bugs LOC The statement causing memory corruption was always found Note that forward slices were much smaller than backward slices and in the Fchop in the above experiments. were as effective as dynamic slices in containing the failure causing code.

18 Automatic Predicate Switching Given an failing execution, automatically recognize an executed predicate instance, critical predicate, forcibly flipping which produces the correct output. The critical predicate is provided as evidence to the program failure in addition to the wrong output. “ Locating Faults Through Automated Predicate Switching’’, by X. Zhang, N. Gupta and R. Gupta (ICSE 2006).

19 Bidirectional Slicing with Critical Predicates Given a failed run: Identify the critical predicate Compute bidirectional slice (BiS) of the critical predicate FS(CP) BiS(CP) + CP

20 Coarse-grained Pruning by Intersecting Slices failure inducing input BS FS FS(CP) BiS(CP) + CP BS^FS Coarse-grained pruning by intersecting multiple types (backward, forward, bidirectional) of dynamic slices -- [ASE’05, ICSE’06]

21 Forward Slice limitations Input1 = (a=3, b=2, c=1)  failed run Input2 = (a=1, b=2, c=1)  sucessful run - include statements in BwdSlice that do not depend upon any input variable into FwdSlice

22 Backward Slice limitations Input = (a=1, b=2)  failed run Execution trace: 1,2,3,4,6 BwdDS (y, 6, Input) = {3}  does not contain line 4. - Use relevant backward dynamic slice

23 Further Pruning Using Confidence Analysis Types of evidences used in coarse-grained pruning: Wrong output Failure inducing input Critical predicate Fine-grained pruning of a backward slice by exploiting partially correct output using confidence analysis “ Pruning Dynamic Slices With Confidence’’, by X. Zhang, N. Gupta and R. Gupta (PLDI 2006).

24 Fine-grained Pruning by Exploiting Correct Outputs …… 10. A = 1 (Correct: A=3) … B = A % 2 …… 30. C = A + 2 …… 40. Print (B) 41. Print (C)  Correct outputs produced in addition to wrong output.  BS(O wrong ) – BS (O correct ) is problematic. {10, 30, 41} {10, 20, 40} = {30,41}

25 Confidence Analysis  Value produced at node n can reach only wrong output nodesn There is no evidence that n is correct, so it should be in the pruned slice. Should we include n in the slice?? Confidence(n)=0 Confidence(n)=?; 0 ≤ ? ≤ 1  Value produced at node n can reach both the correct and wrong output nodes.nnn Confidence(n)=1  Value produced at n can reach only correct outputs There is no evidence of incorrectness of n. Therefore it cannot be in the slice.

26 Confidence Analysisnn Range(n)={ a, b, c, d, e, f, g } Alt(n)={ a } Value(n) = a Value(n) = bValue(n) = c, c When |Alt(n)|==1, we have the highest confidence (=1) on the correctness of n; When |Alt(n)|==|Range(n)|, we have the lowest confidence (=0). |Range(n)| >= |Alt(n)|>=1 Alt(n) is a set of possible values of the variable defined by n, that when propagated through the dynamic dependence graph, produce the same values for correct outputs.

27 Confidence Analysis: Example …… 10. A =... … B = A % 2 …… 30. C = A + 2 …… 40. Print (B) 41. Print (C)

28 Confidence Analysis: Two Problems  How to decide the Range of values for a node n? Based on variable type (e.g., Integer). Static range analysis. Our choice:  Dynamic analysis based on value profiles.  Range of values for a statement is the set of values defined by all of the execution instances of the statement during the program run.  How to compute Alt(n)? Consider the set of correct output values as constraints. Compute Alt(n) by backward propagation of constraints through the dynamic dependence subgraph corresponding to the slice.

29 Computing Alt(n) Along Data Dependence S1: T=...9 S2: X=T+110 S3: Y=T%30 (X,T)= (6,5) (9,8) (10,9) (T,...)= (1,...) (3,...) (5,...) (8,...) (9,...) (Y,T)=( 0,3) (0,9) (1,1) (2,5) (2,8) alt(S1) = ∩ alt = {9} alt(S2)={10} alt(S3)={0,1}

30 Computing Alt(n) Along Control Dependence S1: if (P) …True S2: X=T+110 S3: Y=T%30 (X,T)= (6,5) (9,8) (10,9) (Y,T)=( 0,3) (0,9) (1,1) (2,5) (2,8) alt(S1) = {True} alt(S2)={10} alt(S3)={0,1}

31 Characteristics of Siemens Suite Programs ProgramDescriptionLOCVersionsTests print_tokensLexical analyzer print_tokens2Lexical analyzer replacePattern replacement schedulePriority scheduler schedule2Priority scheduler gzipUnix utility flexUnix utility Each faulty version has a single manually injected error. All the versions are not included:  No output is produced.  Faulty statement is not contained in the backward slice. For each version three tests were selected.

32 Results of Pruning ProgramDSPDS max PDS max / DS PDS min %Missed by PDS min print_tokens %350% print_tokens %550% replace %4338.1% schedule %5620% schedule %500% gzip %10100% flex %250% On average, PDS max = 41.1% of DS

33 Confidence Based Prioritization DD – dep. distance CV – confidence values Executed statement instances examined (%)

34 The Potential of Confidence Analysis (1)  Case Study (replace v14) 88  74  23 Dynamic Slicer With Confidence Pruned Slices User Verified Statements as correct Buggy Code Input

35 The Potential of Confidence Analysis (2)  Relevant slicing (gzip v3 run r1) Potential dep. Data dep.

36 Conclusions Our work for the first time shows how application of forward dynamic slices in locating faulty code is enabled by the delta debugging technique. We have introduced the notion of switching predicate and defined a bidirectional slice to narrow the search for faulty code We have developed a framework for confidence analysis that exploits partially correct output Our approach enables combining various types of evidences such as wrong output, failure inducing input, critical predicate and partially correct output to reduce the search space for faulty code and to broaden the applicability of dynamic slicing.