Comparative Assessment of Testing and Model Checking Using Program Mutation

Similar documents
ExMAn: A Generic and Customizable Framework for Experimental Mutation Analysis 1

ExMAn: A Generic and Customizable Framework for Experimental Mutation Analysis

Defining a Catalog of Programming Anti-Patterns for Concurrent Java

Automatically Repairing Concurrency Bugs with ARC MUSEPAT 2013 Saint Petersburg, Russia

MuTMuT: Efficient Exploration for Mutation Testing of Multithreaded Code

i219 Software Design Methodology 11. Software model checking Kazuhiro Ogata (JAIST) Outline of lecture

International Journal of Advanced Research in Computer Science and Software Engineering

How Good is Static Analysis at Finding Concurrency Bugs?

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

Class-Component Testability Analysis

Object Oriented Mutation Applied in Java Application programming Interface and C++ Classes

CS 450 Exam 2 Mon. 4/11/2016

CS 450 Exam 2 Mon. 11/7/2016

Administrivia. Talks and other opportunities: Expect HW on functions in ASM (printing binary trees) soon

Model Checking of Statecharts using Automatic White Box Test Generation

MTAT : Software Testing

Introducing Shared-Memory Concurrency

Potential violations of Serializability: Example 1

Sharing Objects Ch. 3

Concurrency Terminology

Introduction to Embedded Systems

Concurrency: State Models & Design Patterns

Semantic Atomicity for Multithreaded Programs!

Predicting Mutation Score Using Source Code and Test Suite Metrics

The Impact of Equivalent, Redundant and Quasi Mutants on Database Schema Mutation Analysis. Chris J. Wright Gregory M. Kapfhammer Phil McMinn

MuClipse Requirements Specification

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Lesson 1. Concurrency. Terminology Concurrency in Systems Problem Examples Copyright Teemu Kerola 2009

Lock vs. Lock-free Memory Project proposal

Dept. of CSE, York Univ. 1

CAS 703 Software Design

Three General Principles of QA. COMP 4004 Fall Notes Adapted from Dr. A. Williams

Midterm Exam. October 20th, Thursday NSC

CS4021/4521 INTRODUCTION

Model Checking of Models of Real-Time Systems

AutoTune Workshop. Michael Gerndt Technische Universität München

CSE Traditional Operating Systems deal with typical system software designed to be:

Thread-Local. Lecture 27: Concurrency 3. Dealing with the Rest. Immutable. Whenever possible, don t share resources

C++ Memory Model. Don t believe everything you read (from shared memory)

Professional Multicore Programming. Design and Implementation for C++ Developers

Overview. CMSC 330: Organization of Programming Languages. Concurrency. Multiprocessors. Processes vs. Threads. Computation Abstractions

Adapting Mixed Workloads to Meet SLOs in Autonomic DBMSs

Runtime assertion checking of multithreaded Java programs

Verification Tests for MCAPI

Database Applications (15-415)

1 The comparison of QC, SC and LIN

Runtime Atomicity Analysis of Multi-threaded Programs

Model Transformation Testing: The State of the Art

Static program checking and verification

CS 31: Intro to Systems Threading & Parallel Applications. Kevin Webb Swarthmore College November 27, 2018

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Main Points of the Computer Organization and System Software Module

Appendix to The Health of Software Engineering Research

CPSC 261 Midterm 2 Thursday March 17 th, 2016

Java Concurrency in practice

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

EECS 570 Final Exam - SOLUTIONS Winter 2015

To Everyone... iii To Educators... v To Students... vi Acknowledgments... vii Final Words... ix References... x. 1 ADialogueontheBook 1

CSE 374 Programming Concepts & Tools

Test Oracles and Mutation Testing. CSCE Lecture 23-11/18/2015

CMSC 330: Organization of Programming Languages

CSE 421/521 - Operating Systems Fall Lecture - XXV. Final Review. University at Buffalo

Chapter 2 Processes and Threads

Concept of a process

