Skip to content

Build a faster test group for mutation testing while preserving kills #217

Done

Description

@tob-scott-a

Follow-up to #216. Evaluate a dedicated, fast pytest group for mutation testing after the runner and wall-clock benchmark work in that PR.

Coverage-driven selection reduces the tests run for each mutant, but the available test pool can still include expensive tests that add no unique mutation kills. A smaller group of focused tests could reduce coverage preparation, collection, and mutant execution time while preserving the full suite's effectiveness.

The requirement is to preserve every kill achieved by the full suite against the same mutation inventory. Matching line coverage alone is insufficient. Keep existing reviewed equivalent-mutant exceptions unchanged, and retain integration tests wherever they provide unique kills.

Suggested approach:

  1. Establish the full suite's observed mutant outcomes and end-to-end wall time.
  2. Seed the group from existing fast tests known to kill mutants. Favor tests that provide many distinct kills for their runtime. Mark existing tests rather than duplicating them into a separate suite.
  3. Compare the group's kills with the full suite's kills. An exhaustive test-by-mutant matrix is not required to start; grow the evidence incrementally.
  4. Apply vector-forge's survivor-driven loop where a kill is lost: inspect the mutation, add a small targeted boundary or negative case, and remeasure. Cover the whole application rather than limiting the source mutation scope to make the numbers look better.
  5. Continue coverage-driven selection within the group. Keep the full test suite in ordinary CI and periodically compare full-suite mutation results with the reduced group as code changes.

Acceptance criteria:

  • A documented pytest marker/group and command select the mutation tests explicitly.
  • The group preserves the full suite's killed-mutant set across the complete application mutation inventory, with no additional survivor waivers or inconclusive outcomes used to improve the score.
  • Recorded benchmarks demonstrate real end-to-end wall-clock savings. Compare the full and reduced test groups with the same sources, mutation operators and targets, hardware, worker count, and result-cache state. Include baseline, coverage, collection, and confirmation costs. Include plain unsharded pytest-gremlins as a reference, consistent with Use coverage-driven mutation tests and shared CI baselines #216's benchmarking requirement.
  • The report records per-mutant outcome differences as well as elapsed time; fewer tests or selected test/mutant pairs alone do not count as success.
  • Documentation defines when full-suite mutation audits run and how newly lost kills are restored to the fast group.

Activity

  1. added this to the v0.10.0 milestone on Nov 24, 2026
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions