Repository navigation
Conversation
If `x = foo(a + 1)` -> `x = None` survives, the mutants inside `foo(a + 1)` are noise: whatever test kills the first one will most likely kill them too. Mutation generation now records the source span of each mutant in the .meta file, plus the span of the code removed by mutants of the assignment, argument removal, lambda and match operators. Replacing a plain name or literal, like `x = False` -> `x = None`, does not count as removing code, as such mutants often survive and would hide the `False` -> `True` flip. When results are loaded, a mutant whose span lies inside the code removed by a surviving mutant is shadowed by it. `mutmut browse` hides shadowed mutants and the `s` key shows them again. Part of boxed#367 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of #367:
mutmut browsenow hides mutants that are shadowed by a surviving mutant that removes their code, andsshows them again. mutmut has no line-deletion operator, so the shadowing mutants are the ones that already remove code:x = foo()->x = None, an argument set toNoneor dropped, a lambda body set toNone, and a droppedcase. Replacing a plain name or literal doesn't count. Each mutant's source span, plus the removed span for those operators, now goes in the.metafile, and a mutant inside code removed by a survivor is shadowed by the outermost one. On a small project browse went from 9 survivors to 1 (note = None), andsshows the other 8. Amutants/dir from an older version has no spans, so nothing is hidden until the source file changes ormutants/is deleted. Skipping runs (part 2) is left for later.Part of #367