mutmut
mutmut copied to clipboard
add mutant that removes the full body of a method
mutmut performs a deep mutation testing and the output could be overwhelming. A very simple type of mutation is one that empties the entire body of a method, as described in this article / paper / src. It would be handy if mutmut could run a mutation subset that would only include the "function emptier" so that the output would be shorter and easier to act on.
I don't think that's super meaningful. If you run mutmut and then look at the results you'll clearly see that all the mutants in any such non-covered function survive. So the only advantage of the empty-body mutation would be to speed up mutation testing potentially. But in a code base that doesn't have such grave issues it would slow down mutation testing by running one extra mutant per function. It doesn't sound like a reasonable tradeoff to me.
I agree the output can be overwhelming, but I don't think that's a problem really. It's just the reality of the situation.
I am new to mutmut and to mutation testing so I am not familiar with the internals. I was thinking:
- Mutations are divided into categories, e.g. "off by one", "flip boolean", "replace with None".
- The default mutmut run runs a subset of all mutation categories.
- A new mutation category could be the "empty body" mutation, which will not be part of the default subset.
Well that would work for me for sure.
In general there's an issue with mutmut that I have no real statistics on what mutations are useful and which are not. So it's mostly based on guesses and in some cases on bugs that have slipped through even after mutation testing.