Software Bug Localization with Markov Logic Sai Zhang, Congle Zhang University of Washington Presented by Todd Schiller.

Slides:



Advertisements
Similar presentations
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Advertisements

CHAPTER 1 SOFTWARE DEVELOPMENT. 2 Goals of software development Aspects of software quality Development life cycle models Basic concepts of algorithm.
Automated Documentation Inference to Explain Failed Tests Sai Zhang University of Washington Joint work with: Cheng Zhang, Michael D. Ernst.
Ongoing projects in the Program Analysis Group Marcelo d’Amorim Informatics Center, Federal University of Pernambuco (UFPE) Belo Horizonte, MG-Brazil,
Automated Fitness Guided Fault Localization Josh Wilkerson, Ph.D. candidate Natural Computation Laboratory.
1 Integrating Influence Mechanisms into Impact Analysis for Increased Precision Ben Breech Lori Pollock Mike Tegtmeyer University of Delaware Army Research.
CS590Z Statistical Debugging Xiangyu Zhang (part of the slides are from Chao Liu)
Statistical Debugging: A Tutorial Steven C.H. Hoi Acknowledgement: Some slides in this tutorial were borrowed from Chao Liu at UIUC.
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
16/27/2015 3:38 AM6/27/2015 3:38 AM6/27/2015 3:38 AMTesting and Debugging Testing The process of verifying the software performs to the specifications.
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Lecturer: Dr. AJ Bieszczad Chapter 87-1 How does software fail? Wrong requirement: not what the customer wants Missing requirement Requirement impossible.
WARNING These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010.
Automated Diagnosis of Software Configuration Errors
Test coverage Tor Stålhane. What is test coverage Let c denote the unit type that is considered – e.g. requirements or statements. We then have C c =
XFindBugs: eXtended FindBugs for AspectJ Haihao Shen, Sai Zhang, Jianjun Zhao, Jianhong Fang, Shiyuan Yao Software Theory and Practice Group (STAP) Shanghai.
Fruitful functions. Return values The built-in functions we have used, such as abs, pow, int, max, and range, have produced results. Calling each of these.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
Comp 245 Data Structures Software Engineering. What is Software Engineering? Most students obtain the problem and immediately start coding the solution.
An Automated Approach to Predict Effectiveness of Fault Localization Tools Tien-Duy B. Le, and David Lo School of Information Systems Singapore Management.
Sparse Coding for Specification Mining and Error Localization Runtime Verification September 26, 2012 Wenchao Li, Sanjit A. Seshia University of California.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
Bug Localization with Machine Learning Techniques Wujie Zheng
By Ian Jackman Davit Stepanyan.  User executed untested code.  The order in which statements were meant to be executed are different than the order.
Which Configuration Option Should I Change? Sai Zhang, Michael D. Ernst University of Washington Presented by: Kıvanç Muşlu.
Automatically Repairing Broken Workflows for Evolving GUI Applications Sai Zhang University of Washington Joint work with: Hao Lü, Michael D. Ernst.
Markov Logic and Deep Networks Pedro Domingos Dept. of Computer Science & Eng. University of Washington.
Ongoing projects in the Program Analysis Group Marcelo d’Amorim Informatics Center, Federal University of Pernambuco (UFPE) Belo Horizonte, MG-Brazil,
WARNING These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010.
1 Test Selection for Result Inspection via Mining Predicate Rules Wujie Zheng
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
REPRESENTATIONS AND OPERATORS FOR IMPROVING EVOLUTIONARY SOFTWARE REPAIR Claire Le Goues Westley Weimer Stephanie Forrest
First-Order Logic and Inductive Logic Programming.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
1 One Last Book, One Last Topic Code reviews / software inspections.
Bug Localization with Association Rule Mining Wujie Zheng
Comparing model-based and dynamic event-extraction based GUI testing techniques : An empirical study Gigon Bae, Gregg Rothermel, Doo-Hwan Bae The Journal.
Software Engineering Saeed Akhtar The University of Lahore.
Theory and Practice of Software Testing
Generating Precise and Concise Procedure Summaries Greta Yorsh Eran Yahav Satish Chandra.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
1 Theme 3: Testing Techniques. 2 Testing Techniques Lesson 48: “Testing combines techniques that focus on testers, coverage, potential problems, activities,
C++ for Engineers and Scientists, Second Edition 1 Problem Solution and Software Development Software development procedure: method for solving problems.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Automated Adaptive Bug Isolation using Dyninst Piramanayagam Arumuga Nainar, Prof. Ben Liblit University of Wisconsin-Madison.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
A User-Guided Approach to Program Analysis Ravi Mangal, Xin Zhang, Mayur Naik Georgia Tech Aditya Nori Microsoft Research.
Shadow Shadow of a Doubt: Testing for Divergences Between Software Versions Hristina PalikarevaTomasz KuchtaCristian Cadar ICSE’16, 20 th May 2016 This.
WARNING These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010.
Tung Dao* Lingming Zhang+ Na Meng* Virginia Tech*
Dataflow analysis.
A Test Case + Mock Class Generator for Coding Against Interfaces
FORMAL SYSTEM DEVELOPMENT METHODOLOGIES
Types of Testing Visit to more Learning Resources.
Ask the Mutants: Mutating Faulty Programs for Fault Localization
Software Development Process
Test Case Purification for Improving Fault Localization
Automated Fitness Guided Fault Localization
Global Challenge Love Heart Lesson 3.
Global Challenge Love Heart Lesson 3.
Code search & recommendation engines
Global Challenge Love Heart Lesson 3.
Global Challenge Love Heart Lesson 3.
Global Challenge Love Heart Lesson 3.
Whitebox Testing.
Global Challenge Love Heart Lesson 3.
Using Automated Program Repair for Evaluating the Effectiveness of
Presentation transcript:

