2016 java-sig-mutation-testing
TRANSCRIPT
![Page 1: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/1.jpg)
Intro to Mutation Testing
slideshare.net/boyarskyTwitter @jeanneboyarskyBlog: http://www.selikoff.net
Jeanne BoyarskyNY Java SIG
12/5/16
![Page 2: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/2.jpg)
@jeanneboyarsky
Pause for a Commercial
![Page 3: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/3.jpg)
Why write tests?
@jeanneboyarsky
It used to work!
![Page 4: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/4.jpg)
How know if tests are good?
@jeanneboyarsky
![Page 5: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/5.jpg)
If test coverage low
@jeanneboyarsky
Write more tests!
Not ready for mutation testing of class
![Page 6: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/6.jpg)
If test coverage high
@jeanneboyarsky
All done!Perfect code!
![Page 7: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/7.jpg)
Or is it?Why is it saying
nobody is registered?
![Page 8: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/8.jpg)
Code Review!
![Page 9: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/9.jpg)
That’s a mutant!
![Page 10: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/10.jpg)
Too many mutants!They’re
everywhere!
![Page 11: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/11.jpg)
PitClipse to the rescue!
![Page 12: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/12.jpg)
Easy to run
![Page 13: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/13.jpg)
The console flies by
![Page 14: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/14.jpg)
We caught 5 mutants
![Page 15: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/15.jpg)
More detail
![Page 16: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/16.jpg)
The mutants live….
![Page 17: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/17.jpg)
Level up
![Page 18: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/18.jpg)
Now 32 survived
![Page 19: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/19.jpg)
Demo
![Page 20: 2016 java-sig-mutation-testing](https://reader036.vdocuments.us/reader036/viewer/2022070601/588766221a28ab22358b4949/html5/thumbnails/20.jpg)
Tips
• JUnit tests must pass• Watch console to see if still running• Reports on whole project• Fixing one may take care of more
@jeanneboyarsky