Mutation Testing Presented by Sharath Kumar Garlapati Vinesh Thummala.

Slides:



Advertisements
Similar presentations
Programming Paradigms and languages
Advertisements

Object-oriented Software Change Dynamic Impact Analysis Lulu Huang and Yeong-Tae Song Dept. of Computer and Information Sciences Towson University Towson,
METHOD OVERRIDING Sub class can override the methods defined by the super class. Overridden Methods in the sub classes should have same name, same signature.
Written by: Dr. JJ Shepherd
1 Software Testing and Quality Assurance Lecture 9 - Software Testing Techniques.
Data Abstraction and Object- Oriented Programming CS351 – Programming Paradigms.
© 2006 Fraunhofer CESE1 MC/DC in a nutshell Christopher Ackermann.
C++ for Engineers and Scientists Third Edition
Lecture From Chapter 6 & /8/10 1 Method of Classes.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
Introduction to Software Testing Chapter 5.2 Program-based Grammars Paul Ammann & Jeff Offutt
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
CPIS 357 Software Quality & Testing
Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.
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.
Regression Testing. 2  So far  Unit testing  System testing  Test coverage  All of these are about the first round of testing  Testing is performed.
Features of Object Oriented Programming Lec.4. ABSTRACTION AND ENCAPSULATION Computer programs can be very complex, perhaps the most complicated artifact.
1 Chapter 4: Selection Structures. In this chapter, you will learn about: – Selection criteria – The if-else statement – Nested if statements – The switch.
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
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 testing techniques Software testing techniques Mutation testing Presentation on the seminar Kaunas University of Technology.
ILM Proprietary and Confidential -
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 Coverage CS-300 Fall 2005 Supreeth Venkataraman.
White-box Testing.
Fault Tolerance Mechanisms ITV Model-based Analysis and Design of Embedded Software Techniques and methods for Critical Software Anders P. Ravn Aalborg.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Unit Testing with JUnit and Clover Based on material from: Daniel Amyot JUnit Web site.
Comparing model-based and dynamic event-extraction based GUI testing techniques : An empirical study Gigon Bae, Gregg Rothermel, Doo-Hwan Bae The Journal.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
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
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
Classes, Interfaces and Packages
Condition Testing. Condition testing is a test case design method that exercises the logical conditions contained in a program module. A simple condition.
Written by: Dr. JJ Shepherd
Mutation Testing Breaking the application to test it.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 23, 1999.
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.
Foundations of Software Testing Chapter 7: Test Adequacy Measurement and Enhancement Using Mutation Last update: September 3, 2007 These slides are copyrighted.
Mutation Testing Laraib Zahid & Mariam Arshad. What is Mutation Testing?  Fault-based Testing: directed towards “typical” faults that could occur in.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A Metric-based Approach for Reconstructing Methods.
Software Testing and Quality Assurance Syntax-Based Testing (2) 1.
C++ for Engineers and Scientists Second Edition Chapter 4 Selection Structures.
Unit 2 Technology Systems
Modern Programming Tools And Techniques-I
Regression Testing with its types
Polymorphism 2nd Lecture
Chapter 13: Pointers, Classes, Virtual Functions, and Abstract Classes
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.
Structural testing, Path Testing
Introduction to Software Testing Chapter 9.2 Program-based Grammars
Conditional Statements
Introduction to Software Testing Chapter 5.2 Program-based Grammars
Java Programming Course
Software Testing Syntax-based Testing.
Introduction to Data Structure
Mutation Testing The Mutants are Coming! Copyright © 2017 – Curt Hill.
Method of Classes Chapter 7, page 155 Lecture /4/6.
Mutation Testing Moonzoo Kim School of Computing KAIST
Testing.
Mitigating the Effects of Flaky Tests on Mutation 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 Presented by Sharath Kumar Garlapati Vinesh Thummala.

Learning Objectives What is Mutation testing History of Mutation Traditional Process of Mutation testing Kinds of Mutations Mutation Operators An Example for Mutation Testing Pros and Cons Conclusion

What is Mutation testing? Mutation Testing is a testing technique that focuses on measuring the adequacy of test cases Mutation Testing is NOT a testing strategy like path or data- flow testing. It does not outline test data selection criteria.

History of Mutation Proposed by Richard Lipton as a student in 1971. Developed and published by DeMillo, Lipton and Sayward in late 70’s. Implemented as a testing tool by Timothy Budd in 1980 from Yale University.

Mutation Process [2]

