Intro to Mutation Testing slideshare.net/ boyarsky Twitter @jeanneboyarsky Blog: http://www.selikoff.n Jeanne Boyarsky NY Java SIG 12/5/16
Intro to Mutation Testing
slideshare.net/boyarskyTwitter @jeanneboyarskyBlog: http://www.selikoff.net
Jeanne BoyarskyNY Java SIG
12/5/16
@jeanneboyarsky
Pause for a Commercial
Why write tests?
@jeanneboyarsky
It used to work!
How know if tests are good?
@jeanneboyarsky
If test coverage low
@jeanneboyarsky
Write more tests!
Not ready for mutation testing of class
If test coverage high
@jeanneboyarsky
All done!Perfect code!
Or is it?Why is it saying
nobody is registered?
Code Review!
That’s a mutant!
Too many mutants!They’re
everywhere!
PitClipse to the rescue!
Easy to run
The console flies by
We caught 5 mutants
More detail
The mutants live….
Level up
Now 32 survived
Demo
Tips
• JUnit tests must pass• Watch console to see if still running• Reports on whole project• Fixing one may take care of more
@jeanneboyarsky