Mutation Testing Tim Dakeyne. What is Mutation? Where data is changed a small amount, which may or may not change its function Evolution of life Languages.

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

Jeremy S. Bradbury, James R. Cordy, Juergen Dingel, Michel Wermelinger
1 Software Unit Test Coverage And Test Adequacy Hong Zhu, Patrick A. V. Hall, John H.R. May Presented By: Arpita Gandhi.
David Pryor. Mutation-Based Testing Same basic goal as Code Coverage Evaluate the tests Determine how much code exercised Mutation testing goes beyond.
1 An Exploration of Errors in Web- based Applications in the Context of Web-based Application Testing PhD Proposal Kinga Dobolyi May 2009.
Verification and Validation
An Analysis and Survey of the Development of Mutation Testing by Yue Jia and Mark Harmon A Quick Summary For SWE6673.
Paraμ A Partial and Higher-Order Mutation Tool with Concurrency Operators Pratyusha Madiraju AdVanced Empirical Software Testing and Analysis (AVESTA)
Of 23 Generating Automated Tests from Behavioral Models Jeff Offutt (Research with Dr. Nan Li, currently with MediData Solutions) Software Engineering.
Mutation Testing Presented by Sharath Kumar Garlapati Vinesh Thummala.
1 Software Testing and Quality Assurance Lecture 9 - Software Testing Techniques.
Software Testing and Quality Assurance
Reliability and Software metrics Done by: Tayeb El Alaoui Software Engineering II Course.
Paper Title Your Name CMSC 838 Presentation. CMSC 838T – Presentation Motivation u Problem paper is trying to solve  Characteristics of problem  … u.
A CONTROL INSTRUMENTS COMPANY The Effectiveness of T-way Test Data Generation or Data Driven Testing Michael Ellims.
(c) 2007 Mauro Pezzè & Michal Young Ch 16, slide 1 Fault-Based Testing.
Parameterizing Random Test Data According to Equivalence Classes Chris Murphy, Gail Kaiser, Marta Arias Columbia University.
An Evaluation of Mutation and Data-flow Testing A Meta Analysis Sahitya Kakarla AdVanced Empirical Software Testing and Analysis (AVESTA) Department of.
New experiences with teaching Java as a second programming language Ioan Jurca “Politehnica” University of Timisoara/Romania
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Introduction to Software Testing Chapter 5.2 Program-based Grammars Paul Ammann & Jeff Offutt
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
Kyle Mundt February 3,  Richard Lipton, 1971  A way of testing your tests  Alter your code in various ways  Check to see if tests fail on altered.
Instructor: Peter Clarke
© SERG Dependable Software Systems (Mutation) Dependable Software Systems Topics in Mutation Testing and Program Perturbation Material drawn from [Offutt.
Software Logic Mutation Testing Presented by Gary Kaminski.
What is Mutation Testing ? The premise in mutation testing is that small changes are made in a module and then the original and mutant modules are compared.
Software Reliability in Nuclear Systems Arsen Papisyan Anthony Gwyn.
Acknowledgments We thank our families, the whole Enterprise Systems Group and specially Prof. Richard Page for their help and support. We also thank the.
Software Testing Definition Software Testing Module ( ) Dr. Samer Odeh Hanna.
Introduction to Evolutionary Computation Prabhas Chongstitvatana Chulalongkorn University WUNCA, Mahidol, 25 January 2011.
Yun-Chung Yang TRB: Tag Replication Buffer for Enhancing the Reliability of the Cache Tag Array Shuai Wang; Jie Hu; Ziavras S.G; Dept. of Electr. & Comput.
Mutation Testing G. Rothermel. Fault-Based Testing White-box and black-box testing techniques use coverage of code or requirements as a “proxy” for designing.
Software Metric; defect removal efficiency, Cyclomate Complexity Defect Seeding Mutation Testing.
Testing Inheritance & Polymorphism in OO Software using Formal Specification Presented by : Mahreen Aziz Ahmad (Center for Software Dependability, MAJU)
Verification of Synchronization in SpecC Description with the Use of Difference Decision Diagrams Thanyapat Sakunkonchak Masahiro Fujita Department of.
Introduction to Software Testing Chapter 9.2 Program-based Grammars Paul Ammann & Jeff Offutt
Software Testing. System/Software Testing Error detection and removal determine level of reliability well-planned procedure - Test Cases done by independent.
Bhanu Pratap Gupta Devang Vira S. Sudarshan Dept. of Computer Science and Engineering, IIT Bombay.
Software Quality Assurance and Testing Fazal Rehman Shamil.
Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing III No reading Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
Foundations of Software Testing Slides based on: Draft V4.0. November 19, 2006 Test Adequacy Measurement and Enhancement Using Mutation Last update: January15,
Mutation Testing Breaking the application to test it.
MUTACINIS TESTAVIMAS Benediktas Knispelis, IFM-2/2 Mutation testing.
Mutation Testing Laraib Zahid & Mariam Arshad. What is Mutation Testing?  Fault-based Testing: directed towards “typical” faults that could occur in.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVIII. Software Testing.
A Review of Software Testing - P. David Coward
Introduction Edited by Enas Naffar using the following textbooks: - A concise introduction to Software Engineering - Software Engineering for students-
White-Box Testing Techniques IV
Generating Automated Tests from Behavior Models
White-Box Testing Techniques IV
Introduction to Software Testing Chapter 9.2 Program-based Grammars
Mutation Testing Moonzoo Kim School of Computing KAIST
Mutation testing Julius Purvinis IFM-0/2.
Introduction to Software Testing Chapter 5.1 Syntax-based Testing
Introduction Edited by Enas Naffar using the following textbooks: - A concise introduction to Software Engineering - Software Engineering for students-
Introduction to Software Testing Chapter 9.2 Program-based Grammars
Fabiano Ferrari Software Engineering Federal University of São Carlos
Introduction to Software Testing Chapter 5.2 Program-based Grammars
Test Case Purification for Improving Fault Localization
Aditya P. Mathur Purdue University Fall 2007
Welcome to Corporate Training -1
Problem Solving.
Software Testing Syntax-based Testing.
Introduction to Software Testing Chapter 5.1 Syntax-based Testing
Regression Testing.
Mutation Testing Moonzoo Kim School of Computing KAIST
Review of Previous Lesson
An Analysis of OO Mutation Operators Jingyu Hu, Nan Li, and Jeff Offutt Presented by Nan Li 03/24/2011.
Mutation Testing Faults are introduced into the program by creating many versions of the program called mutants. Each mutant contains a single fault. Test.
Presentation transcript:

Mutation Testing Tim Dakeyne

What is Mutation? Where data is changed a small amount, which may or may not change its function Evolution of life Languages Program Testing

Introduction Quis custodiet ipsos custodes? Who Watches The Watchmen? In this case: What Tests The Tests? Mutation Testing is a method of inserting faults into programs to test whether the tests pick them up, thereby validating or invalidating the tests

History of Mutation Can trace birth of Mutation Testing back to a student paper written in 1971 More interest in the late 70s (DeMillo et al.) Died down due to problems of cost Being researched again recently due to availability of much higher computing power Is most recently being used on non- imperative languages such as Java and XML

Goals To assess the quality of the tests by performing them on mutated code To use these assessments to help construct more adequate tests To thereby produce a suite of valid tests which can be used on real programs

Testing Method Mutant processes are created to try to mimic typical syntactic errors made by programmers Many differing mutants are run against the specified tests to assess the quality of the tests The tests are attributed a score between 0 and 1, as to whether they can distinguish between the original and the mutants

Traditional Syntactical Mutation Operators Deletion of a statement Boolean: Replacement of a statement with another eg. == and >=, < and <= Replacement of boolean expressions with true or false eg. a || b with true Replacement of arithmetic eg. * and +, / and - Replacement of a variable (ensuring same scope/type)

Object-Oriented Mutation Operators Identifying Mutation Operators is difficult, as the traditional mutation techniques cannot easily be extended to object oriented languages; they can result in uncompilable code R. T. Alexander et al., (2002) use calls to an ‘Object Mutation Engine’ to mutate the classes under test Their standard library includes the following: CollectionMutator - Delete, Add, Change order ListMutator - Delete last, Change order VectorMutator - Delete last MapMutator - Delete first, Delete last, Empty IteratorMutator - Skips to next object

Hypotheses Mutation testing can only target a sub-set of all the possible faults a programmer could possibly make, the hope that this is sufficient is based on the following two hypotheses: The Competent Programmer Hypothesis The Coupling Effect Both of these were proposed by DeMillo et al.,1978

The Competent Programmer Hypothesis Programmers create programs that are close to being correct They have a rough idea of the kind of errors likely to occur They have the ability and opportunity to examine their programs in detail Since a program goes through many iterations, most intentions are realised during the design process

The Coupling Effect Since only small errors (mutations) are tested, how can this constitute a thorough test that implies reliability and validity of an entire program? Test data from programs that differ from a correct program by only a small amount is so finely-grained that complex errors are implicitly distinguished

If process is not error-free, fix it Test Mutants The Mutation Process Process Mutation Tests Test Process Create Mutants Yes Test Complete No Any Live Mutants? Problem with Tests? Any Mutations that are caught by tests are killed New Test Data

Mutant Equivalence There may be surviving mutants that cannot be killed, these are called Equivalent Mutants Although syntactically different, these mutants are indistinguishable through testing. They therefore have to be checked ‘by hand’ while i++ if (i==5) break; while i++ if (i>=5) break;

Mutant Equivalence Checking through all the Equivalent Mutants can make Mutation Testing cost-prohibitive “Even for these small programs the human effort needed to check a large number of mutants for equivalence was almost prohibitive” - Frankl et al., 1997 R.M. Hierons et al., 1999 proposed Program Slicing could be used in imperative languages to help towards the problem of Equivalent Mutants Offutt and Pan, 1996 introduced an approach based on constraint solving that increased the equivalence detection rate up to 48%

Problems There are a few factors that stop Mutation Testing from being more than an academic research topic, and being a practical method of testing: The undecidability of Equivalent Mutants, and the cost of checking ‘by hand’ The relatively high computational cost of running all the mutations against a test set The need for a Human Oracle to verify the contents of output is made more expensive by increases in test cases; this is especially the case using Mutation Testing However, methods for limiting the costs involved are continuing to be developed, increasing the chances of industry adoption

References 1. R. A. DeMillo, R. J. Lipton and F. G. Sayward (1978), “Hints on test data selection: Help for the practical programmer,” IEEE Computer no. 11, pp P. G. Frankl, S. N. Weiss and C. Hu (1997), “All-uses vs mutation testing: An experimental comparison of effectiveness,” Journal of Systems Software no. 38, pp R. M. Hierons, M. Harman and S. Danicic (1999), “Using Program Slicing to Assist in the Detection of Equivalent Mutants,” Software Testing, Verification and Reliability, vol. 9, no. 4, pp A. J. Offutt and J. Pan (1996), “Detecting equivalent mutants and the feasible path problem,” Annual Conference on Computer Assurance (COMPASS 96), IEEE Computer Society Press, pp R. T. Alexander, J. M. Bieman, S. Ghosh and J. Bixia (2002), “Mutation of Java objects,” 13th International Symposium on Software Reliability Engineering, Fort Collins, CO, USA, 2002, pp J. S. Bradbury, J. R. Cordy, and J. Dingel (2006), “Mutation operators for concurrent Java (J2SE 5.0),” Proc. of the 2nd Workshop on Mutation Analysis (Mutation 2006), pp. 83– K. M. Sacha (2006), “Software engineering techniques: design for quality,” Springer, pp M. Harman and Y. Jia (2009), “Mutation Testing Repository,” accessed on 26/11/2009.