What is mutation testing?
Note : This is the question asked by a visitor aejaz ahmed. I am posting this in proper forum.
Printable View
What is mutation testing?
Note : This is the question asked by a visitor aejaz ahmed. I am posting this in proper forum.
[B]Mutation testing-[/B] :
A method for determining if a set of test data or test cases is useful or not by intentionally inserting various code changes ('bugs') and retesting with the original test data/cases to determine if the 'bugs' are detected or not.If the bugs are detected means our test cases are usefull or perfect.If the bugs are not detected means we need to modify our test cases.
Note: we are making changes to the code only not to our previous test cases.
:)
Ramana.
This is a part of Unit Testing.
In mutation testing we change the code intentionally and test if the output varies according to the changes. if the output varies according to the changes we continue next program testing.
If the output does not vary according to the changes in the program code we continue the program testing till the error is fixed.
Hi bvani,
I got a small doubt after reading your answer at the point "test if the output varies according to the changes" means here code changing means input values changing and testing that will effect the output or not?
For Example: IF (a=b)
0
Else
a-b
}
take this above program as an example.
case:(1) values are a=1,b=1
then the output will be " 0" this is in the program
But If we change the values a=2, b=1
then the output should be '1' not "0" .
If the program returns '1' means the program is working fine other wise we should fix that error.
Is my conversation is acceptable or anything wrong just reply to this post.
:)
Ramana.
I think bvani was mentioning regarding the changes in program code and not changes in input test values. However i find both of u are right from your own perspectives.
A method to determine test suite thorougheness by measuring the extent to which a test suite can discriminate the program from slight varient (mutants) of the program.
It is back -to -back testing.
Mutation testing tells us about effectiveness of testcases.It comes under whitebox testing.We intentially add some mutants(errors) in the coding, and then see whether we catch them at the time of testing/ test case executation.
With regards,
Brijesh Jain.
Thanks Bharathi, Susheel & Brijesh that was timely.
Ramana I mentioned mutation testing is a part of unit testing
which comes under white box testing. Here we are concentrating
on the code and not the test cases. We check how efficient is the code ?
How is the code handling the various inputs given to it ?
check with this example :
if(a==b)
print "they are equal";
else
print "they are unequal";
the o/p of the program for i/p like
a=5,b=5
a=5,b=7
would be :
"They are equal"
"They are unequal"
As this is a build / modular level testing the programmer does the
mutation testing for his module.
--------------------------------------------------
Now the programmer checks for the efficiency of
the program by inserting an error in his code
if(a!=b)
print "they are equal";
else
print "they are unequal";
for inputs
a=5,b=5
a=5,b=7
the o/p of the program should be
"They are unequal"
"They are equal"
--------- developer knows there is a bug in the program and checks
if the output is according to the changes in program
so here he finds his code is working and goes ahead in testing the next module.
But instead if the changed program still returns
"They are equal"
"They are unequal"
for inputs
a=5,b=5
a=5,b=7
Its clear to the developer that his program not correct.
And goes to correcting the program and does the testing once again.
This testing is done by the developer as he know he has changed the code.
let me know if thats clear... :-) Bhavani
Hi Bhavani,
Yes, my doubt is now clear. Iam really satisfied with your explanation.
Thanks a lot
:)
Ramana.