API Reference mutagen_ex v#0.2.0

Copy Markdown View Source

Modules

OTP Application callback for :mutagen_ex.

Canonical shared AST helpers for the mutagen pipeline.

Immutable cache of {quoted_ast, source_text} tuples for the in-scope source files of a mix mutagen run.

Pre-mutation test pass: do the cited tests pass on unmodified code?

Per-run .beam snapshot store for MutagenEx.MutationRunner.

Pure command-line argument parser for mix mutagen.

Parsed, validated configuration for a single mix mutagen invocation.

Runs the cited test suite once under :cover to determine which source lines those tests exercise.

Reads changed source lines against a Git merge-base and reads blobs from it.

Canonicalisation and safety checks for --json <path>.

Single owner of the version 2 JSON output document for mix mutagen.

In-memory shape the pipeline assembles before the JSON reporter serialises it.

Truncation + redaction of free-form text that flows into the version 2 JSON document (warnings, compile-error messages, abort-detail messages, and any other string field that captures user-code-derived bytes).

Per-site NDJSON line emitter for mix mutagen --stream.

Walks the in-scope ASTs from the AST cache and produces a deterministic, ordered list of %MutagenEx.MutationEnumerator.Site{} records, plus a parallel skipped list and a warnings list.

Per-mutation execution: swap → run → classify → restore. Aggregates the per-site outcomes into a result block the JSON reporter (S6) can serialise.

Registry and behaviour for the ten v1 mutators.

Swaps numeric binary operators: + ↔ -, * ↔ /.

Swaps boolean operators and drops boolean negations: and ↔ or, && ↔ ||, not x → x, !x → x.

Drops the last clause of a case or cond expression.

Swaps comparison operators: == ↔ !=, < ↔ >=, > ↔ <=.

Static, order-preserving head-atom dispatch table for the mutator catalog.

Removes the else branch from an if or with expression.

Drops the guard from a function clause head.

Flips true ↔ false and swaps small integer literals: 0 ↔ 1, 1 ↔ 0, -1 → 1.

Reorders two adjacent |> segments.

Flips {:ok, x} and {:error, x} tagged tuples.

Reorders the first two <- clauses of a with expression.

Behaviour for the :ast_cache slot of the Mix.Tasks.Mutagen dispatch table.

Behaviour for the :baseline slot of the Mix.Tasks.Mutagen dispatch table.

Behaviour for the :cli slot of the Mix.Tasks.Mutagen dispatch table.

Behaviour for the :coverage slot of the Mix.Tasks.Mutagen dispatch table.

Writes the report to the selected destination and halts with the pipeline's exit code.

Behaviour for the :enumerator slot of the Mix.Tasks.Mutagen dispatch table.

Behaviour for the :io slot of the Mix.Tasks.Mutagen dispatch table.

Behaviour for the :mutation slot of the Mix.Tasks.Mutagen dispatch table.

Behaviour for the :reporter_error slot of the Mix.Tasks.Mutagen dispatch table.

Behaviour for the :reporter_ok slot of the Mix.Tasks.Mutagen dispatch table.

Behaviour for the :scope slot of the Mix.Tasks.Mutagen dispatch table.

Behaviour for the :tests slot of the Mix.Tasks.Mutagen dispatch table.

Human-readable per-site progress feedback written to stderr.

Prepares a host Mix project and its ExUnit environment for an in-process run.

Resolves user-supplied --scope targets into concrete %MutagenEx.ScopeResolver.Scope{} records describing the file, line range, and module each target points at.

A resolved scope record. file is relative to the project root. line_range is an inclusive range of source lines, and module is the resolved module atom. MFA targets also carry a {name, arity} selector.

Default MutagenEx.Test.CaptureIoFacade implementation — thin wrapper over ExUnit.CaptureIO.

Behaviour for the ExUnit.CaptureIO test seam used by MutagenEx.MutationRunner (around the swap-compile call) and MutagenEx.MutationRunner.MutationLoop (around the per-site test run, to absorb compiler warnings and any other stderr emitted during the mutation cycle).

Production implementation of MutagenEx.Test.CodeServerFacade — a thin pass-through to the :code module.

Behaviour for the :code module seam used by MutagenEx.BeamCache.

Default MutagenEx.Test.CompilerFacade implementation — thin wrapper over Code.compile_quoted/2.

Behaviour for the Code compile-quoted test seam used by MutagenEx.MutationRunner.

Default MutagenEx.Test.CoverFacade implementation — thin wrapper over Erlang's :cover module.

Behaviour for the OTP :cover test seam used by MutagenEx.CoverageRunner.

Default MutagenEx.Test.ExUnitFacade implementation — thin wrapper over the real ExUnit module.

Behaviour for the ExUnit test seam used by MutagenEx.Baseline, MutagenEx.CoverageRunner, MutagenEx.MutationRunner, and MutagenEx.MutationRunner.MutationLoop.

Default MutagenEx.Test.ExUnitServerFacade implementation — thin wrapper over ExUnit.Server.

Behaviour for the ExUnit.Server test seam used by MutagenEx.MutationRunner.MutationLoop.

Finds loaded ExUnit cases in the cited test files.

Resolves user-supplied --tests targets into the {include, exclude, files} shape ExUnit's filter system expects.

The resolved ExUnit-shaped filter.

Shared type definitions used across the mutagen_ex pipeline.

Mix Tasks