Muex.Mutator.StatementDeletion (Muex v0.8.1)

View Source

Mutator that removes individual statements from blocks.

Targets __block__ nodes with two or more statements. For each non-final statement, produces a mutation that deletes it from the block. The final statement (the return value) is left to the ReturnValue mutator.

This is one of the highest-value mutation operators: if deleting a statement doesn't cause any test to fail, that statement is either dead code or untested side-effect logic.

Module attributes are not mutated

A defmodule body is itself a __block__, so without a guard this mutator would delete @moduledoc / @doc / @spec / @type / @behaviour / constant attributes. Deleting a non-executable attribute (docs, specs, types) has no runtime effect, so it can never be caught by a test — it only manufactures unkillable survivors that drag the score down without pointing at a real coverage gap. Deleting a used constant attribute (@timeout 5_000) just yields a guaranteed compile error (an "invalid" mutant). Neither is a meaningful test-quality signal, so @-attribute statements are skipped entirely.