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

Mutation Testing - Backend Meetup @ STRV

Mutation Testing - Backend Meetup @ STRV

Ruan Martinelli

April 09, 2020
Tweet

More Decks by Ruan Martinelli

Other Decks in Programming

Transcript

  1. “What if I told you there is a codebase that

    is not yours and it passes all your tests? What if told you there are 200?” 8
  2. Mutations are small "faults" or "bugs" inserted into your code.

    When a mutation is applied to the code, a mutant is created. Mutation testing: 1. Change your code in small ways 2. Run the test suite once for each changed version 3. Analyze results - If one or more test breaks, it’s said that the mutant was killed - If all tests passes, it’s said that the mutant survived MUTATIONS, MUTANTS & MUTATION TESTING 9
  3. List of Mutation Testing tools: • Java - PIT •

    Ruby - Mutant • PHP - Infection • C# - VisualMutator & Stryker.NET • Python - MutPy • JavaScript - Stryker TOOLING 11
  4. KOA.JS 13 • Koa.js has 345 tests which take ~3s

    to run • 4 files were mutated, 793 mutants were created • Total execution time was 12m28s (8 cores)
  5. Mutation testing is resource and time-consuming • Run tests in

    the cloud periodically • Parallelism and distributed computing • Diff-based approach • AI & Machine learning • Run only on critical parts of your system GOING FURTHER 21