CS140 Operating Systems and Systems Programming Midterm Exam

A Many-Core Machine Model for Designing Algorithms with Minimum Parallelism Overheads

Fundamentals of Computer Design

Course 834 EC-Council Certified Secure Programmer Java (ECSP)

ECE 587 Hardware/Software Co-Design Lecture 07 Concurrency in Practice Shared Memory I

CIS 895 GMoDS Visualizer and Test Driver Project Plan 2.0. Project Plan. For GMoDS Visualizer and Test Driver. Version 2.0

System Software. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 13

Dealing with Issues for Interprocess Communication

Consistency: Strict & Sequential. SWE 622, Spring 2017 Distributed Software Engineering

Hybrid Static-Dynamic Analysis for Statically Bounded Region Serializability

Curriculum 2013 Knowledge Units Pertaining to PDC

Ver teil tes Rechnen und Parallelprogrammierung: Introduction to Multi-Threading in Java

Specification Centered Testing

A Survey on Different Approaches for Efficient Mutation Testing

The Java Memory Model

Parallel Implementation of the NIST Statistical Test Suite

Quality Assurance of a Mobile Network Measurement Testbed Through Systematic Software Testing

Slides by Y. Nir-Buchbinder, adapted by O. Agmon Ben-Yehuda 1/30

code pattern analysis of object-oriented programming languages

Sistemas Operacionais I. Valeria Menezes Bastos

POSIX / System Programming

Concurrency in Object Oriented Programs 1. Object-Oriented Software Development COMP4001 CSE UNSW Sydney Lecturer: John Potter

Automated Documentation Inference to Explain Failed Tests

Process Description and Control

Efficient Mutant Generation for Mutation Testing of Pointcuts in Aspect-Oriented Programs

Repair & Refactoring

Unit Testing in Java with an Emphasis on Concurrency Corky Cartwright Rice and Halmstad Universities Summer 2013

Ade Miller Senior Development Manager Microsoft patterns & practices

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Computer Systems Engineering: Spring Quiz I Solutions

CSI3131 Final Exam Review

Two hours. Question ONE is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Friday 25th January 2013 Time: 14:00-16:00

Transactional Memory. Concurrency unlocked Programming. Bingsheng Wang TM Operating Systems

Process Synchronization. Mehdi Kargahi School of ECE University of Tehran Spring 2008

Lecture 8: Threads. Lisa (Ling) Liu

Introduction to Concurrency. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 4 01/21/2010

Seagull: A distributed, fault tolerant, concurrent task runner. Sagar Patwardhan

Transcription:

