Simplifying failure Inducing input Vikas, Purdue.

Slides:



Advertisements
Similar presentations
Debugging ACL Scripts.
Advertisements

Software Development Languages and Environments. Programming languages High level languages are problem orientated contain many English words are easier.
Delta Debugging and Model Checkers for fault localization
Chapter 1 An Overview of Computers and Programming Languages.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
CompSci Applets & Video Games. CompSci Applets & Video Games The Plan  Applets  Demo on making and running a simple applet from scratch.
Simplifying and Isolating Failure-Inducing Input Presented by Nir Peer University of Maryland Andreas Zeller Saarland University, Germany Ralf Hildebrandt.
CS590Z Delta Debugging Xiangyu Zhang (slides adapted from Tevfik Bultan’s )
1 Lab Session-2 CSIT 121 Spring 2005 Debugging Tips NiMo’s Varying Rates Lab-2 Exercise.
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
272: Software Engineering Fall 2008 Instructor: Tevfik Bultan Lecture 17: Automated Debugging.
PRE-PROGRAMMING PHASE
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
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.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
Thrive Installation.
WaveMaker Visual AJAX Studio 4.0 Training Troubleshooting.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
Applets & Video Games 1 Last Edited 1/10/04CPS4: Java for Video Games Applets &
CMSC 345 Fall 2000 Unit Testing. The testing process.
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.
Algorithms and Programming
Chapter 1 Introduction to Computers and C++ Programming Goals: To introduce the fundamental hardware and software components of a computer system To introduce.
Practice and Evaluation. Practice Develop a java class called: SumCalculator.java which computes a sum of all integer from 1 to 100 and displays the result.
Computers and Scientific Thinking David Reed, Creighton University Functions and Libraries 1.
From Quality Control to Quality Assurance…and Beyond Alan Page Microsoft.
Grey Box testing Tor Stålhane. What is Grey Box testing Grey Box testing is testing done with limited knowledge of the internal of the system. Grey Box.
® IBM Software Group © 2006 IBM Corporation JSF Progress Bar This Learning Module shows how to integrate EGL/JSF functionality into a run-time progress.
Session Objectives How to Debug PTF test case/Script Session-6 DebuggingSlide 2.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 10: Automated Debugging.
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
Data Display Debugger (DDD)
Program Design. The design process How do you go about writing a program? –It’s like many other things in life Understand the problem to be solved Develop.
1 Chapter 3 – JavaScript Outline Introduction Flowcharts Control Structures if Selection Structure if/else Selection Structure while Repetition Structure.
In this activity, we are going to type a simple Chinese sentence with Microsoft Word by Tsang-jei Input Method and Simplified Tsang-jei Input Method. 1Start.
SQL SERVER 2008 Installation Guide A Step by Step Guide Prepared by Hassan Tariq.
My first robot programming - Simple “Go” Young Joon Kim MSRDS First Beginner Course – STEP4.
Chapter – 8 Software Tools.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Simplifying and Isolating Failure-Inducing Input Andreas Zeller and Ralf Hildebrandt IEEE Transactions on Software Engineering (TSE) 2002.
CSCI-235 Micro-Computers in Science Algorithms Part II.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
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.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
How does a computer works Hyoungshick Kim Department of Computer Science and Engineering College of Information and Communication Engineering Sungkyunkwan.
Topic 2: Hardware and Software
Chapter 2: System Structures
Unit# 9: Computer Program Development
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Chapter 1 Introduction(1.1)
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
4. Computational Problem Solving
Global Challenge Night Sensor Lesson 2.
Computer Architecture
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Profs. Brewer CS 169 Lecture 13
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Presentation transcript:

Simplifying failure Inducing input Vikas, Purdue

Problem when testing a program some test case fails how to find the bug ??  problems!!!  test input is huge – 800 lines say  do a binary search manually ?  how much time ?

Problem - example Mozilla web browser  1999  bugzilla listed more than 370 bug reports  faced imminent doom !!  opened a program 'Bug a Thorn' who ever finds bugs will get a prize Finding bug is a SERIOUS PROBLEM

Problem – example one of the bug Mozilla crashed after 95 user actions It was not able to print a particular html page of 895 lines  simplified to 3 user actions  html page simplified to 1 line Now – 895 lines of input simplified to just 1 line !!

How to solve? “Delta Debugging algorithm“  take a failing test case  and take a passing test case  simplify tat and produce a minimal test case  the simplified test case still produces the failure

Example - Continued

Conflicting issues Decomposing a specific bug report into simple test case  A bug report should be as specific as possible  on the other hand test case should be as simple as possible Test case simplification does both!  allows for short problem descriptions  subsumes all details in bug report

