Fear the Mutants. Love the Mutants. Use Mutation Testing to Improve Your Software Engineering Skills

Опубликовано: 19 Октябрь 2023
на канале: VonageDev
101
3

Code coverage (the percentage of your code tested by your tests) is a great metric. However, coverage doesn’t tell you how good your tests are at picking up changes to your codebase - if your tests aren’t well-designed, changes can pass your unit tests but break production.

Mutation testing is a great (and massively underrated) way to quantify how much you can trust your tests. Mutation tests work by changing your code in subtle ways, then applying your unit tests to these new, "mutant" versions of your code. If your tests fail, great! If they pass… that’s a change that might cause a bug in production.

In this video, Max from the Vonage Developer Experience team will show you how to get started with mutation testing in any language and how to integrate it into your CI/CD pipeline. Soon, catching mutant code will be a routine part of your release engineering process, and you’ll never look at penguins the same way again!

You can sign up for a free developer account with Vonage here: https://developer.vonage.com/sign-up

If you have any questions, please reach out to us on our Community Slack: https://developer.vonage.com/communit...
Chapters:
[0:00] Introduction
[1:10] Setting the Scene
[1:54] Using Unit Tests in Software Development
[3:21] Using Code Coverage
[5:13] Drawbacks of Code Coverage
[8:03] Mutation Testing
[12:09] A Python Example
[15:03] Let’s Look at Some Mutants!
[16:36] What Mutation Testing Can Tell Us
[18:16] Why Run Mutation Tests in your DevOps Pipeline?
[18:56] Example with GitHub Actions
[22:09] Summary