Mutation Testing - Software Testing - GeeksforGeeks

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Software Engineering Tutorial Software Development Life Cycle Waterfall Model Software Requiremen

Mutation Testing – Software Testing


Last Updated : 11 Dec, 2023

Mutation Testing is a type of Software Testing that is performed to


design new software tests and also evaluate the quality of already
existing software tests. Mutation testing is related to modification a
program in small ways. It focuses to help the tester develop effective
tests or locate weaknesses in the test data used for the program.

History of Mutation Testing:


Richard Lipton proposed the mutation testing in 1971 for the first time.
Although high cost reduced the use of mutation testing but now it is
widely used for languages such as Java and XML.

Mutation Testing is a White Box Testing.

Mutation testing can be applied to design models, specifications,


databases, tests, and XML. It is a structural testing technique, which
uses the structure of the code to guide the testing process. It can be
described as the process of rewriting the source code in small ways in
order to remove the redundancies in the source code.
Objective of Mutation Testing:
The objective of mutation testing is:

To identify pieces of code that are not tested properly.


To identify hidden defects that can’t be detected using other testing
methods.
To discover new kinds of errors or bugs.
To calculate the mutation score.
To study error propagation and state infection in the program.
To assess the quality of the test cases.

Types of Mutation Testing:


Mutation testing is basically of 3 types:

1. Value Mutations:
In this type of testing the values are changed to detect errors in the
program. Basically a small value is changed to a larger value or a
larger value is changed to a smaller value. In this testing basically
constants are changed.
Example:

Initial Code:
int mod = 1000000007;
int a = 12345678;
int b = 98765432;
int c = (a + b) % mod;

Changed Code:

int mod = 1007;


int a = 12345678;
int b = 98765432;
int c = (a + b) % mod;

2. Decision Mutations:
In decisions mutations are logical or arithmetic operators are changed
to detect errors in the program.
Example:

Initial Code:

if(a < b)
c = 10;
else
c = 20;

Changed Code:

if(a > b)
c = 10;
else
c = 20;

3. Statement Mutations:
In statement mutations a statement is deleted or it is replaces by some
other statement.
Example:

Initial Code:

if(a < b)
c = 10;
else
c = 20;

Changed Code:

if(a < b)
d = 10;
else
d = 20;

Tools used for Mutation Testing :

Judy
Jester
Jumble
PIT
MuClipse.

Advantages of Mutation Testing:

It brings a good level of error detection in the program.


It discovers ambiguities in the source code.
It finds and solves the issues of loopholes in the program.
It helps the testers to write or automate the better test cases.
It provides more efficient programming source code.

Disadvantages of Mutation Testing:

It is highly costly and time-consuming.


It is not able for Black Box Testing.
Some, mutations are complex and hence it is difficult to implement
or run against various test cases.
Here, the team members who are performing the tests should have
good programming knowledge.
Selection of correct automation tool is important to test the
programs.

Want to learn Software Testing and Automation to help give a


kickstart to your career? Any student or professional looking to excel in
Quality Assurance should enroll in our course, Complete Guide to
Software Testing and Automation, only on GeeksforGeeks. Get
hands-on learning experience with the latest testing methodologies,
automation tools, and industry best practices through practical projects
and real-life scenarios. Whether you are a beginner or just looking to
build on existing skills, this course will give you the competence
necessary to ensure the quality and reliability of software products.
Ready to be a Pro in Software Testing? Enroll now and Take Your
Career to a Whole New Level!

P pp_p… 9

Previous Article Next Article


Globalization Testing - Software Security Testing - Software Testing
Testing

Similar Reads
Difference between Error Seeding and Mutation Testing in Softwar…
1. Error Seeding :Error seeding can be defined as a process of adding
errors to the program code that can be used for evaluating the number …
3 min read

Principles of software testing - Software Testing


Software testing is an important aspect of software development,
ensuring that applications function correctly and meet user expectation…
10 min read

PEN Testing in Software Testing


Pen testing, a series of activities taken out in order to identify the various
potential vulnerabilities present in the system which any attack can use…
3 min read
Basis Path Testing in Software Testing
Prerequisite - Path Testing Basis Path Testing is a white-box testing
technique based on the control structure of a program or a module. Usi…
5 min read

What is Code Driven Testing in Software Testing?


Prerequisite - TDD (Test Driven Testing) Code Driven Testing is a
software development approach in which it uses testing frameworks th…
2 min read

Decision Table Based Testing in Software Testing


What is a Decision Table : Decision tables are used in various
engineering fields to represent complex logical relationships. This testi…
3 min read

Response Testing in Software Testing


Software applications are developed to provide some specific service to
the customers. When an end-user uses a software product/application…
8 min read

Random Testing in Software Testing


Random testing is software testing in which the system is tested with
the help of generating random and independent inputs and test cases.…
4 min read

Overview of Conversion Testing in Software Testing


Conversion Testing :Every software development process follows the
Software Development Life Cycle (SDLC) for developing and delivering …
6 min read

Data Integrity Testing in Software Testing


Every software development process follows the Software Development
Life Cycle (SDLC) for the development and delivery of a good quality…
5 min read
Article Tags : Software Engineering Software Testing

Corporate & Communications Address:-


A-143, 9th Floor, Sovereign Corporate
Tower, Sector- 136, Noida, Uttar Pradesh
(201305) | Registered Address:- K 061,
Tower K, Gulshan Vivante Apartment,
Sector 137, Noida, Gautam Buddh
Nagar, Uttar Pradesh, 201305

Company Languages
About Us Python
Legal Java
In Media C++
Contact Us PHP
Advertise with us GoLang
GFG Corporate Solution SQL
Placement Training Program R Language
GeeksforGeeks Community Android Tutorial
Tutorials Archive

DSA Data Science & ML


Data Structures Data Science With Python
Algorithms Data Science For Beginner
DSA for Beginners Machine Learning
Basic DSA Problems ML Maths
DSA Roadmap Data Visualisation
Top 100 DSA Interview Problems Pandas
DSA Roadmap by Sandeep Jain NumPy
All Cheat Sheets NLP
Deep Learning

Web Technologies Python Tutorial


HTML Python Programming Examples
CSS Python Projects
JavaScript Python Tkinter
TypeScript Web Scraping
ReactJS OpenCV Tutorial
NextJS Python Interview Question
Bootstrap Django
Web Design

Computer Science DevOps


Operating Systems Git
Computer Network Linux
Database Management System AWS
Software Engineering Docker
Digital Logic Design Kubernetes
Engineering Maths Azure
Software Development GCP
Software Testing DevOps Roadmap

System Design Inteview Preparation


High Level Design Competitive Programming
Low Level Design Top DS or Algo for CP
UML Diagrams Company-Wise Recruitment Process
Interview Guide Company-Wise Preparation
Design Patterns Aptitude Preparation
OOAD Puzzles
System Design Bootcamp
Interview Questions

School Subjects GeeksforGeeks Videos


Mathematics DSA
Physics Python
Chemistry Java
Biology C++
Social Science Web Development
English Grammar Data Science
Commerce CS Subjects
World GK
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy