EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login
Home Software Development Software Development Tutorials Software Testing Tutorial Mutation Testing
Secondary Sidebar
Software Testing Tutorial
  • Types of Testing
    • Adhoc Testing
    • Types of System Testing
    • Manual Testing Types
    • Unit Testing Types
    • Unit Testing Benefits
    • Agile Testing
    • What is Agile Testing
    • Acceptance Testing
    • Stress Testing Types
    • Alpha and Beta Testing
    • Application Testing
    • Automation Testing
    • Automation Testing Advantages
    • Benchmark Testing
    • Black Box Testing
    • Domain Testing
    • Dynamic Testing
    • Ecommerce Testing
    • Fuzz Testing
    • Gray Box Testing
    • GUI Testing
    • Installation Testing
    • Interface Testing
    • Interoperability Testing
    • Mainframe Testing
    • Manual Testing
    • Mutation Testing
    • Monkey Testing
    • Negative Testing
    • Penetration Testing
    • Penetration testing phases
    • Penetration testing framework
    • Protocol Testing
    • Recovery Testing
    • Regression Testing
    • Mobile Penetration Testing
    • Accessibility Testing
    • Sanity Testing
    • Scalability Testing
    • Security Testing
    • Spike Testing
    • Stability Testing
    • State Transition Testing
    • Static Testing
    • Gatling Load Testing
    • System Integration Testing
    • Structural Testing
    • Locust Load Testing
    • System Testing
    • Control Flow Testing
    • Unit Testing
    • Cypress testing
    • Volume Testing
    • Web Testing Application
    • What is Exploratory Testing
    • What is Stress Testing
    • What is Usability Testing
    • White Box Testing
    • Types of White Box Testing
    • Compatibility Testing?
    • Use Case Testing
    • Beta Testing
    • Integration Testing
    • Non Functional Testing
    • Non Functional Testing Types
    • What is Functional Testing
    • Functional testing types
    • Cookie Testing
    • Alpha Testing
    • Boundary Value Testing
    • Equivalence Class Testing
    • Glass Box Testing
    • SOA Testing
    • Smoke Testing
    • Visual Testing
    • Visual Paradigm
    • Model-Based Testing
  • Basics
    • What is Software Testing
    • Careers in Software Testing
    • Defect Life Cycle in Software Testing
    • Bug Life Cycle
    • Levels of Software Testing
    • Software Testing Life Cycle
    • Software Tester Work
    • Software Testing Principles
    • Software Testing Services
    • Testing Methodologies
    • Test Approaches
    • Grey Box Testing
    • Types of Software Testing
    • What is a Bug in Software Testing
    • Benefits of Automation Testing
    • What is Automation Testing?
    • Types of Automation
    • Typical Journey of a Software Tester
    • Automation Testing Process
    • Mobile Automation Testing
    • Automation Testing Life Cycle
    • Software Quality Assurance
    • Software Quality Assurance
    • What is Test Environment?
    • Verification and Validation Testing
  • Testing techniques
    • Software Testing Methodologies
    • Black Box Testing Techniques
    • Static Testing Techniques
    • Test Case Design Techniques
    • What is Static Analysis
  • Testing tools
    • Manual Testing Tools
    • Visual Testing Tools
    • Automation Testing Tools
    • Functional Testing Tools
    • GUI Testing Tools
    • Penetration Testing Tools
    • Performance Testing Tools
    • SOA Testing Tools
    • Accessibility Testing Tools
    • What is QTP
    • Regression Testing Tools
    • Security Testing Tools
    • Test Management Tools
    • Defect Management Tools
    • Code Coverage Tools
    • Test Coverage Tools
    • Defect Tracking Tools
    • Continuous Integration Tools
    • Install Bugzilla
    • Test data generation tool
    • Unit Testing Tools
    • Web Testing Tools
    • Stress Testing Tools
    • Performance Monitoring Tools
    • Mobile Testing Tools
    • Responsive Testing Tool
    • Cross Browser Testing Tools
    • Risk Based Testing
    • Database Testing Tools
    • WinRunner
    • What is Squish?
    • CubicTest
    • What is WinRM?
    • Bugzilla Tool
    • Code review tools
    • Penetration Testing Open Source Tools
  • Advance
    • Cyclomatic Complexity
    • Decision Table Testing
    • Decision Tree Algorithm
    • What is Continuous Integration
    • Mantis Bug Tracker
    • Equivalence Partitioning
    • Gantt Chart Software
    • Acceptance Testing Types
    • Load testing tools
    • Install TestNG
    • Install Unity
    • Defect Management Process
    • Test Plan Template
    • Testing Interview Questions
    • Testing of Mobile application
    • What is Test Automation Frameworks
    • Test Automation Framework
    • Application of Automation
    • Test Automation Process
    • Automation Testing Roles and Responsibilities
    • What is Instruction Cycle?
    • What is Cucumber?
    • 15 Best Popular Bug Reporting Tools
    • What is Automated Testing?
    • Software Maintenance Types
    • Types of Penetration Testing
    • Software Reliability
    • Best Gantt Chart Software
    • Code Coverage
    • Branch Coverage
    • Decision Coverage
    • Statement Coverage
    • What is Test Case
    • Types of Test Case
    • What is Test Scenario
    • Formal Review
    • Alpha Beta Pruning
    • What is Cyclomatic Complexity?
    • Test Coverage
    • How to Write Test Case
    • Testing Documentation
    • Performance Testing Life Cycle
    • Test Harness
    • Test Strategy
    • Software Incident Management
    • What is Debugging
    • What is Defect?
    • Listeners in TestNG
  • Inteview Questions
    • Automation Testing Interview Questions
    • Manual Testing Interview Questions
    • ISTQB Interview Questions
    • Cucumber Interview Questions
    • Software Testing Interview Questions
    • Penetration Testing Interview Questions

