a mutant that breaks the build (warnings_as_errors, an unused helper) kills no test and can read as a kill #113

Open
opened 2026-11-24 01:11:56 +00:00 by juno · 0 comments
Member

Purpose (method): a mutant that breaks the build rather than a test is recorded as a kill when it killed nothing, so a blind test can pass a hand-off on the strength of a compile error.

The class. Erlang repositories here set {erl_opts, [debug_info, warnings_as_errors]} in rebar.config. A mutant written by removing a whole call — the natural way to say "the fix is not there" — can leave the helper it called defined and unused. warnings_as_errors turns that into a compile error, so rebar3 eunit exits non-zero without running a single test. Anyone reading only "the suite went red under the mutant" records a kill; nothing in the output names a test, so the guard the mutant was meant to exercise was never exercised.

Instance 1 — mcl-mail#12, M1 "restore the blind write". The mutant replaced projected(get_doc(doc_id(CitizenDid, LetterId)), Doc). with put(Doc). in mailboxes_read_model:upsert_deposited/2. Build output: function projected/2 is unused at mailboxes_read_model.erl:87, rc=1, no failing test named. Re-expressed on the guard's own clause, keeping the clause terminator: projected({ok, _Held}, Doc) -> put(Doc); (a first attempt that ended the clause with . instead of ; failed differently: function projected/2 already defined). It then killed two named tests — the new a_replayed_deposit_for_an_existing_letter_leaves_it_as_it_was/1 and a_restart_does_not_take_away_the_grace_read/1 — both with {badmatch,{error,conflict}}.

Instance 2 — mcl-stations#1, M1 "the read half of the read-modify-write". The mutant replaced Project(Record, lookup(Id)) with Project(Record, undefined) in station_store:store/2, leaving lookup/1 unused: compile error, rc=1, no failing test named. Re-expressed inside the helper instead — lookup/1's hit clause answering undefined — which killed four named tests, including both merge tests (upsert_station_endpoint_leaves_node_record_fields_alone/1, upsert_node_record_leaves_endpoint_fields_alone/1).

Both instances were re-run to a real kill and the source restored byte-identically (cmp); the hand-offs state the re-expression rather than the original wording.

No check is asked for here. "No new checks without Raf's yes" (DECIDED 2026-11-19) stands, and a mechanical guard would need his word naming the harm it prevents. What such a guard could be, for that decision and not as work: a mutant step that requires a *failed* line naming a test (not merely a non-zero exit), or that runs the module's tests unmutated first so the compile is known green before the mutation goes in. In the meantime the cheap practice is to express a mutant inside the guarded expression or on the guard's own clause, so the helper stays used.

Found by Juno (builder) while running the mutants on mcl-mail#12 and mcl-stations#1, 2026-11-24.

Purpose (method): a mutant that breaks the build rather than a test is recorded as a kill when it killed nothing, so a blind test can pass a hand-off on the strength of a compile error. **The class.** Erlang repositories here set `{erl_opts, [debug_info, warnings_as_errors]}` in `rebar.config`. A mutant written by removing a whole call — the natural way to say "the fix is not there" — can leave the helper it called defined and unused. `warnings_as_errors` turns that into a compile error, so `rebar3 eunit` exits non-zero without running a single test. Anyone reading only "the suite went red under the mutant" records a kill; nothing in the output names a test, so the guard the mutant was meant to exercise was never exercised. **Instance 1 — mcl-mail#12, M1 "restore the blind write".** The mutant replaced `projected(get_doc(doc_id(CitizenDid, LetterId)), Doc).` with `put(Doc).` in `mailboxes_read_model:upsert_deposited/2`. Build output: `function projected/2 is unused` at `mailboxes_read_model.erl:87`, rc=1, no failing test named. Re-expressed on the guard's own clause, keeping the clause terminator: `projected({ok, _Held}, Doc) -> put(Doc);` (a first attempt that ended the clause with `.` instead of `;` failed differently: `function projected/2 already defined`). It then killed two named tests — the new `a_replayed_deposit_for_an_existing_letter_leaves_it_as_it_was/1` and `a_restart_does_not_take_away_the_grace_read/1` — both with `{badmatch,{error,conflict}}`. **Instance 2 — mcl-stations#1, M1 "the read half of the read-modify-write".** The mutant replaced `Project(Record, lookup(Id))` with `Project(Record, undefined)` in `station_store:store/2`, leaving `lookup/1` unused: compile error, rc=1, no failing test named. Re-expressed inside the helper instead — `lookup/1`'s hit clause answering `undefined` — which killed four named tests, including both merge tests (`upsert_station_endpoint_leaves_node_record_fields_alone/1`, `upsert_node_record_leaves_endpoint_fields_alone/1`). Both instances were re-run to a real kill and the source restored byte-identically (`cmp`); the hand-offs state the re-expression rather than the original wording. **No check is asked for here.** "No new checks without Raf's yes" (DECIDED 2026-11-19) stands, and a mechanical guard would need his word naming the harm it prevents. What such a guard could be, for that decision and not as work: a mutant step that requires a `*failed*` line naming a test (not merely a non-zero exit), or that runs the module's tests unmutated first so the compile is known green before the mutation goes in. In the meantime the cheap practice is to express a mutant inside the guarded expression or on the guard's own clause, so the helper stays used. Found by Juno (builder) while running the mutants on mcl-mail#12 and mcl-stations#1, 2026-11-24.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
martha-ai/martha#113
No description provided.