– Mutation testing is one of the most prominently used software testing methodology.
– This is the testing methodology involving modification of the code of the software or the byte code.
– The modifications are made such that they are small but inflict a significant change in the software system or application.
– Two other names for the same methodology are mutation analysis & program mutation.
– The code so obtained after the mutation is then subjected to a number of tests using various test cases and test suites and under different environments.
– This is particularly for testing the test suites.
We shall see how?
– The code so obtained is tested and if the mutation is not detected or rejected by it, then it is considered to be defective otherwise it is considered to be OK.
– Mutation testing is carried out on the basis of some special operators called the mutation operators.
– The major characteristic of these mutation operators is that they can mimic the bugs and errors that are typical to programming.
– At other times, these mutation operators are known to force testers creating more valuable tests that are highly significant.
– One example of such test is the one that evaluates each expression to 0 value.
– The mutation testing methodology has been developed exclusively for the purpose of allowing the software tester or developer for developing test cases that are so efficient in locating the weaknesses and the vulnerabilities as well present in the test data that is being given as input to the software system or application.
– These weaknesses and vulnerabilities might also be present in some of the sections of the program code which are chosen based up on how much frequently used.
– The sections having the lowest use count are taken for mutation testing.
– Also, the correctness of the implemented software system or application is verified through mutation testing.
Doubts about Mutation Testing
– One doubt that still rules is whether the mutation tests that are created are correct or not. How to know whether they are correct?
– Another doubt is that whether all the requirements as well as specifications are covered by them? Here by specifications and requirements we mean those which have led to the implementation of the test cases.
– A technological problem “who will guard the guards?” is what that is posed by the mutation tests.
– These mutation tests are prevalent since the 19s for detecting and locating the vulnerabilities and weaknesses.
– Many theories were put regarding the mutation testing and one of them pointed towards the behavior of the mutation testing.
– It stated that if any mutation made to the program code did not affect its behavior or output, there are 2 possibilities:
a) The mutated code did not execute at all or
b) The testing suite being used was not capable of detecting the injected mutation.
– A number of mutations have to be injected all over the program code so that at least one of them works.
– This gives rise to one drawback which is that a large number of copies of the program code need to be compiled.
– The development in the field of object oriented programming languages and unit testing frame works has paved the way for the creation of new mutation testing tools for a number of programming languages.
– Also, a number of methods have been developed for carrying out mutation testing.
Process of Mutation Testing
– In the process of mutation testing, firstly appropriate mutation operators are selected and next they are applied to the program code.
– One mutation operator is applied at an instant of time corresponding to the correct program code piece.
– The code resulting on the application of the mutation operator is known as the mutant.
– If the test suite happens to detect this mutant, then it is said to be killed.
– Strong mutation testing employs strong and efficient mutation testing suites so that the mutants can be effectively detected.
– The weak mutation testing suites are not able to do the same.