Simplifying Failure-Inducing Input



Similar documents
Welcome to PowerClaim Net Services!

For Introduction to Java Programming, 5E By Y. Daniel Liang

Example of Standard API

ReadyConnect Web Meeting Premium Edition User Guide

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Hypercosm. Studio.

Sources: On the Web: Slides will be available on:

Appendix K Introduction to Microsoft Visual C++ 6.0

GCI Conference Bridge 2

Outlook Web Access (OWA) User Guide

Before you can use the Duke Ambient environment to start working on your projects or

Programming in Access VBA

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

OUTLOOK WEB APP 2013 ESSENTIAL SKILLS

Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

Knowledge Base Articles

Using Microsoft SQL Server A Brief Help Sheet for CMPT 354

The first program: Little Crab

Web Conferencing Version 8.3 Troubleshooting Guide

Outlook Operating Instructions. Internal Desktop Access

An Online Recruitment System for Economic Experiments

Outlook Express. a ZOOMERS guide

How to Write a Simple Makefile

Web Portal User Guide. Version 6.0

2 The first program: Little Crab

Project 2: Bejeweled

Using Excel as a Management Reporting Tool with your Minotaur Data. Exercise 1 Customer Item Profitability Reporting Tool for Management

Create a Web Page with Dreamweaver

Quick Start Program Advanced Manual ContactWise 9.0

Operating Systems. Notice that, before you can run programs that you write in JavaScript, you need to jump through a few hoops first

Terminal Four. Content Management System. Moderator Access

Bug Report. Date: March 19, 2011 Reporter: Chris Jarabek

Outlook Web Access -User Guides-

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Systems must meet the following requirements when using the Matrix WebConnect service: Average Network Bandwidth Utilization

Help on the Embedded Software Block

Informatica e Sistemi in Tempo Reale

Debugging and Bug Tracking. Slides provided by Prof. Andreas Zeller, Universität des Saarlands

Microsoft Expression Web Quickstart Guide

Introduction to MS WINDOWS XP

How To Use Query Console

Using SQL Server Management Studio

Dreamweaver and Fireworks MX Integration Brian Hogan

Unity web- player issues in browsers & in client system

SyncTool for InterSystems Caché and Ensemble.

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

S m a r t M a s t e B T E C O R P O R A T I O N USER MANUAL

Web Dashboard User Guide

Event Manager. LANDesk Service Desk

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

IBM FileNet eforms Designer

Regression Testing Based on Comparing Fault Detection by multi criteria before prioritization and after prioritization

Create a Poster Using Publisher

Running a Program on an AVD

Using Outlook Web Access

Quick guide steps you need to take

Charter Business Phone. Online Control Panel Getting Started Guide. Document Version 1.0

Creating Online Surveys with Qualtrics Survey Tool

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

Introduction to Source Control ---

2010 Document Template Administration. User Guide. Document Template Administration

The System Monitor Handbook. Chris Schlaeger John Tapsell Chris Schlaeger Tobias Koenig

Debugging with TotalView

Visual Logic Instructions and Assignments

12Planet Chat end-user manual

Merak Outlook Connector User Guide

Tutorial Guide to the IS Unix Service

Eventia Log Parsing Editor 1.0 Administration Guide

CONTACT LISTS CONTACTS LIST MANAGER

Operating System Structures

NitroSell ecommerce (NSc) Product Attribute Manager (PAM)

Compatibility Matrixes. Blackboard Academic Suite

Firewall Builder Architecture Overview

Linux Driver Devices. Why, When, Which, How?

Compute Cluster Server Lab 3: Debugging the parallel MPI programs in Microsoft Visual Studio 2005

How To Insert Hyperlinks In Powerpoint Powerpoint

Microsoft Outlook Web Access Handbook

CEFNS Web Hosting a Guide for CS212

Content Author's Reference and Cookbook

CATIA Tubing and Piping TABLE OF CONTENTS

Lumension Endpoint Management and Security Suite

Proteus Telephone Management System

Waspmote IDE. User Guide

DiskPulse DISK CHANGE MONITOR

TSPrint - Usage Guide. Usage Guide. TerminalWorks TSPrint Usage Guide. support@terminalworks.com

SerialMailer Manual. For SerialMailer 7.2. Copyright Falko Axmann. All rights reserved.

Introduction to the use of the environment of Microsoft Visual Studio 2008

