Skip to content

Choose a maintained mutation-testing tool for the registry function net #57

Backlog

Description

@lusoris

The registry function net is measured by a hand-written mutant sweep: a local script that walks the AST of each covered function, writes one mutant at a time, runs the three test files and restores the source. Round three produced 2,486 mutants and 412 survivors (issue #56). The sweep is not in this repository, so nobody else can rerun it, and it has no incremental mode, no cache and no report format.

Question

Should a maintained mutation-testing tool replace the hand-written sweep, run from a make target and in CI on the files a change touches?

Candidates (checked on PyPI 2026-11-26)

  • mutmut 3.8.1, released 2026-10-28, Python 3.10 or newer.
  • Cosmic Ray 8.9.0, released 2026-11-10, Python 3.9 or newer, MIT licence.

To find out

  • Whether each tool runs on knowledge_registry.py (about 20,300 lines) in a bounded time with the existing pytest setup and the hermetic fixture rules.
  • Whether its operators cover the mutant classes the hand sweep used (changed string and number constants, swapped and and or, negated comparisons, membership and identity tests, replaced conditions).
  • How it marks equivalent mutants, so the 37 recorded ones are not reported again.
  • Whether it can limit a run to the functions a change touches, for a CI gate.

Done when

  • One tool is chosen and wired to a make target, or the hand sweep is kept with the reason written down.
  • The chosen path reproduces the round-three counts on the same base within a stated tolerance.

Activity

  1. lusoris commented on Nov 26, 2026

    @lusoris
    ContributorAuthor

    The exact-head review of PR #58 at 1621d0d found three facts that bear on the tool choice. The gaps themselves are tracked in #56.

    • The hand sweep did not generate four kinds of edit that survive. Replacing a forwarded CLI argument with None (item 1 in Kill or justify the 412 surviving mutants of the registry function net #56), removing the final newline from a written file (item 3), adding payload.pop(...) on the caller's document (item 4) and changing the canonical projection id (item 5) each stay green, and none of them is in the sweep's red, survivor or equivalent lists. A candidate tool should be checked for these edits as well as for the classes listed above.
    • The equivalent list cannot tell two edits on the same line apart. Recorded equivalents 150 (outer fallback) and 182 (inner default) print the same edit text and the same argument for knowledge_registry.py:5627, and 182 is not equivalent (item 2 in Kill or justify the 412 surviving mutants of the registry function net #56). A tool that records equivalents by place and operator would keep them apart.
    • A newline in the temporary path breaks 11 tests on unchanged source (item 7 in Kill or justify the 412 surviving mutants of the registry function net #56). A tool run should use a temporary directory without one, or such failures would count as kills.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions