Importance Of Mutation Testing
Posted By : Himani Sharma | 30-Oct-2017
Mutation Testing is one of the types of testing which is performed to know the effectiveness and quality of test cases or test suites. It is the White box testing technique which is mainly used for Unit testing.
For a tester, test cases are a measure of quality but to make sure about the quality of the test cases, below mentioned questions must be analyzed:
-
Have tester written enough tests?
-
Has tester covered every branch, every line, every path?
-
Will some of the test fails, if a semantic change is done to the code?
Mutation testing is the answer to the questions mentioned above as it helps to provide an automated way to verify if your tests are of any good.
Mutation testing is the method or strategy that makes small modifications to our source code known as mutants to detect the fault in the system or program under test. The ultimate goal is to kill mutants. Testers can set up as many mutants as required. They also need to make sure that every mutant remains unique and is also different from the original system.
The process of mutation testing is:
-
Create mutant software - by introducing semantic changes to the Java
byte code , such as inverting the logic ofif and while statements, and removing function calls. Changes performed on each of these codes is called a mutant. -
Prepare test cases for input to the original and mutant software
-
Execute original program and mutant program:
If the result of the original and mutant program is same than the mutant is killed otherwise mutant is alive.
-
Compute mutation score:
Mutation score is the percentage of killed mutants with total added mutants.
Mutation score=(Killed mutants/Total mutants)*100
The mutation test score is directly proportional to the success of the test cases or test suite.
Advantages:
-
It plays the major role in detecting new kind of bugs to the attention of developers.
-
It is more reliable and helps obtain stable systems.
-
It brings a good level of error detection towards unit tests.
-
A powerful tool to determine the coverage of testing programs.
Disadvantages:
-
Creating n number of mutants and testing of these mutants is time-consuming and costly.
-
Mutation testing is the very complex task to do manually.
-
Requires numerous testing to have the needed data.
-
It implies changes in the source code, so it is not at all appropriate for black box tests.
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Himani Sharma
Himani brings years of experience as a Quality Analyst, demonstrating expertise across the entire Software Development Life Cycle (SDLC), Software Testing Life Cycle (STLC), and Agile Methodology. Her skill set includes Release Planning, Risk Analysis, Test Planning, Estimation, and Reporting. Himani is proficient in Manual Testing for both web and mobile applications, Configuration Testing, as well as Load Testing using JMeter. She has successfully led teams in client projects. She is well-versed in bug reporting tools such as JIRA, Trello, Mantis, and Bugzilla. She has extensive experience in API Testing using Insomnia and Postman. Additionally, Himani is skilled in using debugging tools like Charles Proxy, as well as other tools like TestRail and Confluence. Her valuable contributions can be seen in client projects such as Pesamill, Belfrics, Coinzoom, ERM, Wethio, and HUMA.