Delta Debugging – how Define what is a successful test case Feed with a failing test case Ddmin simplifies it by successive testing Stop when a minimal test case is reached Now removing any single input entity would cause the failure to disappear

Analogous example-flight simulation problem – flight crashes few seconds after take off, how do we find the bug??  repeat the situation over again and again under changed circumstances  find out what is relevant and what is not relevant  eg, leave the passenger seats – still crashes  eg, leave the coffee vending machine – still crashes !  hence both of them are irrelevant

Example continued - DDMin

DDMin Not only minimises the failing input Also maximises the the passing input Not only limited to html input, character input nor to program input can be applied to all circumstances that can make a program crash or those which will affect the program execution

input

Assumptions – reasons for failure program code data from storage or input devices the programs environment the specific hardware the operating system “All the above are called circumstances”

Changes that cause failure We are interested only in the changeble circumstances These changeable circumstances make up the program input in most of the cases

Definitions

What is the change ?? ( delta ) - decomposition? No specific way to get the changes. html example  delta can be a single character  can be a single tag  can be a single line also HOW TO DECOMPOSE THEM??

Definitions – composition of changes

Definitions - Test cases and tests According to POSIX starndart for testing  the test can succeed  the test can fail  the test produce intermediate result We need a function 'rtest' that takes a program run and gives one of the above output.

Definitions – test case and test

Test cases

Minimizing test case

Minimizing algorithm

The Algorithm

Complexity of DDMin Complexity of DDMin is Cx2 + 3Cx Worst case 2 phases  1. When every test has an unresolved input then we go till the maximum granularity of Cx # of tests to be carried out is Cx ~= 4Cx  2. When testing the last complement fails (∆n) results in Cx-1 calls Total : 2(Cx-1)+2(Cx-2) =~Cx2-Cx Add up everything :- 4Cx + Cx2 - Cx

Minimizing algorithm

Case Study1 – GCC gets a fatal signal! - run in WYNOT a program bug.c crashes when compiled with gcc but the program crashes only with some optimization options given does not crash with all optimizations enabled! code is 755 characters – each character a component ( hence, may have a lot of useless C code )

Case study 1 size of Z = 1 Z[1] will segfault

Minimizing the test case

Minimizing Gcc options gcc -o -fforce-addr bug.c

Case study – Mozilla crashing One of the bug report in Mozilla firefox Following operations cause Mozilla to crash  Start Mozilla  Go to bugzilla.mozilla.org  Print to file setting the margins to.50  Once its done printing do the exact same thing on the same file ( /var/tmp/netscape.ps )  This causes browser to crash with a segfault

Mozilla crashes Mozilla input consists of two items 1. The sequence of input events  ie the succession of mouse motions  pressed keys and clicked buttons  used XLAB to capture – 711 actions 2. HTML code of the erroneous www page

Mozilla crashes out of 711 actions – only 95 were user actions, rest were notifications by X server out of 95 user actions only 3 are left after 82 test runs.  Invoke Print dialog  Press mouse button 1 on the print button  release mouse button 1

Mozilla crashes 82 runs, 3 user actions 95 user actions

Mozilla crashes – excerpt of input

Mozilla crashes – sample run

Mozilla crashes - run 896 lines !!! 58 runs, 1 line

Mozilla crashes ! - 1 line - is the culprit or its just in other words, the bug report is now just  Create an HTML page containing “ ”  Load the page and print it using Alt+P command  the browser crashes with a segmentation fault  or – printing the crashes !!

Minimizing fuzz bart Miller and his team examined the robustness of UNIX utilities by sending fuzz input ( a huge number of random characters )  found that 40% of the basic programs crashed or went into infinite loops ddmin algorithm was tested on fuzz input sequences  for NROFF, TROFF, GLEX, CRTPLOT, UL,UNITS

Minimizing fuzz

Simplifying failure inducing input The 3 case studies discussed show that  the larger the size of the simplified input, the higher is the number of tests required  because determining 1-minimality of a test case with n entities req atleast n tests  because each individual entity is removed and tested  for flex, the number of tests vary upto 10 4 for low precision to 36,000 for high precision.

other approaches ? Simply stop the process when a certain time limit is reached Simply stop the process when the input test case is reduced by a certain extent Better approach is 'Isolation'  Find one relevant part of the test case.removing this particular part makes the failure go away.  Simplifying meant that – the simplified test case had all the relevant parts

Isolating example 7 tests!!

Simplyfying 26 tests

Isolation

Future work Domain specific methods  knowledge about the input structure can very much enhance the performance  for ex – valid program inputs are described by grammars, would be nice to rely on such grammars  can exclude syntactically invalid inputs