Locating Causes of Program Failures Texas State University CS 5393 Software Quality Project Yin Deng.

Slides:



Advertisements
Similar presentations
Delta Debugging and Model Checkers for fault localization
Advertisements

Telecooperation/RBG Technische Universität Darmstadt Copyrighted material; for TUD student use only Introduction to Computer Science I Topic 16: Exception.
Delta Debugging AAIS 05 Curino, Giusti Delta Debugging Authors: Carlo Curino, Alessandro Giusti Politecnico di Milano An advanced debugging technique.
Math 130 Introduction to Computing Sorting Lecture # 17 10/11/04 B Smith: Save until Week 15? B Smith: Save until Week 15? B Smith: Skipped Spring 2005?
Software Reliability Engineering
CS590Z Delta Debugging Xiangyu Zhang (slides adapted from Tevfik Bultan’s )
1 Software Testing and Quality Assurance Lecture 36 – Software Quality Assurance.
SE 450 Software Processes & Product Metrics Reliability: An Introduction.
Statistical Debugging: A Tutorial Steven C.H. Hoi Acknowledgement: Some slides in this tutorial were borrowed from Chao Liu at UIUC.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing 2.
Informationsteknologi Monday, September 10, 2007Computer Systems/Operating Systems - Class 31 Today’s class Review of more C Operating system overview.
Aho-Corasick String Matching An Efficient String Matching.
Delta Debugging - Demo Presented by: Xia Cheng. Motivation Automation is difficult Automation is difficult fail analysis needs complete understanding.
272: Software Engineering Fall 2008 Instructor: Tevfik Bultan Lecture 17: Automated Debugging.
Analysis of Algorithms 7/2/2015CS202 - Fundamentals of Computer Science II1.
Swami NatarajanJuly 14, 2015 RIT Software Engineering Reliability: Introduction.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
Topic #10: Optimization EE 456 – Compiling Techniques Prof. Carl Sable Fall 2003.
Artificial Intelligence Lecture No. 15 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
Data Flow in Static Profiling Cathal Boogerd, Delft University, The Netherlands Leon Moonen, Simula Research Lab, Norway ?
Week 2 CS 361: Advanced Data Structures and Algorithms
Chapter 8 – Software Testing Lecture 1 1Chapter 8 Software testing The bearing of a child takes nine months, no matter how many women are assigned. Many.
Lecture 11 Testing and Debugging SFDV Principles of Information Systems.
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.
How Failures Come To Be By: Blake Burton. Golden rule: Software testing begins with careful design Modularity of your code is a big part in software testing.
CEN 4072 Software Testing Chapter 1: How Failures Come To Be.
Coursenotes CS3114: Data Structures and Algorithms Clifford A. Shaffer Department of Computer Science Virginia Tech Copyright ©
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Today’s Agenda  HW #1  Finish Introduction  Input Space Partitioning Software Testing and Maintenance 1.
1 Chapter 10: Introduction to Inference. 2 Inference Inference is the statistical process by which we use information collected from a sample to infer.
Dale Roberts CSCI N305 Functions Recursion Department of Computer and Information Science, School of Science, IUPUI.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 10: Automated Debugging.
Data Structure Introduction.
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.
Xusheng Xiao North Carolina State University CSC 720 Project Presentation 1.
References: “Pruning Dynamic Slices With Confidence’’, by X. Zhang, N. Gupta and R. Gupta (PLDI 2006). “Locating Faults Through Automated Predicate Switching’’,
3.3 Complexity of Algorithms
An Undergraduate Course on Software Bug Detection Tools and Techniques Eric Larson Seattle University March 3, 2006.
Data Display Debugger (DDD)
“Isolating Failure Causes through Test Case Generation “ Jeremias Rößler Gordon Fraser Andreas Zeller Alessandro Orso Presented by John-Paul Ore.
The life time of local variables (in a method). Local variables Local variable: A local variable is used to store information that is relevant for the.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
How to isolate cause of failure? 최윤라. Contents Introduction Isolating relevant input Isolating relevant states Isolating the error Experiments.
CSE 232: C++ memory management Overview of Arrays Arrays are the simplest kind of data structure –One item right after another in memory (“contiguous range”
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.
Winter 2006CISC121 - Prof. McLeod1 Stuff No stuff today!
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.
Dynamic Testing.
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.
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.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Algorithm efficiency Prudence Wong.
CS223: Software Engineering Lecture 25: Software Testing.
Testing Tutorial 7.
5.13 Recursion Recursive functions Functions that call themselves
Testing and Debugging PPT By :Dr. R. Mall.
Software Testing and Maintenance 1
Software Testing An Introduction.
Chapter 8 – Software Testing
Faults, Errors, Failures CS 4501 / 6501 Software Testing
PPT1: How failures come to be
PPT6: Scientific debugging
Applied Discrete Mathematics Week 6: Computation
Effective Debugging.
Searching, Sorting, and Asymptotic Complexity
50.530: Software Engineering
Insertion Sort and Shell Sort
Presentation transcript:

Locating Causes of Program Failures Texas State University CS 5393 Software Quality Project Yin Deng

2 Topics  Introduction  What is the problem?  Overview of major solutions  A Sample Failure  Case Study  Complexity and other issues  Conclusion  Related Material

3 Introduction  Locating Causes of Program Failures Holger Cleve and Andreas Zeller ICSE 2005, research papers on Fault Localization  Holger Cleve is one of the members in software engineering research group at Saarland University in Germany.  Andreas Zeller is a full professor and the chair of software engineering research group at Saarland University. His research in SE concerns especially the analysis of why large, complex software systems fail to work as they should.

4 What ’ s the Problem?  Definitions Failure: A program ’ s behavior doesn ’ t satisfy its requirement specification. Fault / Infection: An incorrect intermediate state that may be entered during program execution. Failure  Infection  Defect in code, but not vice versa.  Problem Why does program fail? How to find the defects that cause a software failure?

5 Overview of major solutions  Searching in Space Across a program state to find the infected variable(s), often among thousands. Focus on the difference between the program states where the failure occurs, and the states where the failure does not occur. Using Delta Debugging, those initial differences can be systematically narrowed down to a small set of variables.  Searching in Time Search over millions of program states to find the moment when the defect was executed. Focus on cause transitions (CTS)!

6 Searching in Space  Compare the program states of a passing run r and a falling run r  at a certain moment.  Of all different states, only some may be relevant for the failure.  How to find a subset of relevant variables that is as small as possible?  Delta Debugging, which behaves very much like a binary search.

7 Searching in Time  A cause transition is where a cause originates. It points to program code that causes the transition and hence the failure.  During transitions, some variables cease to be a failure cause and other variables begin.  Cause transitions are not only good locations for fixes, they actually locate the defects that cause the failure.

8 Example – Source Code 26 int main(int argc, char *argv[]) 27 { 28 int i = 0; 29 int *a = NULL; a = (int *)malloc((argc - 1) * sizeof(int)); 32 for (i = 0; i < argc - 1; i++) 33 a[i] = atoi(argv[i + 1]); shell_sort(a, argc); for (i = 0; i < argc - 1; i++) 38 printf("%d ", a[i]); 39 printf("\n"); free(a); 42 return 0; 43 } 1 /* sample.c -- Sample C program */ 2 3 #include 4 #include 5 6 static void shell_sort(int a[], int size) 7 { 8 int i, j; 9 int h = 1; 10 do { 11 h = h * 3 + 1; 12 } while (h <= size); 13 do { 14 h /= 3; 15 for (i = h; i < size; i++) 16 { 17 int v = a[i]; 18 for (j = i; j >= h && a[j - h] > v; j -= h) 19 a[j] = a[j - h]; 20 if (i != j) 21 a[j] = v; 22 } 23 } while (h != 1); 24 } 25

9 Example – Running Result  A passing run r $ sample  A falling run r  $ sample What’s wrong?

10 Example – Searching in Space State differences between r and r . One of these differences causes sample to fail.

11 Example – Searching in Space (cont.)  Procedures Runs r up to Line 9 Applies half of the differences on r Resumes execution and determines the outcome.  Result Line 9, a[2] being zero causes the sample failure. What causes a[2] be zero?

12 Example – Searching in Time

13 Example – Searching in Time (cont.)  Procedures Find an interval of matches to start with; there was a cause transition between argc in step 1 and a[0] in Step 44; Use Delta Debugging to find relevant variables between argc and a[0] (function calls are preferred), a[2] is isolated; CTS : Step 26 (a[2] again); CTS : Step 35 (v).  Result argc  a[2] in Lines 32 – 35 (Steps 8 – 11); a[2]  v in Line 17 (Step 29); v  a[0] in Line 21 (Step 36).

14 Example – Debugging Result

15 Case Study: The GCC Failure The program that crashes GCC

16 Complexity  Searching in space Best case: Delta Debugging needs 2s log k test runs to isolate s failure-inducing variables from k state differences. worst case is k 2 + 3k In practice, Delta Debugging is much more logarithmic than linear.  Searching in time A simple binary search over n program steps, repeated for each cause transition. For m cause transitions, we need m log n runs of Delta Debugging.

17 Practical Issues  Accessing state Currently using GDB, which is painfully slow; More efficient ways need to be explored.  Capturing accurate states Several heuristics are used to determine state transferring; When such heuristics fail, the state cannot be transferred.  Incomparable states When control flow reaches different points in r and r , the resulting states are not comparable, simply because the set of local variables is different. Some efforts are required to determine when the control flows of r and r  diverge and converge.

18 Conclusion  Cause transitions locate the software defect that causes a given failure, performing twice as well as any other technique previously known.  The technique requires an automated test, a mean to observe and manipulate the program state, as well as at least one alternate passing test run.  The technique could be used as an add-on to running an automated test suite; we not only know that a test has failed, but also why and where it failed.

19 Related Material  Isolating cause-effect chains from computer programs. A. Zeller. In W. G. Griswold, editor, Proc. Tenth ACM SIGSOFT Symposium on the Foundations of Software Engineering (FSE-10), pages 1 – 10, Charleston, South Carolina, Nov ACM Press.  Simplifying and isolating failure-inducing input. A. Zeller and R. Hildebrandt. IEEE Transactions on Software Engineering, 28(2):183 – 200, Feb  Visualizing memory graphs. T. Zimmermann and A. Zeller. In S. Diehl, editor, Proc. of the International Dagstuhl Seminar on Software Visualization, volume 2269 of Lecture Notes in Computer Science, pages 191 – 204, Dagstuhl, Germany, May Springer-Verlag.  Why Programs Fail: A Guide to Systematic Debugging. A. Zeller. Morgan Kaufmann Publisher, October, ISBN

20 Any Question?