Dave Aronson

Camp Counselor

Kill THAT Mutant! (Intro to Mutation Testing)

Event Logo

Tuesday, July 26, 2022 - 6:00 PM UTC, for 1 hour.

Regular, 60 minute presentation

Room: African 70

weird tricks
fun
code quality

How good is your test suite? Would it all still pass if the tested code was changed? If so, there may be problems with your code, your tests, or both! Mutation Testing reveals these cases. It makes lots of slightly altered versions, called "mutants", of each of your functions. If any mutants let all of the code's tests succeed, that implies certain flaws, mainly gaps in your test suite, or code that can (and therefore should) be removed. This talk will tell you how to use mutation testing, its benefits, drawbacks, inner workings, and history. There will be several examples (in Ruby, which is close enough to English to treat as pseudocode), and a list of tools for many popular languages. You will come away equipped with a powerful new technique for making sure your tests are strict and your code is meaningful.

Prerequisites

Must already be comfortable with basic unit testing. Semi-advanced foundational CS knowledge (mainly, what an Abstract Syntax Tree is) would also be helpful, but not absolutely required. However, applying it well may take some accumulated general programming experience that juniors might not have yet. So, I usually label this as for advanced or at least intermediate devs.

Take Aways

  • How to make sure your test suite is sufficiently strict
  • How to root out dead, unused, unreachable, and especially, untested code
  • What on Infinite Earths is "mutation testing" anyway, why should we do it, how do we do it, and how does it work?!
  • Why test coverage is not enough
favorited by:
Kevin Moens Mary Lou Essert Michael Caron Kevin Kelchen Dave Aronson Shaun Leistikow Matt Li Kyle Wormsbacher John Martin Wendy Istvanick David Hartman Dan Willman Simone LaMarche Caleb Soper Brent Davis Timothy Tyson Jacob Galloway Robert Nicholson Edmund Greaves John Kozlowski Connor McCurrie Cacie Robichaux Jesse Dahir-Kanehl Eric Boyd Rob Linxweiler Kris Kirkland Kyle Kurtz