Mutation Testing Laraib Zahid & Mariam Arshad. What is Mutation Testing?  Fault-based Testing: directed towards “typical” faults that could occur in.

Slides:



Advertisements
Similar presentations
Defect testing Objectives
Advertisements

Verification and Validation
Testing and Quality Assurance
White-Box Testing Techniques IV
MUTATION TESTING. Mutation testing is a technique that focuses on measuring the adequacy (quality) of test data (or test cases). Modify a program by introducing.
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)
Mutation Testing Presented by Sharath Kumar Garlapati Vinesh Thummala.
Unit Testing CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 27, 2007.
1 Software Testing and Quality Assurance Lecture 9 - Software Testing Techniques.
(c) 2007 Mauro Pezzè & Michal Young Ch 16, slide 1 Fault-Based Testing.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
Testing an individual module
Types and Techniques of Software Testing
Terms: Test (Case) vs. Test Suite
Software faults & reliability Presented by: Presented by: Pooja Jain Pooja Jain.
Introduction to Software Testing Chapter 5.2 Program-based Grammars Paul Ammann & Jeff Offutt
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
AMOST Experimental Comparison of Code-Based and Model-Based Test Prioritization Bogdan Korel Computer Science Department Illinois Institute of Technology.
Dr Andy Brooks1 FOR0383 Software Quality Assurance Lecture 1 Introduction Forkröfur/prerequisite: FOR0283 Programming II Website:
Software Testing CS 121 “Ordering Chaos” “Mike” Michael A. Erlinger
Software Testing and Validation SWE 434
TESTING.
Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.
CMSC 345 Fall 2000 Unit Testing. The testing process.
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.
© SERG Dependable Software Systems (Mutation) Dependable Software Systems Topics in Mutation Testing and Program Perturbation Material drawn from [Offutt.
Coverage – “Systematic” Testing Chapter 20. Dividing the input space for failure search Testing requires selecting inputs to try on the program, but how.
Design and Programming Chapter 7 Applied Software Project Management, Stellman & Greene See also:
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.
Testing Methods Carl Smith National Certificate Year 2 – Unit 4.
Testing Testing Techniques to Design Tests. Testing:Example Problem: Find a mode and its frequency given an ordered list (array) of with one or more integer.
Test Drivers and Stubs More Unit Testing Test Drivers and Stubs CEN 5076 Class 11 – 11/14.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Black-box Testing.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
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 Engineering 2004 Jyrki Nummenmaa 1 BACKGROUND There is no way to generally test programs exhaustively (that is, going through all execution.
Black Box Testing : The technique of testing without having any knowledge of the interior workings of the application is Black Box testing. The tester.
Software Testing Part II March, Fault-based Testing Methodology (white-box) 2 Mutation Testing.
Introduction to Software Testing Chapter 9.2 Program-based Grammars Paul Ammann & Jeff Offutt
Integration testing Integrate two or more module.i.e. communicate between the modules. Follow a white box testing (Testing the code)
Boris Milašinović Faculty of Electrical Engineering and Computing University of Zagreb, Croatia.
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.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
Mutation Testing Breaking the application to test it.
Foundations of Software Testing Chapter 7: Test Adequacy Measurement and Enhancement Using Mutation Last update: September 3, 2007 These slides are copyrighted.
MUTACINIS TESTAVIMAS Benediktas Knispelis, IFM-2/2 Mutation testing.
Software Testing and Quality Assurance Practical Considerations (1) 1.
Software Testing and Quality Assurance Syntax-Based Testing (2) 1.
COTS testing Torbjørn Skramstad.
Software Testing.
SOFTWARE TESTING Date: 29-Dec-2016 By: Ram Karthick.
White-Box Testing Techniques IV
Software Testing.
White-Box Testing Techniques IV
Introduction to Software Testing Chapter 9.2 Program-based Grammars
COTS testing Tor Stålhane.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Alex Groce, Josie Holmes, Darko Marinov, August Shi, Lingming Zhang
Software Testing (Lecture 11-a)
Introduction to Software Testing Chapter 5.2 Program-based Grammars
Mutation Testing Tutorial Answers
CS240: Advanced Programming Concepts
Software Testing Syntax-based Testing.
Mutation Testing The Mutants are Coming! Copyright © 2017 – Curt Hill.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
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 Laraib Zahid & Mariam Arshad

What is Mutation Testing?  Fault-based Testing: directed towards “typical” faults that could occur in a program  Technique of running tests over deliberately broken versions (mutants)  Failing is the new passing—the mutant should break the tests  It is not new- the concept was introduced by Richard Lipton in 1970

Basic Idea  Take a program and test data generated for that program  Create a number of similar programs (mutants), each differing from the original in one small way, i.e., each possessing a fault e.g., replace addition operator by multiplication operator  The original test data are then run through the mutants  If test data detect all differences in mutants, then the mutants are said to be dead, and the test set is adequate

Basic Idea (II) O A mutant remains live either – because it is equivalent to the original program (functionally identical although syntactically different – called an equivalent mutant) or, – the test set is inadequate to kill the mutant O In the latter case, the test data need to be augmented (by adding one or more new test cases) to kill the live mutant O For the automated generation of mutants, we use mutation operators, that is predefined program modification rules

Example of Mutation Operators Delta’s represent syntactic modifications. In fact, each of them will be embedded in a different program version, a mutant.

Mutation Testing Types  Value Mutations: An attempt to change the values to detect errors in the programs. We usually change one value to a much larger value or one value to a much smaller value. The most common strategy is to change the constants.  Decision Mutations: The decisions/conditions are changed to check for the design errors. Typically, one changes the arithmetic operators to locate the defects and also we can consider mutating all relational operators and logical operators (AND, OR, NOT)  Statement Mutations: Changes done to the statements by deleting or duplicating the line which might arise when a developer is copy pasting the code from somewhere else.

Mutation Coverage  Complete coverage equals to killing all non- equivalent mutants (or random sample)  The amount of coverage is also called “mutation score”  We can see each mutant as a test requirement  The number of mutants depends on the definition of mutation operators and the syntax/structure of the software  Numbers of mutants tend to be large, even for small programs (hence random sampling)

Different Types of Mutants  Stillborn mutants: Syntactically incorrect, killed by compiler, e.g., x = a ++ b  Trivial mutants: Killed by almost any test case  Equivalent mutant: Always acts in the same behavior as the original program, e.g., x = a + b and x = a – (-b)  None of the above are interesting from a mutation testing perspective  Those mutants are interesting which behave differently than the original program, and we do not have test cases to identify them (to cover those specific changes)

Example of an Equivalent Mutant

Mutation Testing Process

Applications  Mutation operators and systems are also very useful for assessing the effectiveness of test strategies- they have been used in a number of case studies  Define a set of realistic mutation operators  Generate mutants (automatically)  Generate test cases according to alternative strategies  Assess the mutation score (percentage of mutants killed)  There are also works on  Mutation operators for module interfaces (aimed at integration testing)  Mutation operators on specifications: Petri-nets, state machines (aimed at system testing)

Mutation Testing Tools  Tools O MuClipse: perhaps the best tool out there O Jester: A Mutation Testing tool in Java (Open Source) O Pester: A Mutation Testing tool in Python (Open Source) O Nester: A Mutation Testing tool in C# (Open Source)

Advantages  powerful approach to attain high coverage of the source program  comprehensively test the mutant program.  brings a good level of error detection to the software developer  uncovers ambiguities in the source code  has the capacity to detect all the faults in the program  most reliable and stable system.

Disadvantages  extremely costly and time consuming  testing cannot be done without an automation tool.  large number of mutant programs may need to be tested against the original test suite  not at all applicable for black box testing.

Conclusions O It is not just a testing method; it is more of an analytical method. O Based on the set guidelines, the tester analyzes the results and implements the appropriate corrective measures. O there is no Pass/ Fail disposition if the output fails to meet the standard output as defined in the test cases. O Instead, adjustments are made to improve whatever was lacking. O It is an effective program for improving the quality of testing software but its widespread use is prevented by the difficulties encountered in using them.

References O testing.html testing.html O i/INF4290/v10/undervisningsmateriale/INF 4290-Mutest.pdf i/INF4290/v10/undervisningsmateriale/INF 4290-Mutest.pdf O introduction-to-mutation-testing ?qid=2656d d99- 83e d&v=&b=&from_search=3 introduction-to-mutation-testing ?qid=2656d d99- 83e d&v=&b=&from_search=3