Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2019-chicago-jug-mutation-testing.pdf

 2019-chicago-jug-mutation-testing.pdf

Jeanne Boyarsky

November 03, 2019
Tweet

More Decks by Jeanne Boyarsky

Other Decks in Programming

Transcript

  1. @jeanneboyarsky 1 Intro to Mutation Testing Jeanne Boyarsky Monday, November

    4, 2019 Chicago Java User Group speakerdeck.com/boyarsky
  2. @jeanneboyarsky PIT 22 Mutant Generation Bytecode (ASM) Test Selection Coverage

    Mutant Insertion Instrumentation Mutant Detection Early Exit (fine)
  3. @jeanneboyarsky Mutant Generation Options 1. Bytecode • Faster • May

    not map to line of code • Java 8 stream support was immediate 2. Source Code • Slower • Clearer 23 Thank you to pitest.org for this material
  4. @jeanneboyarsky Test Selection Options 1. Coverage • Fast - picks

    right test 2. Naive • Slow - brute force 3. Convention • Medium - uses naming conventions 24 Thank you to pitest.org for this material
  5. @jeanneboyarsky Mutant Insertion Options 1. Instrumentation • Fast - picks

    right test 2. Classloader • Uses a lot of memory 3. Debugger Hotswap • Can be slower because debugger on 25 Thank you to pitest.org for this material
  6. @jeanneboyarsky Mutant Detection Options 1. Early Exit (fine) • Stops

    when test finds a mutant 2. Early Exit (coarse) • Stops when class finds a mutant 3. Naive • Slow - brute force 26 Thank you to pitest.org for this material
  7. @jeanneboyarsky JUnit 5 Support • Supported by • Maven •

    Gradle • However…. I find IDE integration to be critical 29
  8. @jeanneboyarsky Tips • JUnit tests must pass • Watch console

    to see if still running • Reports on whole project • Fixing one may take care of more 30