JBackpack Manual. Version Abstract

Attix5 Pro Server Edition

JavaScript. JavaScript: fundamentals, concepts, object model. Document Object Model. The Web Page. The window object (1/2) The document object

Connecting to LUA s webmail

User Support Resource

Using Microsoft Word. Working With Objects

Smart Sync. Computer Classroom Management Software. What is SMART Sync? Table of Contents

Transcription:

Simplifying Failure-Inducing Input Ralf Hildebrandt and Andreas Zeller ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA) Portland, Oregon, August 23, 2000

[The Mozilla BugAThon] The Mozilla BugAThon Mozilla Netscape s open source web browser project Maintained by dozens of Netscape engineers and 100s of volunteers In February 2000: 5,500 open bugs in the Bugzilla database Mozilla BugAThon call for volunteers who would simplify test cases: Pledge Level Reward 5bugs invitation to the Gecko launch party 10 bugs the invitation, plus an attractive Gecko stuffed animal 12 bugs same, but animal autographed by the Father of Gecko 15 bugs the invitation, plus a Gecko T-shirt 17 bugs same, but T-shirt signed by the grateful engineer 20 bugs same, but T-shirt signed by the whole raptor team

[Failure-Inducing Circumstances] Failure-Inducing Circumstances Input c 1 c 2 c 3 c n Program Output y (pass) (fail) (unresolved) Which of the circumstances c i are the causes for y?

[Differing Circumstances] Differing Circumstances Assumption two program runs under differing circumstances: one passes the test ( ) e.g. on some trivial or empty input the other one fails ( ) the one we re interested in Assumption: a gradual transition between these two runs. We denote the differences between these program runs by a set of changes C ={ 1,..., n } i.e. changes applied to the circumstances. A i can stand for: the insertion of a single character the deletion of a line the insertion of a substructure...

[Tests] Tests A test case is a subset of changes c C. Let test :2 C {,, }be a function which checks a test case. Three possible outcomes: The test passes ( ) The test fails ( ) The test outcome is unresolved ( ) Axioms: test( ) = test(c) = ( cause absent, effect absent ) ( cause present, effect present )

[Minimal Test Cases] Minimal Test Cases Our goal: a minimal test case c C If c is minimal, the failure does not occur in any subset: c c ( test(c ) ) Problem: One must test all 2 c 1 subsets of c. Pragmatic approach: a 1-minimal test case No single i can be omitted without causing the failure to disappear: c c ( c c 1 ( test(c ) )) If you remove any more characters from the file of the simplified test case, you no longer see the bug. (Mozilla BugAThon)

[A Minimizing Algorithm] A Minimizing Algorithm Basic pattern: Start by removing large chunks, try smaller ones later...... until the automated test fails and then repeat with smaller subset. Guarantees 1-minimality (every subset will eventually be tested) Best efficiency for small failure-inducing input

[A Minimizing Algorithm (2)] A Minimizing Algorithm (2) The minimizing delta debugging algorithm ddmin(c) is ddmin(c) = ddmin 2 (c, 2) where ddmin 2 (c i, 2) ( ddmin 2 c ci, max(n 1, 2) ) ddmin 2 (c, n) = ( ) ddmin 2 c,min( c, 2n) c if i test(c i ) = if i test(c c i ) = if n< c otherwise where c = c i with c i pairwise disjoint and c i ( c i c /n). Number of tests: c 2 + 3 c in worst case, log 2 c in best case.

[Example: GCC Dumps Core] Example: GCC Dumps Core #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]; 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); linux$ (ulimit -H -s 256; gcc -O bug.c) gcc: Internal compiler error: program cc1 got fatal signal 11

[Example: GCC Dumps Core (2)] Example: GCC Dumps Core (2) Step Test case test 1 #define SIZE 20\n double mult(double z[],int n) {...} 2 #define SIZE 20\n 3 double mult(double z[],int n) {...} 4 double mult(double z[],int n) inti,j;i=0; } 5 double mult(double z[],int n) { for(j = 0; j<n;j++) {...}... }. 839 t(double z[],int n){int i,j;for(;;){i = i + j + 1;z[i] = z[i] (z[ ] + 0);}return z[n];} 840 t(double z[],int n){int i,j;for(;;){i = i + j + 1;z[i] = z[i] (z[0 + 0);}return z[n];} 841 t(double z[],int n){int i,j;for(;;){i = i + j + 1;z[i] = z[i] (z[0] 0);}return z[n];} 842 t(double z[],int n){int i,j;for(;;){i = i + j + 1;z[i] = z[i] (z[0] + );}return z[n];} 843 t(double z[],int n){int i,j;for(;;){i = i + j + 1;z[i] = z[i] (z[0] + 0 ;}return z[n];} 844 t(double z[],int n){int i,j;for(;;){i = i + j + 1;z[i] = z[i] (z[0] + 0) }return z[n];}. Minimal input found after 857 tests:. t(double z[],int n){int i,j;for(;;){i = i+j+1;z[i] = z[i] (z[0]+0);}return z[n];}...

