University project · Software research
How do you test the tests?
A summary of a research paper on mutation testing: planting deliberate bugs in a program to see whether its tests notice, and a smarter way to find the bugs that hide best.
Auf einen Blick
- Type
- Research paper summary, team of two
- Period
- Summer semester 2021
- Paper
- Efficiently Finding Higher-Order Mutants (ESEC/FSE 2020)
- Topic
- Mutation testing, software quality
Hintergrund
A paper summary for the course Introduction to Research Fields in Computer Science, part of the master's programme Technology and Innovation Management at Hochschule Harz, written with a fellow student in the summer semester 2021.
The task
Read a recent software engineering research paper, understand it, and explain it in our own words. The paper was “Efficiently Finding Higher-Order Mutants”, presented at ESEC/FSE 2020, one of the main conferences in software engineering.
The idea behind it: testing the tests
Software is checked by tests: small programs that run the code and complain when something is wrong. But how do you know the tests themselves are any good?

Mutation testing answers that with a simple trick. You plant a small bug in the program on purpose, for example by turning a + into a - or a < into a <=. This changed version is called a mutant. Then you run the tests. If a test fails, it caught the bug, and the mutant is “killed”. If all tests still pass, you have found a gap in your tests.

It works like a fire drill. You do not wait for a real fire to find out whether the alarms work. You create a safe, fake one and watch what happens.
Simple and combined bugs
- A first-order mutant contains one planted change.
- A higher-order mutant contains several at once.
Most combined mutants are easy to catch, because each single change already makes a test fail. But some are special. In a strongly subsuming higher-order mutant, the changes partly cancel each other out, so the combined bug slips past tests that would have caught each change on its own. These are valuable, because real bugs often behave the same way: subtle, and hidden by other code around them.
The problem is finding them. With hundreds of possible changes, the number of combinations explodes. Trying them all is impossible for real programs.
What the authors did
- An exact but heavy search. They encoded all possible changes into the program at once and ran it in a special way, called variational execution, that tracks which combinations make tests fail. A solver then listed every hidden combined mutant. This finds everything, but it is too heavy for everyday use.
- Looking for patterns. In the results they noticed four things. The hidden mutants were made of only a few changes. Those changes tended to be caught by the same tests. Adding one more change to a hidden mutant often produced another one. And the changes were usually close together, often in the same class.
- A smarter search. Using those patterns, they built a prioritised search that tries the most promising combinations first. It needs no heavy analysis, so it works on larger programs, and in their experiments it found these mutants faster than earlier search techniques.
The authors were open that the method is not perfect, but it is a practical step forward.
What I take from it
The idea I kept is that a test that never fails tells you very little. Mutation testing makes you prove that your checks would actually catch a problem. I see the same logic outside software. A review process, a quality gate or a project checklist is only useful if it would stop a real mistake, and the honest way to know is to test it on purpose.
I also liked how the authors worked. They first used a slow, complete method to understand the problem, studied the results for patterns, and then built a fast method on what they learned. Understand it properly once, then make it practical.
Quellen
- arXiv: Efficiently Finding Higher-Order Mutants (2020) ↗arxiv.org
- Wikipedia: Mutation testing ↗en.wikipedia.org
- Computer History Museum: This Day in History, September 9 ↗computerhistory.org
Kontakt
Fragen, Ideen oder selbst etwas Ähnliches ausprobiert? Ich freue mich, davon zu hören. E-Mail schreiben