Mutation Process The process, given program P and test suite T, is as follows: Systematically apply mutations to program P to obtain a sequence,P1, P2,... Pn of mutants of P. Each mutant is derived by applying a single mutation operation to P. Run the test suite T on each of the mutants T is said to kill mutant Pj, if it detects an error. If k out of n mutants killed, the adequacy of T is measured by the quotient k/n implies T is mutation adequate, if k = n.

Kinds of Mutations Value Mutation - Involves changing the values of constants or parameters(by adding or subtracting values etc). Decision Mutation- Involves in modifying conditions to reflect potential slips(replacing a > by a < in a comparison). Statement Mutation - Deleting or Swapping the lines of codes.

Mutation Operators Statement deletion Boolean expression changes (true and false) Arithmetic operation changes (+ and *, - and /) Boolean operator changes (> and >=, == and <=) Declared in the same scope variables changes (variable types should be the same)

Class level mutation operators Polymorphic Method Overloading Method Overriding/Hiding in Inheritance Field Variable Hiding in Inheritance Information Hiding (Access Control) Static/Dynamic States of Objects Exception Handling

Polymorphic mutations class T { … } interface K { … } class S extends T implements K { … } class U extends S { … } The original code: S s = new S(); Mutants: T s = new S(); K s = new S(); S s = new T(); S s = new U();

Method overloading mutations public LogMessage(int level, String logKey, Object[]inserts){…} public LogMessage(int level, String logKey, Object insert) {…} Mutant: public LogMessage(String logKey, int level, Object[]inserts{…}

Method Overriding/Hiding in Inheritance public class Animal { public void speak(){..} public void bite(){..} } public class Cat extends Animal { public void speak() {..} Mutant: //public void speak() {..}

Field Variable Hiding in Inheritance public class Animal { public String kind; public int legCount; } public class Cat extends Animal { Mutant: //public int legCount;

Information Hiding (Access Control) The original code: protected Address address; Mutants: public Address address; private Address address; Address address; //default (no access modifier defined)

Static/Dynamic States of Objects The original code: public static int VALUE = 100; private String s; Mutants: public int VALUE = 100; //static is removed. private static String s; //static is added.

Exception Handling The original code: String formatMsg(LogMessage msg){ … try { … } catch(MissingResourceException mre){… } … Mutant: String formatMsg(LogMessage msg) throws MissingResourceException { … //try-catch block removed

Weak Mutation Compares the internal states of the mutant and original program immediately after execution of the mutated portion of the program. Requires much less computing power to ensure that the test suite satisfies weak mutation testing.

Strong Mutation When strong mutation testing is performed, the values produced by mutated code and changes (or not) the output of the module or subroutine. Requires much more computing power.

Automation of Mutation Testing List of tools available – Ninja Turtles- .NET mutation testing tool Mutagenesis- PHP mutation testing framework Heckle- Ruby Mutation Testing Tool Jester- Mutation Testing Tool for Java

Advantages It is a powerful approach to attain high testing coverage of the source program. This testing is capable of comprehensively testing the mutant program. Mutation testing brings a good level of error detection to the software developer. Customers are benefited from this testing by getting a more reliable and stable system.

DisAdvantages Costly and Time consuming. Many test cases are required. Requires a lot of testing before a dependable data is obtained. Needs an automated tool to reduce testing time. Not an applicable method for black box testing. Very complicated to use without an automated tool.

Conclusion Not just a testing method, more of an analytical method. An effective program for improving the quality of testing software but its widespread use is prevented by the difficulties encountered in using them. It would be very helpful to the developers of complex software, if testing methods could be improved

Reference [1] Anguswamy,R., Frakes,W., A Comparison of Database Fault Detection Capabilities Using Mutation Testing, Proceedings of ESEM,12,(Sept,2012,NY,USA),323-326. [2] Praphamontripong,U., Offutt,J., Applying Mutation Testing to Web Applications, Proceeding of ICSTW ,10 ,(Apr,2010, Paris, [3] Schuler,D., Zeller,A., Efficient Mutation Testing for Java, Proceedings of ESEC/FSE, 06 (Aug. 2009., NY, USA),297-298. [4] Madeyski, L., Nguyen, Q., Problems of Mutation Testing and Higher Order Mutation Testing , Proceedings of ICCSAMA, 12,(2014, Switzerland),157-172. [5] Khurshid, S., Marinov, D., Zhang, L., Zhang,Lu., Regression Mutation Testing, Proceeding of ISSTA ,12,(July.2012, MN, USA),331-341.

Thank You