Related Courses

Software Testing Course

Penetration Training Course

TestNG Training Course

Mutation Testing

By Yashi GoyalYashi Goyal

Mutation Testing

Introduction to Mutation Testing

As the word ‘mutate’ in general means the ‘change,’ so does the Mutation testing signifies. Mutation testing is the type of software testing performed by changing or mutating the piece of code to check/verify that the test cases are capable enough to find the errors/defects. It comes under the White Box testing and is basically done while performing the Unit tests of a particular module of an application. The changes done in the source/main code are made in a small amount so that it would not affect its overall objective. This is also known as the Fault Detection Technique, as it is done for the purpose of locating the weakness of test cases by creating a fault in the original code.

All in One Software Development Bundle(600+ Courses, 50+ projects)
Python TutorialC SharpJavaJavaScript
C Plus PlusSoftware TestingSQLKali Linux
Price
View Courses
600+ Online Courses | 50+ projects | 3000+ Hours | Verifiable Certificates | Lifetime Access
4.6 (86,130 ratings)

Before performing any testing, it is very important to understand the objective behind it. The main objective of Mutation testing is to find the effectiveness of the test cases developed, which should be capable enough to detect even the small change made in the code. It is done to find the issues in the testing suite and the test data that is being used while performing the testing of any software application. Multiple mutants or versions of the original code are created, and each one of them is tested against the original test cases. If the test case results remain the same as we’re in the original code, then both the code and test cases are checked again because either the code was not executed or the test suite is not capable enough to find the mutant code.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

Types of Mutation Testing

There are basically 3 types of Mutation testing that are performed to create mutants of the original code:

1. Value Mutation

As the name indicates, in Value mutation, the value of constants, parameters passed in the methods, values used in loops are changed to create a mutant program. Either the large value is changed to a smaller one or vice versa. Basically, the values which are already defined in the program are changed to perform Value Mutation.

Original Code:

int a = 75636737;
int b = 3454;
int mult = a * b;
print(mult);

Mutant Code:

int a = 75;
int b = 345466465;
int mult = a * b;
print(mult);

2. Decision Mutation

In Decision Mutation, the logical and arithmetic operators used in the program are changed, which changes the overall decision-making in the program and its respective results. For example, a certain ‘if’ statement runs only when (a > b). In mutant code, this operator is changed to (a < b), which changes the code’s overall decision-making.

Original Code:

if (a>b || b>c)
{
print("yes");
}
else
{
print ("No");
}

Mutant Code:

if (a<b || b<c)
{
print("yes");
}
else
{
print ("No");
}

3. Statement Mutation

In Statement Mutation, changes are made in the full statements of code in order to create a mutant program. Changes in the statement can be deleting the whole statement, changing the order of statement in code, copy and paste the statements at some other location in code, repeating or duplicating the few statements in the original code.

Original Code:

if (a > b)
{
print("a is greater");
}
else
{
print("b is greater");
}

Mutant Code:

if(a > b)
{
// removing the statement
}
else
{
print("b is greater");
}

Advantages and Disadvantages of Mutation Testing

Given below are the advantages and disadvantages mentioned:

Advantages:

  • One of the biggest advantages of Mutation testing is that it helps to find the hidden defects and maximum code coverage in order to identify the part of the code that is not thoroughly tested by the original test cases.
  • It helps find the quality of test cases used for testing the software and provides genuine feedback to testers about the testing process and the test quality.
  • It helps to find high-quality bugs which are not easy to find by normal testing.
  • It sometimes reveals hidden defects like code ambiguity, incorrect values of variables, etc., in the code in the early stages of software testing, which is very beneficial.
  • At times, both the code and test case are correct, but the problem is caused because of test data. Mutation testing helps to find out the issues in test data.

Disadvantages:

  • In Mutation testing, various mutants of the code are created and tested against the original test suite, and hence it consumes a lot of time while performing only the Unit testing of a single feature/ module of an application.
  • As mentioned above, all the mutants are tested against the original suite, so there would be a large number of test cases that need to be executed, and hence this can not be performed without an automation tool which is costly and can hamper the project budget.
  • Complex mutants created in the original code can lead to confusion and mistakes in the original code.

Conclusion

The above explanation clearly defines what is Mutation testing and its importance in the field of testing of an application. If we want through and exhaust testing of an application with the test scenarios of maximum code coverage, it plays a crucial role.

Recommended Articles

This is a guide to Mutation Testing. Here we discuss the introduction and the types of mutation testing along with advantages and disadvantages. You can also go through our other suggested articles to learn more.

  1. Negative Testing
  2. Testing of Mobile application
  3. Risk-Based Testing
  4. Locust Load Testing
Popular Course in this category
Software Testing Training (11 Courses, 2 Projects)
  11 Online Courses |  2 Hands-on Projects |  65+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

Penetration Testing Training Program (2 Courses)4.9
TestNG Training (4 Courses, 2 Project)4.8
3 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Software Development Course

C# Programming, Conditional Constructs, Loops, Arrays, OOPS Concept

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more