Posted by todsacerdoti 4/10/2025
“Add a major bug to this file that is not covered by existing tests” vs “Find the bug in this file” vs “write a sensible test in this file that protects against this type of bug”
https://en.wikipedia.org/wiki/Mutation_testing
A downside of naively changing source code is that you have to recompile the code for every mutant, which can be very slow (especially for Rust!). Obviously the right thing to do is to decide at runtime whether to insert a bug or not for each mutation point.
I had a brief skim through the help for cargo-mutants and it looks like it takes the naive approach which is rather unfortunate.
If you're looking for an option for Go, https://github.com/gtramontina/ooze can be of help. It was heavily inspired by https://github.com/zimmski/go-mutesting
I say this as a so-so software engineer. I badly wish there was more emphasis on increasing software quality. There is so much the industry could do to radically improve quality, such as tools like this.
I know the incentives just aren't there, but still.
There was some hype about it some years ago.
Is this to be used in addition to the tools mentioned in this talk: https://youtube.com/watch?v=qfknfCsICUM
This generalizes into the strategy that learning and programming are both skimming the edge of an envelope, alternating between things that work and things that almost work
[1]: https://mull.readthedocs.io/en/0.26.0/ [2]: https://sqlite.org/testing.html#mutation_testing
:V