[Example: Minimizing Fuzz] Example: Minimizing Fuzz Classical experiment: UNIX tools fed with fuzz input (10,000 random characters). Most crash. Minimizing input reveals causes: Program Minimized Input test runs flex lexical analyzer 2121 characters 11589 ul do underlining 516 characters 3055 nroff format documents "\302\n" 60 plot graphics filter "f" 17 (Tests carried out on a Sun Solaris 2.6 machine)

[Example: Mozilla Cannot Print] Example: Mozilla Cannot Print Mozilla bug #24735, reported by anantk@yahoo.com: Ok the following operations cause mozilla to crash consistently on my machine -> Start mozilla -> Go to bugzilla.mozilla.org -> Select search for bug -> Print to file setting the bottom and right margins to.50 (I use the file /var/tmp/netscape.ps) -> Once it s done printing do the exact same thing again on the same file (/var/tmp/netscape.ps) -> This causes the browser to crash with a segfault

[Mozilla Cannot Print Minimizing User Actions] Mozilla Cannot Print Minimizing User Actions X11 Capture/Replay tool recorded 95 user actions (mouse motions, key presses, etc.) Delta Debugging simplified these user actions to 3 relevant ones (82 test runs / 21 minutes): 1. Press the P key while the Alt key is held. (Invoke the Print dialog.) 2. Press mouse button 1 on the Print button (Arm the Print button.) 3. Release mouse button 1. (Start printing.) Everything else is irrelevant including releasing the P key.

[Mozilla Cannot Print Minimizing HTML] Mozilla Cannot Print Minimizing HTML The original Search for bug page has a length of 896 lines. Delta Debugging simplified this page to a single line (57 test runs): <SELECT NAME="priority" MULTIPLE SIZE=7> Minimization by characters minimized the line even further. New, simplified bug report: -> Create a HTML page containing <SELECT> -> Load the page and print it using Alt+P and Print. -> The browser crashes with a segmentation fault.

[Future Work: Integrating Analysis] Future Work: Integrating Analysis Basic idea: reduce large number of tests by additional knowledge Structure knowledge can be a big help in decomposing input: Decompose GCC input according to C syntax Decompose TROFF input by lines Decompose HTML input according to HTML syntax... Relating the input to the output (by means of program analysis) helps in finding good candidates for causality.

[Future Work: Alternate Circumstances] Future Work: Alternate Circumstances Besides program input, one may consider alternate circumstances that affect program execution: Changes to the program code (Zeller 1999) Executed functions Performed schedules Taken branches... Delta debugging can separate all these into relevant and irrelevant circumstances hopefully with the help of program analysis.

[Future Work: Open Issues] Future Work: Open Issues When is a run considered a failure? Too few details more false positives Too many details larger number of circumstances

[Future Work: Open Issues (2)] Future Work: Open Issues (2) Delta debugging minimizes problems of the kind 1 2 n y But problems may also look like i j y or i y or... The simplest causality is in fact the shortest algorithm f that computes y = f( 1,..., n )

[Causes and Events] Causes and Events The cause of any event is a preceding event without which the event in question would not have occurred. How to demonstrate causality? John Stuart Mill (1806 1873): Method of agreement Effect present when cause present Method of difference Effect absent when cause absent Method of concomitant variation Both agreement and difference (stronger) Causality cannot be demonstrated without experimentation!

[Causality is the Key] Causality is the Key Example program: a = b; printf("a = %d\n", a); Output: a = 0 What does this say about b?

float a;

[Conclusion] Conclusion Delta debugging... automatically simplifies failure-inducing circumstances proves causality by experimentation requires large number of tests (but analysis can help!) http://www.fmi.uni-passau.de/st/dd/