Modules
Fast mutation testing for Elixir.
What mix juggernaut.advise says about a recorded run (design notes §3, §10.8), from data
Juggernaut already keeps: the run's results (each mutant's selection), the coverage
index (who hit each site, Juggernaut.Coverage.Index), the warm/fresh pairs of its
boot set (Juggernaut.WarmSafe.pairs/2) and the tags the test files carry.
The tags each test file declares, read from its source without running it, for
mix juggernaut.advise (Juggernaut.Advise): @moduletag, @describetag and @tag
values (an atom, a list of atoms, or key: value with a truthy value), plus the tags of
each case template the file uses that is defined under the test paths (a
Juggernaut.IntegrationCase whose using block sets @moduletag :fixture, say).
Runs a Juggernaut.CLI.Task: parses argv, prints --help, executes, reports errors
and returns the exit code (design notes §3).
Exit codes shared by every mix juggernaut* task (see the
agent output guide).
What the analysis tasks read before they call a view (design notes §3, §11): a recorded run from the store, and the view options a run does not hold (the configured thresholds and timeout scoring, the source of the mutated files for excerpts, and the test files that exist for the suggested test file).
Argument parsing shared by every mix juggernaut* task (design notes §3).
What mix juggernaut writes while a run goes and when it ends (design notes §5): a pure
reducer over the engine's run events (Juggernaut.View.Stream.event/0).
The behaviour of every mix juggernaut* task (design notes §3, §14).
The per-mutant result cache (design notes §7.3, _build/juggernaut/cache/results/):
a mutant's result from an earlier run, reused while nothing that decided it changed.
Function hashes, and the footprint a cached result rests on (design notes §7.3).
The result cache on disk (design notes §7.3): one compact JSON file per mutated source file, under a directory named for the cache's globals.
Whether the tests were weakened since a cached result was recorded (design notes §7.3),
from the patch of the test paths and config/ between the entry's commit and the
working tree (untracked files read as added lines).
Compares two sides mutant by mutant (mix juggernaut.compare, design notes §3): two
recorded runs, or an imported report (Juggernaut.Import.MTE, the baseline A) and a run
(B).
The validated configuration of one project (see the configuration guide).
Reads and checks .juggernaut.exs (see the configuration guide).
Converts a Mutare 0.5.1 .mutare.exs to Juggernaut configuration (design notes §3,
mix juggernaut.install --from-mutare).
The NimbleOptions schema of .juggernaut.exs (see the configuration guide).
Coverage for a run (design notes §10.5): which tests each mutant runs.
The coverage index (design notes §10.5, _build/juggernaut/coverage/index.etf): what
each probed test file hit, kept between runs so that a run probes only the test files
whose coverage may have changed.
The coverage probe (design notes §10.5): every test file run once on the warm pool with the switch in probe mode, to learn which tests run each site.
Which tests a mutant runs, from the probe's labels (design notes §10.5).
Where a site is in the original text, and the mutant as a patch of that text
(design notes §6, docs/dependencies/sourceror.md).
One mutation run from end to end (design notes §10.1), and check/1 of named mutants.
What a run records about the checkout it ran in (design notes §7.2): the commit, whether the tree was dirty, and a hash of the dirt.
The reconfirmation of core survivors (design notes §10.8), in the gate and release lanes once the main jobs have run.
The validated request of Juggernaut.Engine.run/1 and Juggernaut.Engine.check/1.
What a run takes from earlier work and leaves for later runs (design notes §7.3, §7.4):
triage claims and the per-mutant result cache, as Juggernaut.Engine uses them.
An error that stops a task before or instead of a verdict.
How an infrastructure error says why tests failed, not only which: the first failing
outcome's failure message (Juggernaut.Peer.Formatter's failure), its whitespace
collapsed and cut at 300 characters, so the error fits on one line and the cause needs
no rerun by hand.
Ignore comments (design notes §8.3): Mutare's grammar under each configured prefix
(default juggernaut:ignore and mutare:ignore).
One parsed ignore directive (Juggernaut.Ignore): its prefix, scope, the lines it
covers (first for a line directive, first..last for a region, all for a file), its
filter (nil for none, else {family, label | nil} items) and reason.
Reads a mutation-testing-elements report (Mutare 0.5.1, Stryker, or our own export) as
one side of a comparison (mix juggernaut.compare --mutare, design notes §3;
deps:mutation-testing-elements).
The file edits behind mix juggernaut.install (design notes §3), as pure functions of
file contents, so they are tested without Igniter and the installer stays a thin layer
over them. Each edit detects its own earlier application, which keeps the installer
idempotent.
One replacement at one site (design notes §6, §14.1).
Canonical mutant keys and short ids (design notes §6).
Turns one source file into its mutants (design notes §6, §8, §10.1 step 3).
Helpers over Sourceror's AST (docs/dependencies/sourceror.md).
Resolves a call site to {module, function, arguments} and rebuilds it in the form it
was written.
What an operator knows about the site it is offered (design notes §8.1).
Finds the modules of a parsed file and what the walk needs to know about each one:
its aliases, imports, local functions, whether it is a GenServer, its function
clauses in source order, the module-body expressions that run at compile time, and its
context: every module-body expression other than a function clause, a nested module
or a documentation attribute (what a function's behaviour may depend on besides its
own clauses: use, import, alias, attributes, defstruct), which
Juggernaut.Cache.Footprint hashes with each function.
Return paths of a function body, for the return_value family.
Walks one function clause (or one compile-time module-body expression) and lists its
sites: every node an operator may be offered, with its AST path and its
Juggernaut.Mutator.Context.
The behaviour of an operator family (design notes §8.1).
A module alias used as a value → Juggernaut.Sentinel, a module that does not exist
(Mutare alias). Never a call target, a struct name, a directive argument or a
rescue type (the walk does not offer those).
+↔-, *↔/, div↔rem, and unary -x→x (Mutare arithmetic).
A literal atom → :juggernaut (Mutare atom).
A non-empty bitstring constructor <<...>> → <<>> (Mutare bitstring). Not an
interpolated string, not sigil contents, not in patterns.
The encoding of a bitstring segment (Mutare bitstring_spec): utf8, utf16 and
utf32 → each other encoding (endianness dropped for utf8), and for utf16/utf32
big↔little (a bare one gets little). Runtime constructors only.
&&&↔||| (band↔bor), <<<↔>>> (bsl↔bsr) and ~~~x→x (bnot)
(Mutare bitwise). A shift by a literal 0 is left alone. Variants name the new
operator in its symbolic form.
true↔false literals (Mutare boolean).
Replaces a type-preserving transform call with its first argument (Mutare
call_removal); a pipe stage is removed (xs |> Enum.sort() → xs).
The names and categories of the 47 operator families, as Mutare 0.5.1 names them
(docs/research/mutare-operators.md).
A ~c or ~C charlist → ~c"" (empty) and ~c"juggernaut" (sentinel); a plain
'...' charlist gets only the sentinel (list makes the empty one) (Mutare
charlist).
Removes one body-bearing clause of a def or defp that has at least two (Mutare
clause_drop), so its inputs fall through to a later clause. A bodiless head is never
removed.
Renames a collection call to its complement, arity kept (Mutare collection):
filter↔reject, all?↔any?, min↔max, min_by↔max_by, take↔drop (and
their _while and _every forms), sum↔product on Enum; filter↔reject and
take↔drop on Map, Keyword and Stream; first↔last and foldl↔foldr on
List; filter↔reject on MapSet.
Replaces a collection call with a related call of another arity (Mutare
collection_arity): Enum.sort/1,2 and Enum.sort_by/2,3 → Enum.reverse/1,
Enum.reverse/1 → Enum.sort/1, Enum.count/2 → Enum.count/1,
Enum.count_until/3 → Enum.count_until/2, Access.get_and_update/3 → Access.get/2.
A boolean-valued comparison, membership or connective expression → true and false
(Mutare conditional).
Swaps convention atoms for their counterpart (Mutare convention): a tuple tagged
:ok↔:error or :cont↔:halt, and a bare :lt↔:gt. Also in patterns.
A date or time sigil moved by one unit (Mutare datetime): ~D, ~N and ~U by one
day, ~T by one second. A value that cannot move forward (the year 9999) moves back.
A sigil whose contents do not parse is left alone.
Drops a trailing optional argument so that its default applies (Mutare
default_drop): Map, Keyword and Access get/3, Map and Keyword pop/3,
Enum.at/3, List.keyfind/4; the _lazy forms become the plain ones without the
function; Float.round/2, Float.ceil/2, Float.floor/2, Integer.to_string/2,
Integer.parse/2, Integer.digits/2, Enum.join/2, String.pad_leading/3,
String.pad_trailing/3, String.trim/2, String.trim_leading/2 and
String.trim_trailing/2.
Skipped when the argument already is the default literal.
A float literal x → x + 1.0, x - 1.0 and 0.0 (Mutare float).
Turns a GenServer callback's return into another valid one (Mutare genserver), in
handle_call/3, handle_cast/2, handle_info/2 and handle_continue/2 of a module
that uses or declares GenServer: {:reply, r, s} → {:noreply, s};
{:noreply, s} → {:stop, :normal, s}; {:stop, reason, s} → {:noreply, s};
{:stop, reason, reply, s} → {:reply, reply, s}. A trailing timeout or continue
element is kept with :noreply.
Removes the when guard of a function head or a single-pattern clause (Mutare
guard_drop): def, defp, case, receive, fn and generators.
Building blocks shared by the operator families: operator swaps, table-driven call renames and literal replacements.
The condition of an if, unless or cond clause → true and false (Mutare
if_condition).
An integer literal n → n + 1, n - 1 and 0, without duplicates (Mutare
integer). Timeout and duration arguments of known calls are left alone.
Integer.mod↔Integer.floor_div and Integer.is_even↔Integer.is_odd (Mutare
integer_call). Also in guards.
Keyword.delete/2↔Keyword.delete_first/2 (Mutare keyword_delete).
++↔--, and a non-empty list literal → [] (empty) (Mutare list). A charlist
literal counts as a list. The collapse is not made on the right of in in a guard.
and↔or, &&↔||, not x→x and !x→x (Mutare logical).
A non-empty map literal → %{} (Mutare map). Not a map update (%{m | k: v}), not
a struct's fields, not in a pattern or on the right of in.
MapSet.union↔MapSet.intersection (Mutare map_set).
Erlang :math swaps (Mutare math): pi() → 3.0, tau() → 6.0, sin↔cos,
asin↔acos, sinh↔cosh, asinh↔acosh, and log, log2, log10 to each of
the other two.
Swaps a mode or unit atom argument of a standard-library call for its neighbours in
an ordered set (Mutare mode_swap, a reduced set): time units (:second,
:millisecond, :microsecond, :nanosecond) in System clocks and conversions,
DateTime/NaiveDateTime/Time add, diff, truncate, to_unix, from_unix
and utc_now, and :asc↔:desc in Enum.sort/2 and Enum.sort_by/3. At most two
replacements per argument (the neighbours).
Numeric function pairs (Mutare numeric): min↔max, round↔trunc,
ceil↔floor (Kernel, also in guards), Float.ceil↔Float.floor,
Float.max_finite↔Float.min_finite.
Reverses the first two operands of a non-commutative operation (Mutare
operand_swap): -, /, **, <>, ++, --, div, rem, and the order-sensitive
calls before?, after?, compare and diff of Date, Time, DateTime and
NaiveDateTime, Version.compare/2, MapSet.difference/2 and MapSet.subset?/2.
Identical operands are skipped. A piped call swaps the piped value too.
Exchanges two variables of different names inside a pattern container (Mutare
pattern_swap): the elements of a tuple or list, or the values of a map or keyword
list. One mutant per pair. _ and _name variables are not moved, nor are pinned
ones; keys stay in place. A whole argument list is not a container.
A variable bound more than once in one pattern → _ at one occurrence, removing the
equality constraint (Mutare pattern_wildcard). One mutant per occurrence.
Swaps the start and end of a period (Mutare period_boundary):
Date.beginning_of_month↔end_of_month, Date.beginning_of_week↔end_of_week,
NaiveDateTime.beginning_of_day↔end_of_day.
Mutates a non-interpolated ~r sigil (Mutare regex, a reduced set). Each change is
its own mutant, labelled with Mutare's variants
The operator family modules, one per name in Juggernaut.Operators.Catalog, in
registry order (design notes §8.1). A family :string_call is the module
Juggernaut.Operators.StringCall.
Comparison boundaries and reversals (Mutare relational): >→>=,<;
>=→>,<=; <→<=,>; <=→<,>=; ==↔!=; ===↔!==; in→not in.
Variants name the new operator (in→not in has none).
Narrows what a rescue catches (Mutare rescue_type): e in [A, B] → e in A and
e in B, and one of several rescue clauses removed.
Replaces each return path of a def, defp or fn clause with a constant of its
shape (Mutare return_value)
===→== and !==→!=, one way (Mutare strict_equality): tests whether the
integer/float distinction matters.
A string literal, plain or interpolated → "" (empty) and "juggernaut"
(sentinel) (Mutare string). In a pattern only the sentinel is made, and only for a
plain string. A replacement equal to the original is omitted.
String.length(s) → byte_size(s), one way (Mutare string_byte): shows whether
non-ASCII input is tested.
Renames a string call to its mirror (Mutare string_call): on String,
starts_with?↔ends_with?, upcase↔downcase, trim_leading↔trim_trailing,
replace_prefix↔replace_suffix, replace_leading↔replace_trailing,
pad_leading↔pad_trailing, first↔last, graphemes↔codepoints; on :string,
uppercase↔lowercase; on :binary, first↔last. String.equivalent?(a, b)
becomes a == b.
A ~s or ~S sigil → "" (empty) and "juggernaut" (sentinel) (Mutare
string_sigil).
before?↔after? on Date, Time, DateTime and NaiveDateTime (Mutare
temporal_order).
A non-empty tuple literal → {} (Mutare tuple). Not in patterns, and not in the
pattern of a match?/2 when the tuple binds a variable: match?({:ok, info} when ok?(info), x) with {} leaves info unbound in the guard, so the mutant would not
compile.
A non-interpolated ~w or ~W word list → ~w() (empty) and ~w(juggernaut)
(sentinel), modifiers kept (Mutare word_list). The empty one is not made on the
right of in in a guard.
Maps over a collection a scheduler each at once, for work on files (reading, parsing, writing) whose results do not depend on their order.
Boots a worker: run once inside a fresh :peer, before any job (design notes §10.5).
Which of the project's functions a job executed (design notes §7.3): the footprint a cached kill rests on.
The ExUnit formatter of a worker's jobs (design notes §10.5): it prints nothing and sends each finished test, as a small map, to the process that runs the job.
The health check a worker runs after every job (design notes §10.5, plan I18): a fingerprint of the VM's shared state taken after boot, compared with one taken after the job. Any difference is drift, and the worker is recycled after it reports the job's result, so one job's leftovers never reach the next.
The coverage recorder of a worker (design notes §10.5): which sites run, and on behalf of which test.
Hot loading in a warm worker after the sandbox was compiled again (design notes §10.9): the server's pool outlives a run, so before the next run's jobs every loaded module whose beam under the sandbox changed is loaded again.
Runs one job in a booted worker (design notes §10.5): the selected tests, with one switch on, through ExUnit again in the same VM.
The state a job may change and a worker puts back after it (design notes §10.5, plan
I18): the environment of every loaded application, the OS environment, and the
:persistent_term keys the project owns.
The runtime switch that compiled metamutants read (design notes §10.3).
One timed phase of a run (design notes §10.1, §15). started_ms is milliseconds since
the run started.
Resolves a run's scope to files and lines, and turns them into the run's mutants (design notes §3, §10.1 steps 2-3).
The git queries the planner needs, run in the project root through a runner function
(run/2 by default; tests pass their own). Paths are relative to the project root
(--relative), so a project in a subdirectory of its repository works.
Path globs as Path.wildcard/2 reads them, matched against a relative path without
touching the file system: ** matches any number of directories, * and ? stay
within one path segment, {a,b} is an alternation and [ab], [a,b] or [a-z] match
one listed character (a comma is listed too, a - at either end is literal, nothing
negates). A glob without wildcards matches the path itself and anything under it when
it names a directory (lib/core).
Changed lines from git diff -U0 output, and which function clauses they touch
(design notes §3 --since, plan I11).
The warm pool: a supervisor of Juggernaut.Pool.Workers, one :peer each, all booted
in the sandbox at once (design notes §10.5).
The sharded baseline (design notes §10.5, plan I19): the needed tests, every mutant off, split across the workers so that every worker runs at least one shard. It proves each worker (its partition, its database, its loaded tests) before any mutant runs on it, and records each test's duration for scheduling.
What a worker's :peer is started with, as pure functions (design notes §10.5).
An IO device that keeps only the end of what is written to it.
A primary :logger filter in the controller that drops the termination reports of
:peer control processes.
One warm worker: a GenServer that owns a :peer node booted in the sandbox and runs
jobs in it, one at a time (design notes §10.5).
Writes the HTML dashboard of recorded runs (mix juggernaut.report, design notes §3,
§11): reads the selected run, the run recorded before it and the history, builds the
data document (Juggernaut.Report.Data) and writes the page (Juggernaut.Report.Html)
atomically.
The dashboard's stylesheet and script (Juggernaut.Report.Html), kept as plain files
next to this module (assets/report.css, assets/report.js) and read at compile time,
so the page needs nothing at run time and the package ships them inside the beam.
The code map's data (design notes §11): the run's files, each with its functions, and
for each the mutants counted by how they ended. density is the share of scored
mutants listed as survivors (survived, not covered, or a timeout scored as survived),
nil when nothing there was scored; the page colours by it. A file's score is the
one its run recorded (nil when the summary has none).
The data document the HTML dashboard embeds (mix juggernaut.report, design notes §11).
The dashboard page (mix juggernaut.report, design notes §11): one HTML file holding its
styles, its script and its data (Juggernaut.Report.Data) inline. A Content Security
Policy forbids every network request, so the page works offline and leaks nothing.
The overview page's data (design notes §11): the recorded verdict, each gate rule with the recorded score it was judged on and whether the run's recorded failures name it, the counts and kill kinds, the survivors with the new ones first, the mutants killed only by integration tests, new ignores, triage claims, reuse and the wall time.
The test effectiveness page's data (design notes §11), from the mutant jobs this run
ran (a selection other than none, not reused: Juggernaut.Report.Data.job?/1).
Trends over the recorded history (design notes §7.2, §11): one point per history record,
oldest first, as recorded. A field that is missing or of the wrong type is nil (shown
as a gap), so one odd record never stops the page, as in mix juggernaut.history.
What happened to one mutant in one run (design notes §10.7, §14.1).
Raw, skipped and arid calls (design notes §8.2, §8.4).
One mutation run: what was asked, where, by whom, and what happened (design notes §14.1).
Runs scheduled jobs on the warm pool and turns each into a Juggernaut.Result
(design notes §10.6-§10.8).
The boot lane (design notes §10.8): a mutant whose site runs while the app starts or the tests load is tested on a fresh worker booted with that mutant already on, since no job on a warm worker runs that code again.
What one job's result says about its mutant (design notes §10.7): a status and, for a kill, its kind and the killing test.
Turns each mutant's selection into a job and orders the jobs (design notes §10.6, §10.7). Pure: the durations come from the baseline, the previous killers from the last run.
The persistent mirror of the project that mutants are compiled and run in
(design notes §10.2): _build/juggernaut/sandbox/, a Mix project of its own with its
own _build/test, at a stable path so Mix stays incremental.
The sandbox's copy of mix.exs (design notes §10.2): the project's file with every
relative path: given as a string literal (path dependencies such as
{:juggernaut, path: "../.."}) made absolute against the project root, because the
sandbox lives at another depth. Everything else is copied as written; a path computed
at run time is left alone.
Mirrors a directory into the sandbox incrementally (design notes §10.2).
Metamutant schemata (design notes §10.3, §10.4): every mutant of a run compiled once,
each turned on by its switch (Juggernaut.Peer.Switch).
Poison isolation's fallback (design notes §10.4): when the span map cannot pin a file's errors on mutants within its rounds, the file's mutants are compiled in groups until each poisoned one is found, so the mutants that compile stay switched.
Compiles the sandbox incrementally with Mix, in a subprocess, and returns Mix's
diagnostics as data (design notes §10.3, docs/dependencies/mix-compile.md).
Lifted dispatch for mutants a case cannot stand in for: patterns, guards, dropped
clauses, pipe stages (design notes §10.3).
Poison isolation (design notes §10.4): after a failed sandbox compile, finds the mutants that broke it and takes them out, so one bad mutant never blocks the run.
Decides how each mutant is switched in its metamutant (design notes §10.3)
Source text addressed by byte offset, and the edit tree a metamutant is rendered from (design notes §10.3, §10.4).
One file's metamutant (design notes §10.3, §10.4): its live mutants, how each is
switched (Juggernaut.Schemata.Site), the lifted functions
(Juggernaut.Schemata.Lift), the mutants taken out (with the reason) and the rendered
source with its span map.
The warm daemon of one checkout (mix juggernaut.server, design notes §12): one pool of
workers kept between runs, a FIFO queue of jobs, and a socket clients attach to.
The client side of mix juggernaut.server (design notes §12): finds the server of a
checkout from server/server.json and server/token, sends one request and relays the
frames that come back.
The frames between mix juggernaut.server and its clients (design notes §12): JSON
documents in {:packet, 4} frames over a TCP socket on 127.0.0.1. A frame is only
ever decoded as JSON (never :erlang.binary_to_term/1), and every request carries the
server's token, compared in constant time.
The server's job queue (design notes §12): first in, first out, one job running at a time. Pure: the server keeps it in its state.
The Mix shell while mix juggernaut.server runs: what a task prints with Mix.shell/0
goes to the client whose job runs in the calling process (sink/1), so an attached run
prints exactly what a standalone one does. Outside a job it is the shell that was in
place when the server started (install/0), usually Mix.Shell.IO.
The files Juggernaut keeps under _build/juggernaut/ (design notes §7).
Encodes the structs of design notes §14.1 as JSON-ready maps with string keys, and decodes them back.
The append-only run history, history/runs.ndjson (design notes §7.2).
The layout of _build/juggernaut/ and its version (design notes §7).
The checkout lock, _build/juggernaut/lock (design notes §7.1): one mutation run per
checkout.
Whole runs on disk: runs/<run_id>/run.json and runs/<run_id>/mutants.ndjson
(design notes §7).
The scored outcome of a run (design notes §10.7, §14.1).
The :telemetry events Juggernaut emits. Names and metadata keys are a public API: a
rename is a breaking change.
The test lanes of a project (test_lanes in .juggernaut.exs, design notes §10.6):
which of its tests are integration tests, and the timeouts each lane is held to.
One ExUnit test, as recorded for a mutant (design notes §14.1).
The committed triage file, .juggernaut.triage.json (design notes §7.4): claims that a
mutant is equivalent (no test can tell it from the original), each with its reason,
who made it and the hash of the mutated function when it was made.
The gate (design notes §10.7): a run's counts, scores and verdict from its mutants and results.
The output formats of a run (design notes §5, §11) and the pieces they share.
mix juggernaut.advise for people (:human) and for agents (:agent, one JSON
document, "kind": "advise"), from Juggernaut.Advise.analyse/2, and the result of
--verify (verified/2).
The agent format (--format agent, see the agent output guide): one
compact JSON document, format 1, summary first, then one page of survivors, then where
the page sits.
A comparison (Juggernaut.Compare) for people, agents and pull requests
(mix juggernaut.compare, design notes §3): how the sides were paired, the blocking
class first (killed in A, not killed in B, on core), every other status change, the
counts, both score formulas, and the time each side took: measured wall and phase
clocks, and the recorded per-mutant durations of the mutants both sides ran.
The mutant inventory of mix juggernaut --dry-run (design notes §3): counts by file and
by operator, ignored mutants, compile-time sites that are not mutated, and the ignore
and routing warnings.
One mutant of a run in full (mix juggernaut.explain, see the
agent output guide): where it is, what changed (diff and source
excerpt), its status and kill kind, the test that killed it (file:line) or the tests
that ran and passed, why those tests were selected, the nearest miss, any ignore
comment or triage claim, where a reused result came from, the control rerun and its
duration.
The GitHub Actions format (--format github, design notes §5.4): one workflow-command
annotation per survivor, then the run summary as one annotation.
The run history (mix juggernaut.history, design notes §3, §7.2): one row per recorded
run, newest first, then trends over the runs shown, oldest to newest, as sparklines of
the score, the mutant count, the wall time and the results reused.
The human format (design notes §5.1): survivors, each with its diff, the tests that ran
and how to re-check it, then a summary with the counts, scores against the thresholds,
the measured phase times, the recorded time of reused results, new ignores, triage
claims and the gate verdict with the rules that failed. A Lanes row names the mutants
killed only by integration tests (Juggernaut.View.integration_only/2), when there are
any.
JSON encoding for the machine formats (design notes §5.2).
The human view of a run as it goes (design notes §5.1): a quiet progress line, each survivor printed as soon as it is found, then the summary.
The mutation-testing-elements report (--format json, design notes §5.4), schema
version 2, the format Stryker and Mutare write (deps:mutation-testing-elements).
The markdown format (--format markdown, design notes §5.4), for pull requests, CI step
summaries and release notes: a summary table, the failed rules, the score of each file,
one page of survivors grouped by file with their diffs, the mutants killed only by
integration tests (when there are any), and the measured timings.
Where a run's time went (mix juggernaut.profile, design notes §3): the phase clocks,
the duration of mutant jobs by test selection (p50, p90, p99, max), the fallbacks to a
whole file, the whole suite or the boot lane and the functions that caused them, the
tests that cost the most across mutant jobs, worker utilisation and recycles, the
results reused (recorded time), the selection misses found by reconfirmation, and the
boot set: how many of its mutants a warm worker killed (strikes for the boot lane), how
many the boot lane ran and how many of those a strike killed, at what concurrency and
why (as the run recorded it, Juggernaut.Run).
The NDJSON event stream (--stream, see the agent output guide),
format 1: one compact JSON object per line, each with v, event, run_id and t_ms
(milliseconds since the run started) first.
The survivors of a run, grouped (mix juggernaut.survivors, design notes §3): the
mutants Juggernaut.View.survivors/2 lists (survived, not covered, and timeouts when
they are scored as survived), grouped by file, module or operator.
Warm-safe declarations (design notes §10.8, §7.5): the committed file
.juggernaut.warm_safe.json, in which a person says that the boot-set mutants of a
function may be settled on a warm worker instead of a fresh boot each.
--watch (design notes §12): polls the modification times and sizes of the files under
paths, test_paths and config/ every 500 ms (no file-system dependency), waits until
a change has been still for 300 ms, then asks the server for an inner-lane run of what
changed (mix juggernaut --lane inner: the clauses changed since base, uncommitted
work included).
Mix Tasks
Runs mutation testing and gates on the result.
Advice on a recorded run, from the probe data Juggernaut already keeps.
Re-runs the named mutants now, usually after adding a test.
Pairs the mutants of two runs by their stable key and reports status changes (the blocking class, killed in A and not killed in B on core code, whatever B's status, first), counts, scores, phase clock deltas and per-mutant duration deltas.
Shows one mutant from a run: location, operator and variant, unified diff, function
source excerpt, status and kill kind, the killing test (file:line) or the tests that
ran and passed, the selection reason, the nearest miss, any ignore or triage entry,
where a reused result came from, and its duration.
One row per recorded run, newest first: id, date, actor, lane, scope, commit (and whether the tree was dirty), mutants, score, verdict, wall time, and the results reused from earlier runs with their recorded time. Then trends over the runs shown, oldest to newest, as sparklines (score, mutants, wall time, reused results). History lines this version cannot read are listed, never fatal.
Sets a project up for Juggernaut.
Where a run's time went: phase clocks; per-mutant duration percentiles (p50, p90, p99, max) by test selection; fallbacks to a whole file, the whole suite or the boot lane and the functions that caused them; the tests that cost the most across mutant jobs; worker utilisation and recycles; results reused and their recorded time; selection misses found by cold reconfirmation. Durations are measured by the run; reused results are counted apart, with the time recorded by the run they came from.
Writes one HTML file with the dashboard of recorded runs. Pages
Starts the single warm daemon for this checkout: one pool of test workers and a job
queue. mix juggernaut and mix juggernaut.check attach to it when it is reachable
(unless given --no-server), which skips booting workers for each run.
Lists the survivors (and NoCoverage mutants) of a recorded run, core first. It reports;
it does not gate. When more survivors exist than fit on the page, the output says so and
names the command for the next page (the agent document's page.next): nothing is
silently cut. Timeouts count as survivors when the run was scored with
timeouts: :survived, as in its gate (a run recorded before the setting was kept uses
.juggernaut.exs as it is now). With --format github every survivor is printed as an
annotation (no grouping or paging).
Manages the committed triage file, .juggernaut.triage.json.