Software Bug Localization with Markov Logic Sai Zhang, Congle Zhang University of Washington Presented by Todd Schiller

Software bug localization: finding the likely buggy code fragments A software system (source code) Some observations (test results, code coverage, bug history, code dependencies, etc.) A ranked list of likely buggy code fragments

max(arg1, arg2) { 1. a = arg1 2. b = arg2 3. if (a b) { 4. return b; 5. } else { 6. return a; 7. } } >= An example bug localization technique (Tarantula [ Jones’03 ]) Input: a program + passing tests + failing tests Output: a list of buggy statements Example: < arg1 = 1 arg2 = 2 Tests arg1 = 2 arg2 = 1 arg1 = 2 arg2 = 2 3.if (a >= b) { 4.return b; 1. a = arg1 2. b = arg2 5.} else { 6. return a;

Tarantula’s ranking heuristic Suspiciousness(s) = Percentage of failing tests covering statement s Percentage of passing tests covering statement s This heuristic is effective in practice [Jones’05] For a statement: s

Problem: existing techniques lack an interface layer Heuristics are hand crafted Techniques are often defined in an ad-hoc way A persistent problem in the research community Tarantula Jones ICSE’03 xDebug Wong, Compsac’07 CBI Liblit PLDI’05 Raul ICSE’09 Wang ICSE’09 … Static Code Info Line coverage Predicate Def-use relations Branch coverage … … Observations Techniques

Adding an interface layer Tarantula Jones ICSE’03 xDebug Wong, Compsac’07 CBI Liblit PLDI’05 Raul ICSE’09 Wang ICSE’09 … Static Code Info Line coverage Predicate Def-use relations Branch coverage … Interface layer Why an interface layer? Focus on key design insights Avoid “magic numbers “ in heuristics Fair basis for comparison Fast prototyping

Who should be the interface layer? Tarantula Jones ICSE’03 xDebug Wong, Compsac’07 CBI Liblit PLDI’05 Raul ICSE’09 Wang ICSE’09 … Static Code Info Line coverage Predicate Def-use relations Branch coverage …

Markov logic network as an interface layer Tarantula Jones ICSE’03 xDebug Wong, Compsac’07 CBI Liblit PLDI’05 Raul ICSE’09 Wang ICSE’09 … Static Code Info Line coverage Predicate Def-use relations Branch coverage … Markov Logic Network

Why Markov Logic Network [Richardson’05]? Use first order logic to express key insights – E.g., estimate the likelihood of cancer(x) for people x Example rules: smoke(x) => cancer(x) smoke(x) ∧ friend(x,y) => smoke(y) friends(x, y) ∧ friends(y, z) => friends(x, z) smoke causes cancer you will smoke if your friend smokes friends of friends are friends

Why Markov Logic Network [Richardson’05]? Use first order logic to express key insights – E.g., estimate the likelihood of cancer(x) for people x Example rules: smoke(x) => cancer(x) smoke(x) ∧ friend(x,y) => smoke(y) friends(x, y) ∧ friends(y, z) => friends(x, z) Efficient weight learning and inference – Learning rule weights from training data – Estimate cancer(x) for a new data point w1 w2 w3 (details omitted here)

Markov logic for bug localization Researchers First-order logic rules (capture insights) Alchemy (learning) A markov logic network engine Training data Alchemy (inference) Rule weights A statement: s Likelihood of s being buggy

Markov logic for bug localization Researchers First-order logic rules Alchemy (learning) A markov logic network engine Training data Alchemy (inference) Rule weights A statement: s Likelihood of s being buggy Different rules for different bug localization algorithms

Our prototype: MLNDebugger First-order rules 1.cover(test, s) ∧ fail(test) => buggy(s) 2.cover(test, s) ∧ pass(test) => ¬ buggy(s) 3.control_dep(s1, s2) ∧ buggy(s1) => ¬ buggy(s2) 4.data_dep(s1, s2) ∧ buggy(s1) => ¬ buggy(s2) 5. wasBuggy(s) => buggy(s) Learning and inference Rules + Weights A statement: stmt How likely stmt is buggy A statement covered by a failing test is buggy If a statement has control dependence on a buggy statement, then it is not buggy If a statement has data flow dependence on a buggy statement, then it is not buggy v = foo() bar(v) Buggy! Correct! A statement that was buggy before is buggy A statement covered by a passing test is not buggy Buggy! Correct! if(foo(x)) { bar(); } Buggy! Correct!

Evaluating MLNDebugger on 4 Siemens benchmarks 80+ seeded bugs – 2/3 as training set – 1/3 as testing set Measurement on the testing set – Return top k suspicious statements, check the percentage of buggy ones they can cover. Baseline: Tarantula [Jones’ ICSE 2003]

Experimental results Tarantula MLNDebugger

More in the paper… Formal definition Inference algorithms Implementation details Implications to the bug localization research

Contributions The first unified framework for automated debugging – Markov logic network as an interface layer: expressive, concise, and elegant A proof-of-concept new debugging technique using the framework An empirical study on 4 programs – 80+ versions, tests – Outperform a well-known technique