Comparative Assessment of Testing and Using Mutation Research Talk Jeremy S. Bradbury, James R. Cordy, Juergen Dingel School of Computing! Queen s University Kingston! Ontario! Canada {bradbury, cordy, dingel@cs.queensu.ca humans are quickly overwhelmed by concurrency and find it much more difficult to reason about concurrent than sequential code. Even careful people miss possible interleavings - Herb Sutter & James Larus, Microsoft [SL05] CSER 2007 Spring Meeting! April 29-30, 2007 SUPPORTED BY [SL05] H. Sutter and J. Larus. Software and the concurrency revolution. Queue, 3(7):54 62, 2005.!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"7 In the future applications will need to be concurrent to fully exploit CPU throughput gains [Sut05] How can we ensure concurrent programs are bug free? [Sut05] H. Sutter. The free lunch is over: A fundamental turn toward concurrency in software. Dr. Dobb's Journal, 30(3), Mar. 2005.!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!":!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"B

Concurrency IBM s O0>.5(JI5).+3"E5F> P$".5'+3"E5F>"Q2>I"I5+'2F>2J(66,"""" 4535'(>5)"23>5'65(N234 7$".5J0')"23>5'65(N234 :$"R<)(>5"/0N5'(45 /0''5J> /I5JK".5F+6>F L'0*65M (JPF) checking exhaustively searches the entire state space of a program (i.e., all interleavings) Allows for the analysis of assertions and deadlock detection /I5JK" /0N5'(45" E('45> G2H"&+4.5'+3">5F>" +F234"'5<6(,.5(JI5) G232FI [EFN+02] O. Edelstein, E. Farchi, Y. Nir, G.Ratsaby, and S. Ur. Multithreaded java program test generation. IBM Systems Journal, 41(1):111 125, 2002.!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"D [HP00] K. Havelund and T. Pressburger. checking Java programs using Java. International Journal on Software Tools for Technology Transfer (STTT), 2(4), Apr. 2000.!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"C Research Goals Our Approach 1. 2. To compare the effectiveness and efficiency of different fault detection techniques using mutation To better understand any complementary relationship that might exist between different techniques Conduct controlled experiments to evaluate the ability of various tools to detect bugs in faulty programs For example: We use mutation to generate the faulty programs required for our experiments!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"9!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"s

Our Approach Research Methods Mutation [Ham77,DLS78] traditionally used within the sequential testing community evaluate the effectiveness of test suites Mutation relies on mutation operators (patterns) to generate faulty versions of the original program called mutants score of t = % of mutants detected (killed) by a technique t (e.g., testing, model checking) Quality Method 1 Operators M1 M1 Mn Quality Method 2 [Ham77] R.G. Hamlet. Testing programs with the aid of a compiler. IEEE Trans. on Soft. Eng., 3(4), Jul. 1977. [DLS78] R. A. DeMillo, R. J. Lipton, and F. G. Sayward. Hints for test data selection: help for the practicing programmer. IEEE Computer, 11(4):34 41, Apr. 1978.!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"@!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"P8 Experimental Setup Experimental Setup Quality Operators M1 M1 Mn Quality Approach Quality Operators M1 M1 Mn Quality Approach Testing with!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"pp!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"p7

Experimental Setup The Quality Quality Approach Mutation ConMAn = Concurrency Mutation Analysis What are the ConMAn operators? a comprehensive set of 24 operators for Java that are representative of the kinds of bugs that often occur in concurrent programs. based on an existing fault model for Java concurrency [FNU03] Can be used as a comparative metric [FNU03] E. Farchi, Y. Nir, and S. Ur. Concurrent bug patterns and how to test them. In Proc. of IPDPS 2003.!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"P:!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"PB ConMAn Mutation SKCR Shrink Critical Region ConMAn Mutation SKCR Shrink Critical Region public void m1 () { <statement n1> //critical region <statement c3> <statement n2> public void m1 () { <statement n1> //critical region <statement c3> <statement n2> public void m1 () { <statement n1> //critical region <statement c3> <statement n2>!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"pd!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"pc

ConMAn Mutation SKCR Shrink Critical Region ConMAn Mutation ESP Exchange Synchronized Block Parameters public void m1 () { <statement n1> //critical region <statement c3> <statement n2> public void m1 () { <statement n1> //critical region <statement c3> <statement n2> Object lock2 = new Object(); synchronized (lock2) { No Lock Bug!!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"P9!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"PS ConMAn Mutation ESP Exchange Synchronized Block Parameters ConMAn Mutation ESP Exchange Synchronized Block Parameters Object lock2 = new Object(); synchronized (lock2) { Object lock2 = new Object(); synchronized (lock2) { Object lock2 = new Object(); synchronized (lock2) { Object lock2 = new Object(); synchronized (lock2) { Deadlock bug!!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"p@!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"78

Experimental Setup Experimental Procedure Tests, Tests, Approach Tests, Tests, Mutation Artifact!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"7P!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"77 Experimental Procedure Experimental Procedure Tests, Tests, Generation Tests, Tests, Generation Testing Testing with!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"7:!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"7b

Experimental Procedure Experimental Procedure Tests, Tests, Generation Testing Tests, Tests, Generation Testing Collection and Display of Result!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"7D!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"7C The ExMAn Framework ExMAn Architecture ExMAn = Experimental Mutation Analysis Generator Compiler (Optional) Artifact Generator 1 (Optional) Artifact Generator n (Optional) QA Tool 1 QA Tool n What is ExMAn? ExMAn is a reusable implementation for building different customized mutation analysis tools for comparing different quality assurance techniques. ExMAn automates the experimental procedure ExMAn will be publicly released in the next few months Source Viewer Script Generator & Executor Viewer Compiler Viewer (Optional) Plugin Interface Quality Artifact Selectors Tool 1 Tool n Script Generator & Executor QA Tool Viewers Tool 1 Tool n ExMAn Results Generator & Viewer LEGEND BUILT-IN COMPONENT EXTERNAL TOOL COMPONENT!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"79!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"7S

Video Demo vs. Java Available at: http://www.cs.queensu.ca/~bradbury/videos/cascon2006.mp4 How do we better understand the effectiveness of each technique? We measure the mutant score for each technique (dependent variable) We vary the analysis technique (factor) We fix all other independent variables quality artifacts (tests and properties), example programs!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"7@!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!":8 s Quantity of s Killed Ticket Order Simulation Simulates multiple agents selling tickets for a flight Linked List Involves storing data in a concurrent linked list (data structure) Buffered Writer Two different types of writer threads are updated a buffer that is being read by a reader thread Account Management System Manages a series of transactions between a number of accounts (JPF) 0 10 20 30 40 # of s Assertion Violation Output Different Deadlock Detected No Error Detected Tool Failure!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!":P!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!":7

Detection of s Scores of JPF, and +JPF 6% 6% Score JPF Score +JPF Score BufWriter 38.9% LinkedList 38% TicketsOrderSim Account 100% 78% 100% 56% 100% 78% TOTAL 56% 56% 62% JPF & Neither JPF!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"::!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!":B Ease to Kill vs. Java % of s Detected 100.00% 80.00% 60.00% 40.00% 20.00% 0.00% How do we better understand the efficiency of each technique? If and Java are both capable of finding a fault in a program is either of them faster? ASK MSP RJS RSB RSK RTXC SHCR SKCR SPCR Mutation Operators Java (JPF)!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!":D!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!":C

vs. Java vs. Java Experimental Setup null hypothesis (H 0 ): Time to detect a fault for JPF > Time to detect a fault for dependent variable(s): analysis time independent variables: factor: analysis technique fixed: quality artifacts (tests and properties) software under evaluation Time for (seconds) Mean = 2.0314 Median = 1.2030 Time for Java (seconds) Mean = 3.2835 Median = 2.3320 Conducted a paired t-test for n=19 P-value = 0.0085 (reject H O at the 0.05 level) JPF is not more efficient than for our example programs!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!":9 23!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!":S Threats to Validity Contributions internal validity external validity: Threats to external validity include: the software being experimented on is not representative of software in general the mutant faults do not adequately represent real faults for the programs under experiment construct validity conclusion validity A set of generalized mutation-based methods for conducting controlled experiments of different quality assurance approaches with respect to fault detection. The implementation of the ExMAn framework to automate and support our methodology. The contribution of ExMAn includes its abilities to act as an enabler for further research!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!":@ 24!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"B8

Contributions Future Work The development of the ConMAn operators for applying our methodology with concurrent Java applications. The application of the ConMAn operators provides the community with a large set of new programs to use in evaluating concurrent Java applications. Further Empirical Studies " depth (need more experiments comparing testing and model checking) breadth (other experiments) Empirical results on the effectiveness of testing and model checking as fault detection techniques for concurrent Java applications.!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"bp!"#$%$"&'()*+',-"#$.$"/0'),-"#$"123456!"7889"!"b7 Comparative Assessment of Testing and Using Mutation Research Talk Jeremy S. Bradbury, James R. Cordy, Juergen Dingel School of Computing! Queen s University Kingston! Ontario! Canada {bradbury, cordy, dingel@cs.queensu.ca CSER 2007 Spring Meeting! April 29-30, 2007 SUPPORTED BY