Skip to content

v1.5.0

Latest

Choose a tag to compare

@github-actions github-actions released this 02 Dec 15:00
· 16 commits to main since this release
c4316d1

Card changes

  • A suggested test for a condition made always true is named for its edge. For if total >= 30,
    the test of an order below it is loyaltyCreditJustBelowTheTotalEdge, not
    loyaltyCreditWithTotal29, as the other editions name it: the mutant's operands are its
    comparison's sides, total and 30, where they were empty.
  • A suggested test for an XCTest file says to add import Testing. The test a card writes is a
    Swift Testing @Test, and a file that imports only XCTest doesn't build with it pasted in. Its
    place now says so, as the Rust edition's says when a #[cfg(test)] mod tests is to be added:
    // in Tests/PricingTests/PricingTests.swift, adding import Testing.

Scoring changes

  • A catch by a test that depends on its order counts only if the test fails alone with the
    mutant too.
    Swift Testing runs a process's tests side by side, in an order that differs from
    run to run, so a test that fails after another has run (swift-log's, once its global logger is
    set up) failed in some mutants' runs whatever the mutant did: an equivalent mutant read as caught
    about one run in seven. Once the tests are listed, the suite now runs once one test at a time
    with no mutant in, and when tests fail there the run says so: tests depend on order: 23 fail when run one at a time in declaration order (…), so a catch by one of them counts only if it fails alone with the mutant too. A mutant's failure by one of those tests that passes alone
    with the mutant in is dropped; the test isn't named flaky, and its other catches stand. Each
    drop is a line in runs/swift-testing/order.log. Scores can fall where such catches were false;
    a package whose suite passes one at a time runs nothing more.
  • A statement on a line with others after it, { x += 1; return x }, now gets its mutants. Its
    arm took the statement's ; with it, leaving the next statement on the line unseparated, so its
    mutants didn't compile and were skipped as unviable. The ; now stays after the arm. Those
    mutants now run and count, so a score with them can move; in the corpus, swift-collections has
    four, all on one line.
  • A comparison inside a guard that its sides differ is skipped as equivalent, as the Java and
    Rust editions skip it. After guard distance != 0 else { return i }, distance > 0 made
    distance >= 0 differs only when distance is 0, which the guard rules out, so it's skipped with
    its reason (equivalent: differs only when distance is 0. That can't happen because the guard distance != 0 before it rules it out.), and so is any other change to that comparison that
    differs only when its sides are equal. The guard can be the if or guard around or before it,
    the else of an if a == b, an if a == b before it that leaves, an earlier condition of the
    same if, or the left of an && or ||. Each side must be an integer literal, or a whole number
    that can't change: a parameter or a let with its integer type written, bound once, or a let
    stored property. On the corpus it skips 13 mutants in swift-algorithms, 9 in swift-collections
    and 2 in swift-protobuf, none of them caught before.
  • A boundary where both sides give the same value at the edge is skipped as equivalent, as the
    Java and Rust editions skip it. In if x > largest { largest = x }, > made >= stores, at
    x == largest, the value already there, and in a < b ? a : b either side is the same there, so
    the mutant is skipped (equivalent: both sides give the same value at the edge). The comparison
    must be the whole condition of an if or a ?:, deciding one thing: an assignment of one side to
    the other, or one side in each branch. Each side must be an integer literal or a whole number of
    a type the source writes, and the side stored to a local, a parameter or a stored property no
    observer, wrapper or subclass sees written. Swift code mostly calls min and max for this: on
    the corpus it skips none.
  • A comparison of an unsigned value with 0 is skipped as equivalent where it can't differ, as
    the Java and Rust editions skip it. n == 0 made n <= 0, n > 0 made n != 0 and n >= 0
    made always true differ only when n is below 0, which a UInt never is, so each is skipped with
    its reason (equivalent: differs only when n is below 0. That can't happen because `n` is a `UInt`.). The value must be one the source proves unsigned: a type written UInt or UInt8 to
    UInt64 (a parameter, a binding or a stored property), a value made one, UInt(x), or arithmetic
    on those. A collection's count isn't proved: a type of the project's own can give it as it
    likes. On the corpus it skips 15 mutants in swift-collections, 5 in swift-subprocess, 4 in
    swift-nio, 2 each in swift-argument-parser and swift-protobuf, and 1 in swift-service-lifecycle,
    none of them caught before.

Additions

  • mutastic-swift run runs a package's mutants, on Linux. It copies the package, finds its
    sites with the site finder, writes every mutant into the copy and settles the build, runs the
    tests once unmutated, refusing a red baseline, then once with each mutant live, within a limit
    from the baseline's times. It prints a line for each mutant the tests missed and the score, and
    exits 1 below the threshold (--threshold=N, 80 unless set). Tests run with the same hash seed
    every time, so a dictionary's order can't make a mutant look caught. just run [package] builds
    the site finder and the engine and runs it, on the pricing sample unless one is named.
  • mutastic-swift run runs on macOS too. Swift Testing's tests run through Xcode's
    swiftpm-testing-helper, given the bundle's binary, with Xcode's frameworks, private ones too,
    on its paths; XCTest's through xcrun xctest, read from stderr, since the helper asked for XCTest
    exits 0 having run nothing. Xcode is the one xcode-select -p names. A mutant whose run starts
    none of the tests of a library the baseline ran is not run, never missed, on either platform.
    And a run prints a line for each mutant that timed out, as for each it missed.
  • mutastic.yaml, ignores, --only and verify. A run reads mutastic.yaml as every edition
    does, and runs its operators:, or --operators, or the defaults, the Rust edition's where
    Swift has the shape (stronger, extended and all add the rest). A mutant in
    .mutastic/ignores.yaml is skipped with its reason. --only runs some mutants by id, and
    verify says of each whether a test catches it now, passing when every one is. Every other
    command a card offers names itself as still being built.
  • A check of a C call's result is arid. precondition(err == 0, …) after let err = pthread_mutex_init(…) checks that the C library didn't fail, which no test can make it do, so
    its mutants, and the check's own removal, were misses no test could catch: most of swift-log's
    in Locks.swift. They're made and marked arid: only checks a C call's result, and left out of
    the score with the other arid mutants. A C call is told by its shape (a free function named in
    lower case with an underscore, or a few POSIX names), so a check of Swift's own values stays.
    mutastic.yaml names the rule mutastic:c-results, as the other editions do.
  • A run is the core's, as the Rust edition's is. The build, the tests run once with no mutant
    in while the runtime records which mutants each reaches, then each mutant against only the tests
    that reach it, on several workers (--workers, half the cores up to 4 unless set), the check of
    each catch, the records the next run compares with, and the report. A mutant no test reaches is
    "not covered". Pricing runs 14 tests for its 11 mutants, where it ran 33.
  • Every command the other editions have runs on Swift. explain, ignore, next,
    mutants, baseline and gate join run and verify, with every option they take, --shard
    and --from-shards among them. A command that can't find the site finder says where it looked
    and how to build it.
  • --at runs the mutants on some lines. run --at=Sources/Pricing/Pricing.swift:12-13, and
    mutants with it, take the mutants a file's lines hold, as every edition does. A line with none
    is refused, with the nearest lines that have one and the command that lists them; a file outside
    the targets mutastic mutates is named as such.
  • A package that needs an argument to build gets it. What follows -- on the line goes to
    swift build, mutastic run -- -Xswiftc -DPOSTGRES --traits Redis, as do MUTASTIC_BUILD_ARGS
    and mutastic.yaml's build: args: when nothing is typed, the first given used whole. An
    option that fights how mutastic builds, such as -c release, --triple or --scratch-path, is
    refused by name. The commands mutastic offers end in what was typed; a record of a run with other
    arguments is never compared with this one, and shares built with other defines or traits aren't
    put together.
  • A number that only sizes a collection is arid. colors.reserveCapacity(size * size),
    Dictionary(minimumCapacity: n * 2) and Data(capacity: n) store the same elements whatever
    the number, so its mutants, and those of the arithmetic that works it out, were misses no test
    could catch. They're made and marked arid: only sizes a collection's first allocation, the
    rule mutastic.yaml names mutastic:capacity, as the other editions do. Removing the call
    stays counted, as does a number that sizes the contents, Array(repeating:count:)'s.
  • An Xcode project is run. A directory with an .xcodeproj or .xcworkspace and no
    Package.swift is a project: its scheme is the only one with tests for macOS or iOS, or the one
    --scheme names, and with several and none named, it names them, each with the command that
    chooses it. The targets its tests test are mutated, built once with every mutant in by
    xcodebuild build-for-testing, unsigned and in mutastic's own folder, and each mutant run
    against its tests with test-without-building, on the Mac or an iPhone simulator, one run on
    the simulator at a time. A run that ran none of the tests it was given is no verdict, and a
    failed build of a project saved by a newer Xcode says so, with both versions.
  • Installed whole, with nothing to set. just install builds the Swift edition for release and
    puts the site finder, synsites, beside mutastic-swift in ~/.mutastic/swift-<version>/,
    where mutastic looks for it; a release's archive holds the two side by side the same way. Run
    from there, or through a link to it, mutastic-swift finds synsites with no
    MUTASTIC_SWIFT_SYNSITES.
  • A call of the project's own function that only writes output is arid. logSaved(id), whose
    body is only print(…) or a logger's call, was counted at every call site while the print inside
    it was skipped. Its removal is now made and marked arid: only calls a function that only writes output, and the code in its arguments arid: only feeds a function that only writes output,
    left out of the score with the other arid mutants, as in the other editions. A function qualifies
    only when it gives back nothing, can't throw, wait or be overridden, and every function by its
    name only writes output; the call's values must have no side effect. mutastic.yaml names the
    rule mutastic:output, which brings them back.
  • The Swift edition has its docs. docs/ has getting started, installing, running on a
    package or an Xcode project, how the tests are run, Xcode projects, a page for each operator
    family with the anchors a card's link opens, the commands reference, troubleshooting and the
    differences from the Java edition, written to move into the Swift section of docs.mutastic.io.
    Every block of output is a capture in docs/output/, which cargo test --test docs runs again
    and fails on while mutastic prints anything else.
  • Each release has an archive for every machine the Swift edition runs on. A tag builds
    mutastic-swift-<version>-<target>.tar.gz for Apple silicon and Intel Macs and for x86_64 and
    Arm64 Linux, with SHA256SUMS beside them, as mutastic-rs lays out its releases, so the front
    door can fetch the edition the first time it runs on a Swift project. Each archive is installed
    and run on a machine of its target before the release is published.
  • A directory inside a package runs the package. mutastic run Sources/Pricing, or mutastic run from inside a package or an Xcode project's directory, runs the nearest package or Xcode
    project above it, as swift build finds the package and as the Java and Rust editions walk up
    to theirs. A directory with no project in it or above it is still refused, and now says it
    looked above too.
  • Twins run once. Two mutants at one place that always do the same are twins, as in the other
    editions: a returned comparison made true or false by mutastic/return-value and by
    mutastic/remove-conditional. One runs, and the other is skipped as twin: same as <id>, so the
    place counts once in the score; verify, explain and ignore of a twin act on the one that
    runs. mutastic/return-value now offers a returned comparison's true and false too, so a run
    of it alone still has them.
  • The report shows each test where it's written. mutation.json's testFiles keys a SwiftPM
    package's tests by the file that holds them, with the file's source and each test's line and
    column, as the other editions do, so the HTML report shows and links them. The site finder's new
    --declarations finds them; an Xcode project's tests are left as they were.
  • A caught mutant says where its failure came from, and what caught it. failureOrigin on
    mutant-finished and in mutation.json is assertion when a check failed (#expect, #require,
    Issue.record, XCTAssert…, XCTFail) and unknown for a thrown error, whose thrower neither
    library names. A catch by a thrown error now says so: caughtWith and statusReason read
    error: Refused(), not assertion, and it isn't counted among the catches by an assertion. The
    run's log says each failed test's issues as ✘ <test>: <issue>.
  • The site finder says how to call each function with a mutant in it. Its output gives each
    such function's parameters, result, and for a method the type it's on and how that type is made,
    with where its body opens, so a run can record the inputs its tests pass and a card can write a
    test that calls it.
  • A card says which inputs the tests passed. The coverage pass records the whole numbers each
    function with mutants in it is called with, so mutation.json and the events give a mutant's
    inputs, and a missed mutant's card its evidence: inputs seen: 50, 250 (none is 100) and
    every test calls discount() away from the boundary, as the Rust and Java editions say.
  • A missed mutant's card writes the test to add. As the Java and Rust editions do, the run calls
    the function on candidate inputs, the constants near the change and the values the tests passed,
    as the code is and with the mutant in, and writes a Swift Testing test of the first input they
    differ on, with what the code gives today: #expect(Pricing().discount(total: 100) == 10). It's
    in the card, the agent format's test to add, and suggestedTest and suggestion in the events
    and mutation.json. A function a test can call with whole numbers gets one, in a SwiftPM package
    or an Xcode project.
  • The test-first guides. Working test-first, its refactor and its agent
    page take samples/pricing through a cycle at a time: a failing test from the spec, the least
    code, mutastic on the cycle's lines with --since=HEAD, the tests its cards ask for, and a commit,
    then a refactor checked the same way, and the same cycle under an agent's gate. Every command's
    output is captured from a run, as the other editions' guides are.
  • Running in CI has its page. docs/ci.md has workflows for a SwiftPM package and
    an Xcode project on GitHub Actions and GitLab CI: failing on a low score or only on new misses,
    checking a pull request's lines, keeping the build and the last run's record in a cache, splitting
    a run across jobs, and keeping the reports.
  • A run whose tests reached none of its mutants says so. A shard, --since, --only or a run
    with tests left out whose tests reached none of its mutants passed in silence, every one not
    covered; it now warns that the score says nothing of the tests, and that the coverage may not have
    recorded, in the summary, the agent format (after note: ) and run-finished (noTestReached).
  • --exclude-tests takes a suite's name. A test's name is split at . and /, and a name
    leaves it out from its first part (App, App/Suite) or, for a test in a suite, from the suite
    (Suite, Suite/test()), as the Java edition takes a class's name with its package or without
    it. A suite's name alone matched no Xcode test.
  • Suggested tests has its page. docs/concepts/suggested-tests.md
    says how a missed mutant's test is found, which functions get one, where it goes and how it's
    named, and the assertion a function no test reaches starts with, on the new samples/suggestions.
  • The arid rules page shows the audit. docs/arid.md shows the summary rows
    MUTASTIC_ARID=audit gives on samples/arid, and says which of its catches are by an
    assertion and why the 4 here aren't.
  • Mutant ids has its page. docs/concepts/ids.md says what an id is
    made of, what keeps it while you work, line breaks and comments included, and what makes a new
    one: a renamed file, declaration or label, and the same change added earlier.
  • Coverage and mutants has its page. docs/concepts/coverage-and-mutants.md
    measures the new samples/checkout both ways, with llvm-cov and with mutastic: the same
    coverage for tests that check too little and tests that check the results, and the boundary,
    arithmetic, return value and removed call that only mutants find.
  • Results and the score has its page. docs/concepts/results.md says
    what happens to a mutant, what each result looks like, how a test catches one, how the score is
    worked out, when a catch doesn't count, and each kind of skip.
  • Running on your project shows every format, and what a long run says. docs/running.md
    adds the brief and grouped formats, a caught mutant's card from explain, and the live
    block and the log lines a long run prints, on the new samples/courier.
  • Equivalent mutants has its page. docs/concepts/equivalence.md
    shows what explain says of each mutant the Swift edition skips as equivalent, on the new
    samples/equivalence, and a check that only picks between a fast way and a safe way, on the new
    samples/fastpath, with the ignore that records it.
  • How the tests are run says what a run says as it goes. docs/concepts/test-runs.md
    shows a run's progress lines, how a mutant is written into the copy, a run with nothing to run,
    how a full run is compared with the last, and how a run is split across CI jobs.

Changes

  • A run prints what every edition prints. Its results are the core's model, and the core's
    reports print them: the full, brief, concise, grouped, agent and jsonl formats (--format, full
    on a terminal, concise elsewhere, agent for a coding agent), and mutation.json, its page and
    SARIF in .build/mutastic (--report). A missed mutant's card says what the other editions'
    say: "no test checks discount() at total == 100", with its - and + lines, the tests that
    reach it and what to test. The run passes or fails as the core judges it.
  • The command line is read as every edition reads it. The core's parser takes the line, the
    help, the variables that stand in for options, the directory and mutastic.yaml, so a mistyped
    command or option is named with the one meant and the line to run instead ("run has no option
    --thresold. There's one called --threshold."), run --help is written from the command's
    declaration, and a directory with no Package.swift is refused, naming it.
  • A red baseline says what the other editions say. When tests fail with no mutant in, mutastic
    names each with how it failed, says how to leave it out until it's fixed (exclude-tests: in
    mutastic.yaml, or --exclude-tests for one run), where its output is, and the command that runs
    it alone: swift test --filter for a package, xcodebuild test -only-testing: for an Xcode
    project. An agent is told to find out whether the change or the test is wrong, and to ask before
    leaving a test out. It said only which tests failed, and the gate read no tests from it.
  • Release archives are named by os and architecture. mutastic-swift-1.5.0-macos-arm64.tar.gz,
    -macos-x86_64, -linux-arm64 and -linux-x86_64, as mutastic-rs names its own, where they were
    to be named by Rust's target; the front door's first-use fetch asks for these names.
  • A run outside git says what to do. The messages for a directory that isn't in git, or git
    that can't be run, name the next step.
  • The summary gives a total only beside both counts. Files 1 clean and 0 clean | 1 with misses no longer repeat their one count in brackets; 1 clean | 1 with misses (2) keeps it. A
    PASS at --threshold=0 says with no threshold to reach., not with no threshold set.

Fixes

  • A mutant that crashes the compiler is withdrawn, not the run stopped. A build can fail with
    no error to blame when the compiler crashes on a mutant (swift-service-lifecycle's try! in an
    if over a merged sequence's next()), and settle stopped there. Now it bisects: the live
    mutants of the declaration the crash dump names, else of its files, else every one, half
    switched off a build, until the one the crash goes with is withdrawn as unviable: the compiler crashed (signal 11) building it. Every one of those builds counts toward the most a settle
    takes, so a crash that never goes away still stops, saying so.
  • A run leaves nothing in the temporary directory. SwiftPM leaves a lock file and an empty
    directory there each time mutastic starts it, which added up over runs; the Swift tools mutastic
    starts now keep theirs in the package's .build/mutastic/tmp, which goes with the build.
  • The banner says the release's version. It said mutastic 0.0.0, as did the reports and
    the shards; the Swift edition is numbered as the release train it ships on, as the other
    editions are.
  • A card's operator links to its page in the docs. The = operator line linked
    operators/mutastic#boundary, a page the docs don't have; it now links the page each operator is
    on, as the other editions' cards do,
    https://docs.mutastic.io/swift/operators/conditions/#boundary. Swift's own are on the page of
    the shape they change: swift/remove-guard on conditions, swift/try-nil on returns and
    swift/chain-nil on options.
  • The arid rule for a failed check's message is mutastic:messages, as in every edition. It
    was mutastic:check-message, which mutate: in mutastic.yaml named in no other edition.
  • A directory that isn't there is no-directory, and one with no project no-project, in the
    editions' words.
    mutastic run Sorces said there was no Swift project in it; it now says
    there's no directory Sorces, and a directory with no Package.swift or Xcode project in it says
    there's no project in <dir> for mutastic to test., as the Java and Rust editions do.
  • A failure in the agent and jsonl formats ends the stream with its run-failed event. A
    mistyped command or option, a directory with no project, or tests that fail without any mutant
    said so on stderr only; a tool reading --format=jsonl or --format=agent now reads the same
    as every edition gives it, the code, the message and the exit status, as the last line on stdout.
  • A package's mutastic.yaml is read. It was looked for above nothing and never found, so
    its rules, operators and build arguments went unused, and a mistyped key such as rulez: or an
    operator such as strem ran without a word. It's now read, applied and checked as the other
    editions read it, and a mistake in it is refused with its line.
  • The help's MUTASTIC_SWIFT_ENGINE says how the Swift edition is found. It said the edition
    wasn't released, so a Swift project was refused without it. It now says what the front door
    does: without it, the edition installed in ~/.mutastic/swift-<version>/ runs, and with none
    installed, the release for the machine is fetched the first time.
  • On Windows, the Swift edition says it runs on macOS and Linux, and how to run it from there.
    It said it was still being built and offered to test a Java or Rust project instead. It now
    says Swift projects are tested on macOS and Linux, and gives the command to run it in WSL.
  • A directory that isn't there, or holds no project, ends in the command to run instead. A
    missing directory is said with where it was looked for, then a directory beside it a slip away
    from its name, or the package it would be in, and the command on it; no project says where
    mutastic looked and for what, then mutastic run <project directory>, as the other editions
    say both.
  • A card lists its covering tests in the same order every run. They followed the order Swift
    Testing listed them, which changes from run to run. They're now listed as the other editions
    list them: the mutant's own tests first, those of a suite or test target named for its type or
    module, then by name.
  • A Swift older than 6.0 is refused by name. Only just run checked the toolchain, so the
    installed edition went on with an older swift, or none, and failed later in the build. Every
    command now says which swift is on the PATH and that it needs 6.0 or later, and where to get
    one, before anything runs.
  • A function whose body is one expression builds when its inputs are recorded. { total / 10 }
    returns its expression without a return; the recorder of its inputs, written before it, left
    the body a statement and an expression, and the build failed with "missing return". The recorder
    now goes before the expression, and returns it.
  • An Xcode project run from . reads which tests reach each mutant. Run as mutastic run or
    mutastic run ., an Xcode project's tests were given a relative path for what they reached, and
    xcodebuild runs them in a directory of its own, so nothing was recorded: every mutant was one no
    test reaches, and a shard passed with all of them not covered. The project's paths are now whole.
  • A private function no longer costs its test target every suggested test. The run wrote a
    probe for each function a suggested test could call, private and fileprivate ones too, and a
    probe of one fails to build; so the build dropped every probe of that test target, and no missed
    mutant there got a test to add. Only functions a test can reach with @testable import are
    probed now: not private or fileprivate, nor in a type or extension that is, nor inside
    another function.
  • A function whose one switch or if returns from each branch builds with its recorder. Its
    body was taken for one expression, so the recorder wrote return before it, and Swift refused
    the build: a return can't leave a switch expression. The run stopped. Such a body is now
    read as statements, and the recorder goes first in it. A throw in a branch still leaves it an
    expression.
  • An arid skip names its rule as mutastic.yaml does, and the setting it offers brings the
    mutant back.
    explain named the rule by an id of the Swift edition's own, such as
    only-writes-output, linked to a page the docs don't have, and offered an arid: keep: setting
    nothing reads. It now names mutastic:output, links to the rule's section of
    the arid rules page, and offers the rules: entry with arid: [mutastic:output],
    as the other editions do.
  • A method of a nested type gets a suggested test that builds. Its call named the type alone,
    Inner(), which a test can't name, so the probe failed to build and every other suggestion in
    that test target was dropped with it. It now names the type in full, Outer.Inner(), an
    extension of one too.
  • A pass doesn't say every mutant was caught when some aren't covered. A run that missed none
    but had mutants no test reaches said Every mutant was caught.; it now counts them, as a failing
    run does: 0 missed, 102 not covered, with no threshold set.
  • A red baseline says when a name left out nothing. A run stopped because tests fail with no
    mutant in now says, before where their output is, each name given to --exclude-tests or
    exclude-tests: that named no test, as that may be why the failing test wasn't left out.
  • mutation.html colours Swift's code. The report's page shows each file's source coloured as
    Swift, as it does Java's and Rust's.
  • A run after a source file is renamed or deleted builds the package as it is now. The copy
    mutants are built in kept every file a run had copied, so the next run built a renamed file
    beside its old self and stopped at invalid redeclaration, until .build/mutastic was removed;
    a CI cache of .build/mutastic met it on any commit that renamed a file. What the package no
    longer has is now removed from the copy, and what SwiftPM, Xcode and the run wrote there stays,
    so builds stay warm.
  • A line break or a comment in a condition keeps its mutants' ids. An id read the code a
    mutant changes as it was written, so a formatter's pass, or a comment added inside a condition,
    gave its mutants new ids, and a baseline or an ignore lost track of them. Each run of whitespace
    and comments outside a string literal now counts as one space, as in the Rust edition; spaces
    added where there were none still make a new id. The contract's ids check holds it.
  • explain says what a Swift mutant's id is made from. It said a SHA-256 of the package,
    function, operator, site and change, but the id is made from the mutant's file, its path from the
    package, not the package's name. It says the file now.

Internal

  • The repository's scaffolding: the Rust workspace, the SwiftSyntax helper and the pricing
    sample, with the family's verbs, hooks and changelog.
    just check runs the format, every lint
    and the tests of both halves; commits and pull request titles are checked as in mutastic-rs, and
    just merge lands a pull request.
  • Swift Testing's event stream is read. runner::swift_testing reads what swift test --event-stream-output-path writes, versions 0 to 2: each test passed, failed with what its
    issues say, skipped with why, or unfinished, and whether the run reached its end, so a crash is
    told from a run that finished and the test it was in is named. Tested on streams recorded from
    real runs in CI's image.
  • XCTest's results are read. runner::xctest reads them from the xUnit file swift test --parallel --xunit-output writes, the only one with XCTest's tests in it, and from what XCTest
    prints when the test binary is run directly, which also names a skip: each test passed, failed
    with what XCTest said, skipped, or unfinished, and whether the run ended. A run of Swift Testing
    alone, which still prints XCTest's Executed 0 tests, is no XCTest result.
  • A package's test binary is run directly. runner::binary runs the .xctest binary SwiftPM
    built, without swift test's start-up: Swift Testing's tests each selected by a filter of their
    whole ID and read from the event stream, XCTest's selected by name and read from what it prints,
    each named as it was selected. On macOS, xcode::testing_helper runs the bundle through
    swiftpm-testing-helper, with the platform's private frameworks on DYLD_FRAMEWORK_PATH so a
    bundle that links XCTest's Swift support loads under Xcode 26.
  • The test that crashed a run is named. One trap ends the whole test process, and Swift
    Testing runs several tests at once, so a run that crashed says only which tests were running.
    runner::blame runs each it left unfinished, or never reached, again on its own: the one that
    crashes alone is Crashed, every other gets its own result, and a test whose run alone started
    nothing is never blamed for a crash it didn't cause.
  • The copy mutants are built in keeps every target. project::copy copies the whole package:
    its C, C++ and Objective-C targets, headers, module maps and resources, which its Swift targets
    build on (swift-nio's NIOCore over its C target CNIOAtomics). The spike copied the Swift
    sources alone, so such a package didn't build. Build output, .git and AppleDouble ._* files
    are left out, links stay links, and a file whose bytes haven't changed isn't written again.
  • Tests are timed, and a run that hangs is killed. Each test's time is read from what its
    library says (Swift Testing's event instants, XCTest's printed seconds and xUnit time). A run
    given a limit is killed when it passes it: the run is timed_out, not crashed, and the tests it
    was in are TimedOut. The run refuses a red baseline, naming the tests that failed,
    hung or crashed (red-baseline), and a baseline in which nothing started; a green one limits
    each mutant's run to five times what its tests took, and a second, or ten seconds.
  • The site finder lists every mutant of a Swift file, with the arm the engine writes it in.
    helper/ parses with SwiftSyntax, folds operators by precedence, and prints JSON Lines, the
    schema in ARCHITECTURE.md: 27 operators, the other editions' ids where Swift has the shape,
    and Swift's own; #if branches not built, generated and AppleDouble files skipped; log calls
    and check messages arid. On swift-log every error of the all-mutants build lands inside an arm.
  • Every mutant is written into the build's copy. build::sites reads the site finder's JSON,
    refusing a schema it wasn't built for, and build::write writes each file's mutants into it as
    the contract says: the sites of an arm together, arms from the inside out, a statement or a
    local's value in an if, a condition in a ternary, an insert at its place, and no line break
    added. It says where each mutant's copy is in what it wrote, so an error the compiler finds
    there names the mutant to withdraw. build::runtime is the __mutastic switch, read once from
    MUTASTIC_ACTIVE with getenv.
  • The one build settles. build::settle writes every live mutant, builds, and withdraws each
    mutant the compiler's errors blame as unviable: with its message, until the build passes. An
    error in a mutant's copy names it; one outside every copy is blamed on the arm around it, else
    on the innermost closure holding its line, else on the declaration's mutants, so an error the
    type checker reports beside a change doesn't stall the loop. Each round takes every error it
    reads. An error no mutant is near stops the loop and says where it is.
  • The run goes through mutastic-core's parts. The edition depends on mutastic-rs's
    mutastic-core at a commit, and run::parts implements its ProjectReader, SiteFinder,
    Build and TestRunner for SwiftPM by wrapping the package reader, the site finder, the writer
    and settle, and the launcher. What a run finds is the core's model, and each mutant has the
    core's id. Tests are listed before they run: Swift Testing's from the event stream a listing
    writes, XCTest's from the JSON its tests are dumped as. What a run prints is unchanged.
  • The commands are declared once. commands declares run and verify, their options, the
    environment and the exit codes, as the core's Declaring takes them, for its parser and the
    docs' reference; project::edition holds the edition's types and its Configuring.
  • mutastic-core at 882d15d. A test run says how many tests it started, and a mutant's run
    that started none where the baseline started some is the core's "not run: no test started",
    skipped and out of the score, in place of the edition's own word for it. The edition gives its
    path separator, ., and its build's one step, so a card names Pricing.discount() and the
    summary's build says (build).
  • mutastic-core at abd02bc. The core's build progress takes an edition's steps as a list, so
    SwiftPM's one step is given once, not twice for the core's two.
  • just run checks the toolchains first, and takes a command. A Rust older than
    rust-toolchain.toml's pin, as a Rust that isn't rustup's gives, or a Swift before 6.0, is named
    before anything builds, with what to install, where it failed after the site finder's build. It
    takes just run, just run <dir>, just run --option and just run <command> [args], on the
    pricing sample unless an argument names a package.
  • Xcode projects and workspaces are read. A .xcworkspace or .xcodeproj's targets and test
    targets, what each tests, the Swift files each compiles (listed, or in Xcode 16's folders kept in
    step with the disk, but those their exceptions leave out), their platforms, deployment targets
    and Swift version, with the settings .xcconfig files give them; the shared schemes and the test
    plans they name; the packages each project uses; and the Xcode that last saved it, which names a
    failed build's cause when it's newer than the Mac's. Nothing runs them yet.
  • The xcodebuild command lines. build-for-testing once, unsigned and in mutastic's own
    derived data, with the scheme's test plan; test-without-building from its .xctestrun, with
    parallel testing off and an -only-testing for each test, a Swift Testing test with its (),
    as without them Xcode runs none and says it succeeded; and -enumerate-tests. macOS and the iOS
    Simulator are the destinations, and watchOS, tvOS and visionOS are refused by name. Nothing runs
    them yet.
  • just start-here says what this repository is. How to try it, where things are and what to
    read next, as every repository in the family says it, from .github/start-here.txt;
    justfile-check holds it to the verbs and paths that are here, and to never showing a second
    run after just run. scripts/test-just.sh tests just run's words and the check, and CI runs
    it.
  • What Xcode says of a run is read. Each test's result from its result bundle, by the name
    -only-testing takes and its library, which only the result's URL shows; a known issue as a pass
    and a crash as the crashing test's; the run's counts; a run of tests that ran none of them, as
    -only-testing without a Swift Testing test's () does while saying it succeeded, as the runner
    failing; and from the output, stdout and stderr together, which tests a killed run left
    unfinished, each restart after a crash, and how xcodebuild said it went. Read from runs recorded
    with Xcode 26.6; nothing runs them yet.
  • The tests leave nothing behind. A test's copy of a package is in a Scratch directory, which
    is removed when the test ends, a failing one too, and the build every test of the binary shares
    is in Cargo's own target/tmp; each copy took 65 MB, and hundreds of them filled two machines'
    disks. A test checks that a run leaves nothing in its temporary directory.
  • mutastic-core at dab2676. A catch by a test that fails without the full suite, with no
    mutant in, is judged again on the full suite (decision 39); a card names its operator; an Xcode
    project's refusals carry the contract's own codes (scheme-ambiguous, xcode-too-old,
    runner-failed, apple-only-on-linux), and the exit status is the core's for each; an Xcode
    project's build progress says xcodebuild build-for-testing and names the scheme; and the
    coverage pass's failing tests run again on the workers.
  • mutastic-core at 2d1d1e9. Tests that depend on their order are found by the core now
    (decision 40), so the edition's own probe goes and the run says so once; a run holds its work
    directory's lock, and a second waits for it (decision 41); a selection's check without the mutant
    runs once unless the run is order-sensitive or has a flaky test (decision 39); the false-catch
    guard's alone runs go on the workers; and a timed-out mutant's mutant-finished has limitMs.
  • The editions' contract holds the Swift edition too. tests/contract.rs runs the
    contract's checks on the built binary and samples/pricing, at the pin in contract/pins, with
    the Swift binding block; just contract runs them and just pin-contract moves the pin.
  • The contract check holds the events and mutation.json to their schemas. As mutastic-rs's
    does, tests/contract.rs checks every event an error case and a run write against
    mutastic.events/v1, mutation.json against the mutation-testing report schema and mutastic's
    additions, mutastic.report/v1, and each copy in tests/schema against the hash the contract
    gives.
  • A release waits for its approver, as mutastic-rs's does. A tag drafts the release, with a
    summary for the approver: each asset, its digest held to SHA256SUMS, and the notes. The
    publish job runs in the release environment, so it waits for its required reviewer, refuses
    without one, then publishes the draft as the latest release and starts release-verify.yml,
    which fetches each archive from the release on a machine of its target and lists
    samples/pricing's mutants with it.
  • The core at its faster check of catches. A caught mutant's selection runs again with no
    mutant in only up to the catching test, and the furthest run answers for every catcher up to
    it (decision 39, as mutastic #341 amends it). On swift-log nothing changes but the time.
  • The coverage page's test measures the same coverage every time, and runs on macOS. Its tests
    run one at a time for llvm-cov, whose counters can lose a count when two tests call one
    function side by side, and on macOS it reads the tests' binary inside their bundle, with Xcode's
    llvm-cov.