Skip to content

test: close Gremlins-flagged gaps (surviving mutants + uncovered code) #290

Open

Description

@ffumero2003

Context

After the test-integrity work landed, a refreshed Gremlins v0.6.0 run on main (c3b00f1, --timeout-coefficient 20 --workers 2, unit tests only, no -race) measured:

Package Test efficacy Mutator coverage Killed / Lived / Not-covered / Timed-out
b2 96.54% 96.66% 754 / 27 / 27 / 17
base 92.44% 78.67% 208 / 17 / 61 / 0

(Up from the #97 baseline of 64.05% / 71.88%.) This issue tracks closing the remaining gaps the run surfaced. Two kinds of work; do them as separate PRs.

Acceptance criteria

  • R1. Part A: a re-run shows the targeted surviving mutants killed (or annotated equivalent); efficacy rises toward the high-90s. Each new test is proven to fail when its production line is reverted.
  • R2. Part B: monitor.go has unit coverage; remaining not-covered lines are either covered or documented as live-only.
  • R3. Depends on the Gremlins CI adoption (ci: evaluate and adopt mutation testing (gremlins, go-mutesting, ooze) #97) landing first so the numbers are reproducible.

In scope

Part A — kill the surviving mutants (tests exist but don't catch a change)

These lines have a mutant that survived — a change there passes every test. Each is a boundary/arithmetic/negation that needs a test asserting the exact behavior (break-per-claim: revert the fix, the new test must fail).

b2 (27 surviving), concentrated in:

  • writer.go: 516, 610, 621, 699, 731, 1017, 1022, 1023
  • reader.go: 266, 269, 286, 459
  • replication.go: 215, 219, 251
  • iterator.go: 102, 108
  • accountinfo.go: 162, 221
  • b2.go: 774 · baseline.go: 414 · compose.go: 274 · progress.go: 49 · sync/sync.go: 351 · copy.go: 162 · backend.go: 101

Also resolve the 17 timed-out b2 mutants (mostly writer.go/reader.go) by raising --timeout-coefficient or trimming the slow test so they report a real killed/lived instead of timing out.

base has 17 surviving mutants; the per-line list was not captured (the baseline base run was not saved). Re-run gremlins unleash --timeout-coefficient 20 --workers 2 ./base to enumerate them before fixing.

Note: some survivors may be equivalent mutants (behavior-identical, uncatchable) — annotate and skip those rather than contorting a test. Target the real ones; 100% is not the goal.

Part B — cover untested code (no test reaches it)

b2 has 27 "not covered" mutants, dominated by:

  • monitor.go: lines 50, 144, 147, 199, 203–205, 226, 230 — the package has effectively no unit tests.
  • lock.go: 65 — file-lock paths (may require live B2).
  • sync/sync.go: 298, 414, 416 · accountinfo.go: 167 · backend.go: 1114 · b2.go: 901 · replication.go: 26

Add hermetic unit tests where possible (monitor.go first); where a path genuinely needs live B2, document that in docs/testing.md rather than forcing a fake.

Out of scope

  • Unrelated work outside the components and behavior described in In scope.

Verification

Run the repository regression checks with live credentials unset:

unset B2_APPLICATION_KEY_ID B2_APPLICATION_KEY B2_ACCOUNT_ID B2_ACCOUNT_KEY
go build ./...
go vet ./...
go test -race -count=1 ./b2/... ./base
  • Use Gremlins v0.6.0 without -race, recording the measured ref and configuration. Preserve the issue's historical baseline as historical, rather than claiming it is a fresh measurement.
  • Apply each targeted mutation independently; record red output for the relevant test and green output after restoration. Explain equivalent mutants instead of contorting tests.
  • Re-run the specified base enumeration: gremlins unleash --timeout-coefficient 20 --workers 2 ./base; record per-package killed/lived/not-covered/timed-out results for the targeted run.
  • For Part B, record covered paths or the documented reason a path needs live B2.
  • Gremlins runs must remain separate from the race-enabled Go regression run.
  • Expected result: the checks above succeed and the observable outcomes in Acceptance criteria are demonstrated. If a check cannot run, report Could not run because: ...; if it starts but fails, report Could not complete because: .... A skipped check is not a pass.

Links

Activity

  1. added this to the 0.10.0 milestone on Nov 4, 2026
  2. self-assigned this
    on Nov 4, 2026
  3. added
    testingTests, test coverage and test infrastructure
    on Nov 4, 2026
  4. added theissue type on Nov 4, 2026
  5. 4 remaining items

  6. ffumero2003 commented on Nov 5, 2026

    @ffumero2003
    ContributorAuthor

    Refreshed baseline — Gremlins v0.6.0 on main @59104c6 (2026-11-05)

    Measured twice (local + pinned v0.6.0), identical results. #293 has landed; accountinfo.go now has zero survivors.

    Package Efficacy Coverage Lived Timed out Not covered
    ./b2 96.69% 99.15% 27 2 7
    ./base 90.78% 82.94% 26 0 58

    Part A — kill surviving mutants (run as 4 parallel PRs, each "Part of #290")

    • Stream 1 — writer.go: 516 ARITHMETIC_BASE · 610 CB · 621 ARITHMETIC_BASE · 621 INVERT_NEGATIVES · 699 CB · 731 CB · 1017 CB · 1022 CB · 1023 CB
    • Stream 2 — reader.go/replication.go/iterator.go: reader 266·269·286·459 CB, 111 CONDITIONALS_NEGATION (timeout); replication 215 CB·219 CB·251 ARITHMETIC_BASE; iterator 102·108 CB
    • Stream 3 — scattered: b2.go 774·901 CB; sync/sync.go 298·351 CB, 266 INCREMENT_DECREMENT (timeout); monitor.go 226 CB; backend.go 101 INCREMENT_DECREMENT; compose.go 274 CB; copy.go 162 ARITHMETIC_BASE; progress.go 49 CB
    • Stream 4 — base/base.go (26): 189·192·238·741·820·830·883×2·931·943·1047·1198×2·1417·1559·1844·1847·1873×3·1877·1949×3·1954×2

    Part B — cover untested code (separate follow-up PR)

    • b2 (7): lock.go:65 ×3 (likely live-B2-only) · replication.go:26 ×2 · sync/sync.go:414,416
    • base (58): all in base.go — clusters ~614–628, 1013–1146, 2021–2257

    Each new test proves break-per-claim (revert the line → test fails); equivalent mutants are annotated and skipped — 100% is not the goal.

  7. modified the milestones: 0.10.0, 0.11.0 on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

testingTests, test coverage and test infrastructure

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions