if you want to remove an article from website contact us from top.

    mutation testing in software engineering


    Guys, does anyone know the answer?

    get mutation testing in software engineering from screen.

    Software Testing

    A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

    Software Testing | Mutation Testing

    Difficulty Level : Hard

    Last Updated : 05 Sep, 2022

    Read Discuss Practice Video Courses

    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:

    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.

    स्रोत : www.geeksforgeeks.org

    What is mutation testing?

    This definition explains mutation testing, a form of white box testing designed to test a test suite rather than an application. Testers will change specific pieces in an applications source code to ensure a software test suite will be able to detect the changes.


    mutation testing

    Alexander S. Gillis, Technical Writer and Editor

    Mutation testing, also known as code mutation testing, is a form of white box testing in which testers change specific components of an application's source code to ensure a software test suite will be able to detect the changes. Changes introduced to the software are intended to cause errors in the program. Mutation testing is directed to ensure the quality of a software testing suite, not the applications the suite will go on to test.

    Mutation testing is typically used to conduct unit tests. The goal is for the software test to be able to detect all mutated code. Changes (called mutations) can be implemented by making modifications to an existing line of code to a different value. For example, a statement could be deleted or duplicated, true or false expressions can be changed or other variables can be altered.

    Mutations introduced to a program’s code will typically be small and contain one variable which causes a fault or bug. Multiple versions of the original program are then made, each with its own mutation, called mutants. The mutants are then tested, along with the original application. Once the tests are conducted, testers should then compare the results to the original program test.

    If the tests with the mutants detect the same amount of issues as the test with the original program, then testers will know that either the code has failed to execute, or the software testing suite being used has failed to detect the mutations. The software testing suite should then be worked on to be more effective. The mutants can be kept and re-used in another code mutation test once the testing software has been worked on. If the test results from the mutants to the original programs are different, with the software test detecting the faults in the mutants, then the mutants can be discarded, or killed.

    The software test suite can then be scored by using the mutation score. The mutation score is the percentage of killed mutants divided by the total number of mutants multiplied by 100.

    Advantages & disadvantages

    Advantages to code mutation include:

    The ability to ensure the identification of weak tests or code.

    Has a high level of error detection.

    The increased use of object-oriented frameworks and unit tests have brought about more mutation testing tools.

    Mutation scores can give organizations an idea of how useful their testing suite is.

    Disadvantages to code mutation include:

    The large number of mutants used to test a test suite can lead to a potentially confusing experience in testing each version, which may reduce mutation testing’s practicality without automation.

    Because of the large number of mutants being tested, mutation testing can be time-consuming and pricey.

    Mutation testing vs. regression testing

    Regression testing can be easily confused with mutation testing at first glance. Regression testing is the process of testing new changes to a program to ensure that the older programming still works with new changes. Test department coders will develop code test scenarios that will test new units of code after being written.

    Regression testing is used to test changes to a program to ensure a new version of an application which solves an old bug does not introduce another. Regression tests will look at applications to ensure that small changes to an application's code do not break the software. This is opposed to code mutation, which makes new changes to an application's code to test the test suite itself.

    This was last updated in March 2019

    Continue Reading About mutation testing

    Should black-box, white-box testing be used together?

    Tests Coverage is Dead — Long Live Mutation Testing

    Is unit testing an important aspect of software development?

    How to learn white box testing

    Related Terms

    composable infrastructure

    Composable infrastructure is a framework that decouples device resources in order to treat them as services. See complete definition

    Kubernetes operator

    A Kubernetes operator is a method for application packaging and deployment that extends Kubernetes' capabilities to manage more ... See complete definition

    sidecar proxy

    A sidecar proxy is an application design pattern which abstracts certain features, such as inter-service communications, ... See complete definition

    Dig Deeper on Systems automation and orchestration

    Key things to consider when choosing regression testing tools

    By: Gerie Owen

    Smoke testing vs. sanity testing explainer on key differences

    By: Gerie Owen

    How to develop a dependable regression testing strategy

    By: Gerie Owen

    What regression testing types make sense for your applications

    By: Amy Reichert

    स्रोत : www.techtarget.com

    Mutation Testing

    Mutation Testing with introduction, software development life cycle, design, development, testing, quality assurance, quality control, methods, black box testing, white box testing, etc.

    Mutation Testing

    Mutation Testing What is mutation testing?

    Mutation testing is a white box method in software testing where we insert errors purposely into a program (under test) to verify whether the existing test case can detect the error or not. In this testing, the mutant of the program is created by making some modifications to the original program.

    The primary objective of mutation testing is to check whether each mutant created an output, which means that it is different from the output of the original program. We will make slight modifications in the mutant program because if we change it on a massive scale than it will affect the overall plan.

    When we detected the number of errors, it implies that either the program is correct or the test case is inefficient to identify the fault.

    Mutation testing purposes is to evaluate the quality of the case that should be able to fail the mutant code hence this method is also known as Fault-based testing as it used to produce an error in the program and that why we can say that the mutation testing is performed to check the efficiency of the test cases.

    What is mutation?

    The mutation is a small modification in a program; these minor modifications are planned to typical low-level errors which are happened at the time of coding process.

    Generally, we deliberate the mutation operators in the form of rules which match the data and also generate some efficient environment to produce the mutant.

    Types of mutation testing

    Mutation testing can be classified into three parts, which are as follows:

    Decision mutations value mutations Statement mutations

    Let us understand them one by one:

    Decision mutations

    In this type of mutation testing, we will check the design errors. And here, we will do the modification in arithmetic and logical operator to detect the errors in the program.

    Like if we do the following changes in arithmetic operators:

    plus(+)→ minus(-)

    asterisk(*)→ double asterisk(**)

    plus(+)→incremental operator(i++)

    Like if we do the following changes in logical operators

    Exchange P > → P<, OR P>=

    Now, let see one example for our better understanding:

    Value mutations

    In this, the values will modify to identify the errors in the program, and generally, we will change the following:

    Small value à higher value

    Higher value àSmall value.

    For Example:

    Statement Mutations

    Statement mutations means that we can do the modifications into the statements by removing or replacing the line as we see in the below example:

    In the above case, we have replaced the statement r=15 by s=15, and r=25 by s=25.

    How to perform mutation testing

    To perform mutation testing, we will follow the below process:

    In this, firstly, we will add the errors into the source code of the program by producing various versions, which are known mutants. Here every mutant having the one error, which leads the mutant kinds unsuccessful and also validates the efficiency of the test cases.

    After that, we will take the help of the test cases in the mutant program and the actual application will find the errors in the code.

    Once we identify the faults, we will match the output of the actual code and mutant code.

    After comparing the output of both actual and mutant programs, if the results are not matched, then the mutant is executed by the test cases. Therefore the test case has to be sufficient for identifying the modification between the actual program and the mutant program.

    And if the actual program and the mutant program produced the exact result, then the mutant is saved. And those cases are more active test cases because it helps us to execute all the mutants.

    Advantages and disadvantages of Mutation Testing


    The benefits of mutation testing are as follows:

    It is a right approach for error detection to the application programmer

    The mutation testing is an excellent method to achieve the extensive coverage of the source program.

    Mutation testing helps us to give the most established and dependable structure for the clients.

    This technique can identify all the errors in the program and also helps us to discover the doubts in the code.


    The drawbacks of mutant testing are as follows:

    This testing is a bit of time taking and costlier process because we have many mutant programs that need to be created.

    The mutation testing is not appropriate for Black-box testing as it includes the modification in the source code.

    स्रोत : www.javatpoint.com

    Do you want to see answer or more ?
    Mohammed 7 day ago

    Guys, does anyone know the answer?

    Click For Answer