SE Radio 632: Goran Petrovic on Mutation Testing at Google

Topics covered
Popular Clips
Questions from this episode
- Asked by 6 people
Episode Highlights
Mutation Testing
Mutation testing is a sophisticated method for assessing test suite effectiveness by introducing small faults, or "mutants," into software code. explains that unlike traditional test adequacy criteria such as code coverage, mutation testing evaluates whether tests can detect these intentional faults, providing a more robust measure of test quality 1. He notes that mutation testing involves creating multiple versions of code with slight changes, like altering arithmetic operations or deleting code blocks, and then running tests to see if they can identify these changes 2. This approach helps ensure that tests do more than just cover code; they validate its correctness 3.
Programming is an art of adding bugs to your code and then removing them. Probably you never remove all of them.
---
This method is particularly valuable in large-scale software development, where code longevity and frequent modifications increase the risk of undetected bugs.
Benefits & Challenges
Mutation testing significantly enhances test quality and software reliability by encouraging developers to write more effective test cases. highlights that this method not only increases the number of tests but also improves their ability to detect defects, as evidenced by a reduction in live mutants in code submissions at Google 4. He also discusses the coupling effect, where mutants resemble real bugs, thus tests that catch mutants are likely to catch actual bugs as well 5. However, implementing mutation testing is resource-intensive, requiring careful selection of mutants to ensure feasibility and effectiveness 6.
If these tests had been written, had mutation testing been enabled, these bugs would have been prevented.
---
Despite its challenges, mutation testing offers a compelling case for improving software quality by preemptively identifying potential defects.
Tools & Automation
Integrating mutation testing into existing workflows requires sophisticated tools and automation. At Google, the mutagenesis tool automates the mutation testing process by generating mutants and running tests against them, all integrated into the code review process 7. explains that this system minimizes developer disruption by focusing on code changes relevant to the current commit, thus optimizing resource use and developer attention 8. The tool supports multiple programming languages, including C, Python, Java, and Rust, making it versatile for various development environments 7.
The best way to get developers to do something and to act on some results is to introduce the least amount of friction in their workflow.
---
By seamlessly integrating into the development process, mutation testing tools like mutagenesis enhance software quality without overwhelming developers.
Related Episodes


SE Radio 572: Gregory Kapfhammer on Flaky Tests
Answers 383 questions

Episode 474: Paul Butcher on Fuzz Testing
Answers 383 questions
SE Radio 633: Itamar Friedman on Automated Testing with Generative AI
Answers 383 questions

SE-Radio Episode 283: Alexander Tarlinder on Developer Testing
Answers 383 questions

SE-Radio Episode 360: Pete Koomen on A/B Testing
Answers 383 questions

SE-Radio Episode 256: Jay Fields on Working Effectively with Unit Tests
Answers 383 questions

SE Radio 577: Casey Muratori on Clean Code, Horrible Performance?
Answers 383 questions

SE Radio 603: Rishi Singh on Using GenAI for Test Code Generation
Answers 383 questions

SE-Radio-Episode-280-Gerald-Weinberg-on-Bugs-Errors-and-Software-Quality
Answers 383 questions

SE Radio 562: Bastian Gruber on Rust Web Development
Answers 383 questions

SE-Radio Episode 276: Björn Rabenstein on Site Reliability Engineering
Answers 383 questions

SE-Radio Episode 251: Martin Klose on Code Retreats
Answers 383 questions

SE Radio 647: Praveen Gujar on Gen AI for Digital Ad Tech Platforms
Answers 383 questions

SE Radio 649: Lukas Gentele on Kubernetes vClusters
Answers 383 questions

SE-Radio Episode 330: Natalie Silvanovich on Attack Surface Reduction
Answers 383 questions













