Repository navigation
refactor(checker): remove five unused is_non_arg overrides; exclude the decided mutants - #1899
Merged
Merged
Conversation
`Checker::is_non_arg` has one caller, `count_args` in `nargs.rs`, and five languages overrode it without ever reaching that caller: - Go, Lua, Tcl and iRules implement `NArgs::compute` themselves and count their parameters by positive match (`compute_go_args` and its siblings); Lua's override said as much in a note. - Bash takes the default `NArgs::compute`, which looks for a `parameters` field tree-sitter-bash 0.25.1 does not have. Each override now reads as a comment, as `checker/csharp.rs` has done since its own was removed, and the trait's default `false` stands. The mutation run is what showed them: replacing any of the bodies with a constant passed both suites, because nothing ran them. No behaviour can change. The root and ast suites pass, the corpus snapshots included. Refs #1736
…1736 The config's header now names five kinds of entry, and the guide says the same. Beside the three it had (equivalent, unreachable, non-terminating): - same output, different work, with the work named. Five mutants: the Python `loc` parenthesis guard and the Go `cognitive` callable guard skip a memo probe; Rust's `has_doc_marker_child` with `>=` and the two `&&` in PHP's `Npa::compute` add a child scan. - separated only by source the language rejects, where the code says the branch is unpinned on purpose. Three mutants: the C# `++` peel guard, and the guard and arm for a Groovy `super` outside a wildcard. Four more rest on evidence and say so: the Perl `ParenthesizedArgument` arm (no difference across generated sources; parse table not read), the two parent guards in `rust_count_assoc_const` (proved for the grammar's productions, not for recovery trees), and `rust_attribute_run_member`'s second `||`, equivalent while the two Rust comment rows list the same kinds. That last one shares its name and its column with a live mutant on the line above, so its pattern keeps the line and the comment says when to check it again. The thirteenth is the `is_non_arg` trait default, unreachable now that no language which inherits it reaches `count_args`. The configured list differs from the unconfigured one by exactly forty-six mutants. Refs #1736
This branch was previously deployed
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.
Third wave of work on #1736. It applies the decisions recorded there for the 21 mutants wave 2 (#1895) left open.
Refs #1736. This does not close it: 8 mutants wait on #1885, #1886, #1887, #1889 and #1890, and the close condition is a clean
mutation-test.ymlrun onmain.Commits
refactor(checker)is_non_argoverrides of Bash, Go, iRules, Lua and Tcl.count_argsinnargs.rsis the one caller, and none of the five reaches it: four count their parameters themselves, and Bash has noparametersfield for the defaultNArgs::computeto find. Each override now reads as a comment, aschecker/csharp.rshas since its own was removedci(mutation)The thirteen exclusions
is_non_argtrait default, now that no language inheriting it reachescount_argslocparenthesis guard and the Gocognitivecallable guard (one memo probe fewer); Rusthas_doc_marker_childwith>=and the two&&in PHP'sNpa::compute(one child scan more)++peel guard; the guard and the arm for a Groovysuperoutside a wildcardParenthesizedArgumentarm; the two parent guards inrust_count_assoc_const;rust_attribute_run_member's second `The last one shares its name and its column with a live mutant on the line above, so its pattern keeps the line (
checker.rs:1105:9) and its comment says to check it whenever that line moves.Evidence
cargo mutants --list --no-config -e '**/*_tests.rs'againstcargo mutants --listover the workflow's selection differs by exactly 46 mutants: these thirteen and the 33 already onmain. The mutants of the five removed overrides are gone from the list.make pre-commit:BCA_GATE: pass (gate=pre-commit)on this tree.Not done
make bench-scaling, which the project asks for after a change to aChecker, has not been run to a meaningful result: the host's load average has been between 50 and 90 throughout. The change removes code that was never called.