Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mutant that removes the full body of a method #241

Open
sed-i opened this issue Jan 23, 2022 · 3 comments
Open

add mutant that removes the full body of a method #241

sed-i opened this issue Jan 23, 2022 · 3 comments

Comments

@sed-i
Copy link
Collaborator

sed-i commented Jan 23, 2022

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.

@boxed
Copy link
Owner

boxed commented Jan 24, 2022

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.

@sed-i
Copy link
Collaborator Author

sed-i commented Jan 24, 2022

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.

@boxed
Copy link
Owner

boxed commented Jan 24, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants