1 / 32

Intro to Mutation Testing

Intro to Mutation Testing. Jeanne Boyarsky Oracle Code NYC – March 8, 2018. speakerdeck.com/boyarsky Twitter @jeanneboyarsky Blog: http://www.selikoff.net. About Me. 15 years as Java Developer JUnit user. @jeanneboyarsky. The Plan. About mutation testing Live demo

tcockrell
Download Presentation

Intro to Mutation Testing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to Mutation Testing Jeanne Boyarsky Oracle Code NYC – March 8, 2018 speakerdeck.com/boyarsky Twitter @jeanneboyarsky Blog: http://www.selikoff.net

  2. About Me 15 years as • Java Developer • JUnit user @jeanneboyarsky

  3. The Plan • About mutation testing • Live demo • A look at types of mutants • Profit??? @jeanneboyarsky

  4. Why write tests? It used to work! @jeanneboyarsky

  5. How know if tests are good? @jeanneboyarsky

  6. If test coverage low Write more tests! Not ready for mutation testing of class @jeanneboyarsky

  7. If test coverage high All done! Perfect code! @jeanneboyarsky

  8. Or is it? Why is it saying nobody is registered? @jeanneboyarsky

  9. Code Review! @jeanneboyarsky

  10. That’s a mutant! @jeanneboyarsky

  11. Too many mutants! They’re everywhere! @jeanneboyarsky

  12. PitClipse to the rescue! @jeanneboyarsky

  13. Almost PIT Integration @jeanneboyarsky

  14. JUnit 5 • Unofficial Fork: • https://github.com/tobiasstadler/pitest-junit5-plugin • It’s coming: • https://github.com/hcoles/pitest/issues/284 • https://github.com/hcoles/pitest/issues/398 @jeanneboyarsky

  15. Easy to run @jeanneboyarsky

  16. The console flies by @jeanneboyarsky

  17. Wait, we just had 100% coverage @jeanneboyarsky

  18. We caught 5 mutants @jeanneboyarsky

  19. More detail @jeanneboyarsky

  20. Level up @jeanneboyarsky

  21. Now 23 survived @jeanneboyarsky

  22. Let’s try it! Demo @jeanneboyarsky

  23. Observations • JUnit tests must pass • Fixing one may take care of more • Found a bug • Better tests @jeanneboyarsky

  24. Now with all mutators Demo @jeanneboyarsky

  25. Observations • Better tests • Unused production code @jeanneboyarsky

  26. Examples of Conditional Mutants @jeanneboyarsky

  27. Examples of Math Mutants @jeanneboyarsky

  28. Examples of Other Mutants @jeanneboyarsky

  29. Tips for bigger projects • Watch console to see if still running • Reports on whole project – drill down/split up • Exclude long running tests • Experimental feature: incremental analysis @jeanneboyarsky

  30. Review Requirements Mutation Testing Code Coverage

  31. More info • http://pitest.org/ • https://github.com/philglover/pitclipse • https://dzone.com/articles/introduction-mutation @jeanneboyarsky

  32. ??? @jeanneboyarsky

More Related