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

Intro to Mutation Testing

Intro to Mutation Testing

Presented at Oracle Code NYC 2018. This is a repeat of the session I gave at JavaOne in 2017.

Jeanne Boyarsky

March 05, 2018
Tweet

More Decks by Jeanne Boyarsky

Other Decks in Technology

Transcript

  1. The Plan 1.  About mutation testing 2.  Live demo 3. 

    A look at types of mutants 4.  Profit??? @jeanneboyarsky
  2. Observations •  JUnit tests must pass •  Fixing one may

    take care of more •  Found a bug •  Better tests @jeanneboyarsky
  3. Examples of Conditional Mutants @jeanneboyarsky Conditionals Boundary <= vs <

    Negative Conditionals <= vs > Void Method Call Removes method calls
  4. Examples of Other Mutants @jeanneboyarsky Return Values x vs x+1

    Disabled by default (false positives, duplicates or crashes) Constructor Calls Inline Constants Non Void Method Calls Remove Conditionals Experimental Member Variables Switch
  5. 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