1 CS510 S o f t w a r e E n g i n e e r i n g Delta Debugging Simplifying and Isolating Failure-Inducing Input Andreas Zeller and Ralf Hildebrandt IEEE.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

Delta Debugging and Model Checkers for fault localization
CSE 1301 Lecture 5B Conditionals & Boolean Expressions Figures from Lewis, “C# Software Solutions”, Addison Wesley Briana B. Morrison.
Static Single Assignment CS 540. Spring Efficient Representations for Reachability Efficiency is measured in terms of the size of the representation.
An Empirical Study of the Reliability in UNIX Utilities Barton Miller Lars Fredriksen Brysn So Presented by Liping Cai.
Delta Debugging AAIS 05 Curino, Giusti Delta Debugging Authors: Carlo Curino, Alessandro Giusti Politecnico di Milano An advanced debugging technique.
Automated Fitness Guided Fault Localization Josh Wilkerson, Ph.D. candidate Natural Computation Laboratory.
CS4723 Software Engineering Lecture 10 Debugging and Fault Localization.
Simplifying and Isolating Failure-Inducing Input Presented by Nir Peer University of Maryland Andreas Zeller Saarland University, Germany Ralf Hildebrandt.
1 Software Testing and Quality Assurance Lecture 9 - Software Testing Techniques.
CS590Z Delta Debugging Xiangyu Zhang (slides adapted from Tevfik Bultan’s )
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
Statistical Debugging: A Tutorial Steven C.H. Hoi Acknowledgement: Some slides in this tutorial were borrowed from Chao Liu at UIUC.
Delta Debugging - Demo Presented by: Xia Cheng. Motivation Automation is difficult Automation is difficult fail analysis needs complete understanding.
Domain Testing Based on Character String Predicate Ruilian Zhao Computer Science Dept. Beijing University of Chemical Technology Michael R. Lyu Computer.
272: Software Engineering Fall 2008 Instructor: Tevfik Bultan Lecture 17: Automated Debugging.
C++ for Engineers and Scientists Third Edition
Automated Diagnosis of Software Configuration Errors
50.530: Software Engineering Sun Jun SUTD. Week 3: Delta Debugging.
Delta Debugging CS All Windows 3.1 Windows 95 Windows 98 Windows ME Windows 2000 Windows NT Mac System 7 Mac System 7.5 Mac System Mac System.
Software Testing and Validation SWE 434
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Lucas Bang Lecture 15: Linked data structures.
Designing For Testability. Incorporate design features that facilitate testing Include features to: –Support test automation at all levels (unit, integration,
Locating Causes of Program Failures Texas State University CS 5393 Software Quality Project Yin Deng.
1 Delta Debugging Koushik Sen EECS, UC Berkeley. 2 All Windows 3.1 Windows 95 Windows 98 Windows ME Windows 2000 Windows NT Mac System 7 Mac System 7.5.
CS5103 Software Engineering Lecture 17 Debugging.
Scalable Statistical Bug Isolation Ben Liblit, Mayur Naik, Alice Zheng, Alex Aiken, and Michael Jordan, 2005 University of Wisconsin, Stanford University,
Scalable Statistical Bug Isolation Ben Liblit, Mayur Naik, Alice Zheng, Alex Aiken, and Michael Jordan University of Wisconsin, Stanford University, and.
Tracking The Problem  By Aaron Jackson. What’s a Problem?  A suspicious or unwanted behavior in a program  Not all problems are errors as some perceived.
© SERG Dependable Software Systems (Mutation) Dependable Software Systems Topics in Mutation Testing and Program Perturbation Material drawn from [Offutt.
A Specification Language and Test Planner for Software Testing Aolat A. Adedeji 1 Mary Lou Soffa 1 1 DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF VIRGINIA.
Variables, Functions & Parameter Passing CSci 588 Fall 2013 All material not from online sources copyright © Travis Desell, 2011.
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
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Scalable Statistical Bug Isolation Authors: B. Liblit, M. Naik, A.X. Zheng, A. Aiken, M. I. Jordan Presented by S. Li.
CEN 4072 Software Testing Chapter 1: How Failures Come To Be.
The Daikon system for dynamic detection of likely invariants MIT Computer Science and Artificial Intelligence Lab. 16 January 2007 Presented by Chervet.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
Simplifying failure Inducing input Vikas, Purdue.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 10: Automated Debugging.
CSE 1301 Lecture 8 Conditionals & Boolean Expressions Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
CSE 332: C++ debugging Why Debug a Program? When your program crashes –Finding out where it crashed –Examining program memory at that point When a bug.
1 Test Selection for Result Inspection via Mining Predicate Rules Wujie Zheng
1 Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
1 Command-Line Processing In many operating systems, command-line options are allowed to input parameters to the program SomeProgram Param1 Param2 Param3.
References: “Pruning Dynamic Slices With Confidence’’, by X. Zhang, N. Gupta and R. Gupta (PLDI 2006). “Locating Faults Through Automated Predicate Switching’’,
“Isolating Failure Causes through Test Case Generation “ Jeremias Rößler Gordon Fraser Andreas Zeller Alessandro Orso Presented by John-Paul Ore.
Bug Localization with Association Rule Mining Wujie Zheng
Variables and Functions ROBOTC Software © 2012 Project Lead The Way, Inc.Principles of Engineering.
Statistical Debugging CS Motivation Bugs will escape in-house testing and analysis tools –Dynamic analysis (i.e. testing) is unsound –Static analysis.
Cooperative Bug Isolation CS Outline Something different today... Look at monitoring deployed code –Collecting information from actual user runs.
Simplifying and Isolating Failure-Inducing Input Andreas Zeller and Ralf Hildebrandt IEEE Transactions on Software Engineering (TSE) 2002.
CSE 332: C++ expressions Expressions: Operators and Operands Operators obey arity, associativity, and precedence int result = 2 * 3 + 5; // assigns 11.
1 Chapter 2 Program Performance. 2 Concepts Memory and time complexity of a program Measuring the time complexity using the operation count and step count.
Automated Adaptive Bug Isolation using Dyninst Piramanayagam Arumuga Nainar, Prof. Ben Liblit University of Wisconsin-Madison.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Delta Debugging CS Simplification Once we have reproduced a program failure, we must find out what’s relevant: Does failure really depend on 10,000.
Test Case Purification for Improving Fault Localization presented by Taehoon Kwak SoftWare Testing & Verification Group Jifeng Xuan, Martin Monperrus [FSE’14]
PPT1: How failures come to be
Automated Fitness Guided Fault Localization
(slides adapted from Tevfik Bultan’s )
50.530: Software Engineering
Profs. Brewer CS 169 Lecture 13
Using Automated Program Repair for Evaluating the Effectiveness of
50.530: Software Engineering
Presentation transcript:

1 CS510 S o f t w a r e E n g i n e e r i n g Delta Debugging Simplifying and Isolating Failure-Inducing Input Andreas Zeller and Ralf Hildebrandt IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. 28, NO. 2, FEBRUARY 2002

2 CS510 S o f t w a r e E n g i n e e r i n g Problem In 1999 Bugzilla, the bug database for the browser Mozilla, listed more than 370 open bugs Each bug in the database describes a scenario which caused software to fail these scenarios are not simplified they may contain a lot of irrelevant information a lot of the bug reports could be equivalent Overwhelmed with this work Mozilla developers sent out a call for volunteers Process the bug reports by producing simplified bug reports Simplifying means: turning the bug reports into minimal test cases where every part of the input would be significant in reproducing the failure

3 CS510 S o f t w a r e E n g i n e e r i n g An Example Bug Report Printing the following file causes Mozilla to crash: All Windows 3.1 Windows 95<OPTION VALUE="Windows 98">Windows 98 Windows ME Windows 2000<OPTION VALUE="Windows NT">Windows NT Mac System 7 Mac System 7.5<OPTION VALUE="Mac System 7.6.1">Mac System Mac System 8.0 Mac System 8.5 Mac System 8.6 Mac System 9.x MacOS X Linux BSDI FreeBSD NetBSD<OPTION VALUE="OpenBSD">OpenBSD AIX<OPTION Continued in the next page

4 CS510 S o f t w a r e E n g i n e e r i n g VALUE="BeOS">BeOS HP-UX<OPTION VALUE="IRIX">IRIX Neutrino OpenVMS OS/2<OPTION VALUE="OSF/1">OSF/1 Solaris SunOS other -- P1 P2 P3 P4<OPTION VALUE="P5">P5 blocker critical major<OPTION VALUE="normal">normal minor trivial enhancement

5 CS510 S o f t w a r e E n g i n e e r i n g Delta-Debugging It is hard to figure out what the real cause of the failure is just by staring at that file It would be very helpful in finding the error if we can simplify the input file and still generate the same failure A more desirable bug report looks like this Printing an HTML file which consists of: causes Mozilla to crash. The question is: Can we automate this? Andreas Zeller

6 CS510 S o f t w a r e E n g i n e e r i n g Overview Let ’ s use a smaller bug report as a running example: When Mozilla tries to print the following HTML input it crashes: How do we go about simplifying this input? Manually remove parts of the input and see if it still causes the program to crash For the above example assume that we remove characters from the input file

7 CS510 S o f t w a r e E n g i n e e r i n g 1 F 2 P 3 P 4 P 5 F 6 F 7 P 8 P 9 P 10 F 11 P 12 P 13 P Bold parts remain in the input, the rest is removed F means input caused failure P means input did not cause failure (input passed)

8 CS510 S o f t w a r e E n g i n e e r i n g 14 P 15 P 16 F 17 F 18 F 19 P 20 P 21 P 22 P 23 P 24 P 25 P 26 F

9 CS510 S o f t w a r e E n g i n e e r i n g Example After 26 tries we found that: Printing an HTML file which consists of: causes Mozilla to crash. Delta debugging technique automates this approach of repeated trials for reducing the input.

10 CS510 S o f t w a r e E n g i n e e r i n g Monotonicity The super string of a failure inducing string always induces the failure DD is not effective for cases without monotonicity.

11 CS510 S o f t w a r e E n g i n e e r i n g Minimality A test case c  c F is the global minimum of c F if for all c ’  c F, |c ’ | < |c|  test(c ’ )  F Finding the global minimum may require us to perform exponential number of tests

12 CS510 S o f t w a r e E n g i n e e r i n g Minimality A test case c  c F is called a local minimum of c F if for all c ’  c, test(c ’ )  F A test case c  c F is n-minimal if for all c ’  c, |c|  |c ’ |  n  test(c ’ )  F The delta debugging algorithm finds a 1-minimal test case

2016年3月5日星期六 2016年3月5日星期六 2016年3月5日星期六 13 CS510 S o f t w a r e E n g i n e e r i n g

2016年3月5日星期六 2016年3月5日星期六 2016年3月5日星期六 14 CS510 S o f t w a r e E n g i n e e r i n g

15 CS510 S o f t w a r e E n g i n e e r i n g More Efficient Algorithm Initially, n=2 (1) Divide a string S equally into  1,  2,...  n and the respective complements are  1,  2,...,  n. (2) Test each  1,  2,...  n and  1,  2,...,  n. if (all pass) { n=2n; if (n>|s|) return the most recent failure inducing substring. else goto (1) } else if (  t fails) { n=2; s=  t if (|s|==1) return s else goto (1) } else { /*  t fails */ s=  t ; n=n-1; goto (1); }

16 CS510 S o f t w a r e E n g i n e e r i n g Examples a b c d e f * h Program fails on any substrings containing ‘*’ a b c d e f g h Any strings containing a g h fail

17 CS510 S o f t w a r e E n g i n e e r i n g Case Study The following C program causes GCC to crash #define SIZE 20 double mult(double z[], int n) { int i, j ; i = 0; for (j = 0; j < n; j++) { i = i + j + 1; z[i] = z[i] *(z[0]+1.0); return z[n]; } Continued in the next page

18 CS510 S o f t w a r e E n g i n e e r i n g void copy(double to[], double from[], int count) { int n = count + 7) / 8; switch(count % 8) do { case 0: *to++ = *from++; case 7: *to++ = *from++; case 6: *to++ = *from++; case 5: *to++ = *from++; case 4: *to++ = *from++; case 3: *to++ = *from++; case 2: *to++ = *from++; case 1: *to++ = *from++; } while ( --n > 0); return mult(to, 2); } int main(int argc, char *argv[]) { double x[SIZE], y[SIZE]; double *px = x; while (px < x + SIZE) *px++ = (px – x) * (SIZE + 1.0); return copy(y, x, SIZE); }

19 CS510 S o f t w a r e E n g i n e e r i n g The original input file 755 characters Delta debugging algorithm minimizes the input file to the following file with 77 characters If a single character is removed from this file then it does not induce the failure t(double z[],int n){int i,j;for(;;){i=i+j+1;z[i]=z[i]* (z[0]+0);}return[n];}

20 CS510 S o f t w a r e E n g i n e e r i n g Isolating Failure Inducing Differences Instead of minimizing the input that causes the failure we can also try to isolate the differences that cause the failure Minimization means to make each part of the simplified test case relevant: removing any part makes the failure go away Isolation means to find one relevant part of the test case: removing this particular part makes the failure go away For example changing the input from to SELECT NAME="priority" MULTIPLE SIZE=7> makes the failure go away This means that inserting the character < is a failure inducing difference Delta debugging algorithm can be modified to look for minimal failure inducing differences

21 CS510 S o f t w a r e E n g i n e e r i n g Statistical Debugging Empirical evaluation of the tarantula automatic fault- localization technique James A. Jones and Mary Jean Harrold Proceedings of the 20th IEEE/ACM International Conference on Automated Software Engineering, Pages , 2005.

22 CS510 S o f t w a r e E n g i n e e r i n g What is statistical debugging It relies on a large pool of test cases. Some failing and the other passing. Dynamic info from both passing and failing cases are aggregated to localize the possible faulty statements. The end outcome is often a ranked list of statements. Tarantula Hypothesis: a faulty statement is more likely executed in failing runs. F(s)/P(s): the number of failing/passing cases that execute s. Suspiciousness(s)= F(s) |failing| F(s) |failing| P(s) |passing| +

23 CS510 S o f t w a r e E n g i n e e r i n g Scalable Remote Bug Isolation Tarantula requires a large pool of test cases, which may not be available. Idea: rely on deployed systems and end users to provide needed dynamic information. Based on predicates Branch predicates Function return (<0, ==0, <=0, …) Scalar pairs For each assignment x=…, from some other variables y i and some constants ci, acquire (x==y i, x<=y i,... x==c i ) Collect evaluation of these predicates.

24 CS510 S o f t w a r e E n g i n e e r i n g Statistical analysis F(p)/S(p) – how many test cases in which p is true and the program fails/passes. Failure(p)= F(p) +S(p)F(p) 1.f=…; 2.if (f==null) { 3. x=0; 4. …=*f; 5.} Assume we have 100 test cases with 90 passing and 10 failing.

25 CS510 S o f t w a r e E n g i n e e r i n g However, there are predicates whose executions only occur in failing runs but not faulty. A context value is computed to adjust the suspiciousness F(p is observed) / S(p is observed): how many cases in which p is executed and the program fails/passes Context(p)= F(p is observed) +S(p is observed)F(p is observed) 0. x=10; 1. f=…; 2. if (f==null) { 2.5 if (x>0) 3. x=0; 4. …=*f; 5. } Assume we have 100 test cases with 90 passing and 10 failing. Context Suspiciousness(p)=Failure(p)-Context(p)

26 CS510 S o f t w a r e E n g i n e e r i n g Scalability Sampling Create two versions of a function, one is the original, the other is the instrumented Using a counter instead of a % operation to perform sampling Assume one sample is collected for n instances counter--; If (!counter) { counter=n; call the instrumented version; } else { call the original version; }

27 CS510 S o f t w a r e E n g i n e e r i n g Limitations of Statistical Debugging Need many test cases, including passing and failing. Unclear how to handle multiple bugs.