Hire Mutants to Build your Test Suite!

By Dave Aronson

Elevator Pitch

Many of us inherit code with no tests. (Or even write it!) That makes changes difficult. But adding tests is also difficult! This talk explains how to use Mutation Testing to make writing a test suite for untested code much less daunting and stressful.

Description

Do you find it daunting to write a test suite for existing code, from scratch?

Even those of us practicing Test-Driven Development sometimes need to do so. Maybe the boss wants to put our little throwaway experiment into production, rather than letting us rewrite it with good practices. Maybe we inherited code without tests. Maybe we even wrote code without tests?!

Fear no more – a horde of mutants is at our beck and call, to help us!

Come learn how Mutation Testing can help us eat the elephant of test-writing, one bite at a time, making it a far less daunting and stressful experience. (If you aren’t already familiar with Mutation Testing, don’t worry, I will recap the basic concept.)

Notes

The code under test will not be livecoded, but the tests will be.

Agenda: - Recap of Mutation Testing (MT) - Explanation of how MT can help build a test suite - Intro to the fairly simple code to be tested - Demo: 1: run the MT tool 2: for each function with surviving mutants: 2a: have the audience pick one mutant to kill 2b: have the audience propose a test to kill it 3: repeat from step 1 until no mutants survive - FAQs - Audience Q&A

Depending on conference preference, this might be done in Elixir, Python, Ruby, JavaScript, or maybe other languages if I have lead time to delve into their tooling.