Skip to content

Releases

xcmutate 0.17.0

Choose a tag to compare

@github-actions github-actions released this 02 Dec 04:15
7414bc9

Fixed

  • With --shared-process on a simulator, a test target built by Xcode 26 no longer makes the tool fall back to xcodebuild with the warning directLaunchUnavailable. Xcode 26 writes the Main Thread Checker into the .xctestrun file as __SIMRUNTIMEROOT__/usr/lib/libMainThreadChecker.dylib, and the tool now writes out that placeholder as the root of the simulator's runtime and starts the test host itself. This applies to Xcode 26 simulators, such as those of GitHub's standard macOS runners; Xcode 27 writes the path itself, so runs with Xcode 27 do not change. On a GitHub-hosted runner (Xcode 26.6) with 13 survivors in 17 mutants, the mutant phase took 1 min 56 s instead of 6 min 29 s, with the same verdicts.
  • The JSON report put the action's default destination (platform=macOS, used when the action runs a profile without the input destination and the config file names none) in settings.fromFile, which is meant for values of the config file. It now goes into a new field settings.defaults. The line settings from xcmutate.yml: … at the start of a run lists it after defaults:. The report version stays 2, since the field is new and fromFile keeps its meaning; reports of 0.15.1 and 0.16.0 have the default in fromFile, with the source "the default of the GitHub Action". docs/reports.md describes settings.

Changed

  • docs/comparison.md and the README compare with Muter's release 17 (2026-11-25) instead of a commit of October 2026. scripts/verify-muter-fixtures.sh checks against that release, and its comparison of mutation examples also takes the all-operators source that Muter's tests keep in a string (56 expected mutants instead of 27). Its comparison with Muter's regression snapshots also matches a ternary-swap that ends on a later line, and names the reason for a mutant that xcmutate leaves out when its range holds Muter's line. A unit test runs the shapes of the bugs that Muter 17 fixed through xcmutate.

xcmutate 0.16.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 05:43
cea2da0

Changed

  • The default work directory is one per repository and root instead of one per path of the root: its name is made from the git directory that all worktrees of the repository share and the path of --root inside its worktree, so a run in a new worktree builds on the DerivedData that a run in another left. While a run holds it, a run of the same repository takes <hash>-2.noindex (up to 8) instead of stopping. The directory that earlier versions made for the root is moved there by the first run, when the shared one does not exist yet (its packages are reused; most of the build is made again, since the path of the copy changes). A root outside git keeps a directory per path. A run does not take a directory that holds an unfinished run of another root, so --resume finds the latest run of its root in whichever directory of the repository holds it; it stops with a message when none does, when that run finished, or when another process uses that directory. A run without --resume gives up the unfinished runs of its root in the other directories when it starts its own journal; a run that stops before leaves them. --resume continues a run only for the same root and sources, and --reuse takes over results only for the same sources, as before. clean says when a directory holds an unfinished run that --resume could continue. clean removes every directory of the repository and root, and clean --orphans removes a directory when its repository no longer exists, no longer when only the worktree of its last run was removed.

Added

  • run removes, at its start, the default work directories under ~/Library/Caches/xcmutate that no run has used for more than 14 days, and prints each one with its root and size. --clean-unused-after <days> (key cleanUnusedAfter) sets the number of days; 0 turns it off. Directories in use, the one of the run, and directories without the marker file or a default name are never removed.
  • At its end, also after an error, run prints the path and size of its work directory and the clean command that removes it (du for at most 5 seconds; not after Ctrl-C).
  • run and clean remove a work directory under its lock, after renaming it aside in one step, so that a run that starts during the removal does not lose its files to it.

xcmutate 0.15.1

Choose a tag to compare

@github-actions github-actions released this 30 Nov 08:01

Fixed

  • --select-tests reach with more than one mutated file: the baseline could run for hours and write a trace of gigabytes. Every mutated file has a helper of its own, and each took the records that the helpers of other files appended to the trace for a test boundary, so it recorded its switches again; two files whose code runs in turn wrote a record at every evaluation (a test of 0.001 s did not end within five minutes, with a trace of 1.4 GB). A helper now records a switch again only when something other than reach records was appended since it last looked. When it cannot tell (more than 64 KiB was appended, or the read fails), it records again as before, so a record is never missing. Thanks to @jmurff.

Changed

  • GitHub Action: with profile and without destination, the action boots nothing and the run takes the destination of the config file (the profile's, else the one of run), or platform=macOS when the file has none, with a warning that says so and what to write for a simulator (destination: platform=iOS Simulator,name=iPhone 16, xcrun simctl list devices available), and a second one when simulator-permissions cannot be granted. Before, it passed platform=macOS, which replaced a simulator of the profile. --profile in args counts as a profile, --destination in args as a destination. Without profile, an empty destination is still platform=macOS, except with --destination in args: the action then adds no platform=macOS (before, it passed both, and the run had two destinations).
  • When xcodebuild finds no device for the destination ("Unable to find a destination matching"), or the simulator is not booted, the message names the destination and, when it came from the config file, where (--profile <name> or run) and how to give another one: when the action runs it, its input destination, elsewhere --destination or the file. It shows how to name a simulator by its device name and how to list the simulators.
  • xcmutate init: for a simulator, the file says at the top that its destination names a simulator of the Mac where init ran, and that on CI or another Mac the destination given there wins; the comment of workers in nightly says that it is the value for this Mac (cores and memory).
  • The examples in the README, getting-started and usage name the simulator by its device name (platform=iOS Simulator,name=iPhone 17 Pro) instead of its UDID; docs/ci.md describes profiles and the destination.

xcmutate 0.15.0

Choose a tag to compare

@github-actions github-actions released this 28 Nov 01:59

Added

  • The config file is xcmutate.yml (YAML), so that it can carry comments. It is read with Yams 6.2.2 (MIT License; THIRD_PARTY_NOTICES.md), with the types of JSON (YAML 1.2): yes, no, on, off and 08 are strings, not booleans or numbers, and a key of another type rejects them (a string key says to write such a value in quotes); a key that is there twice, a merge key (<<), a number out of range and a tag other than the standard ones stop the tool. xcmutate.yaml is found too. xcmutate.config.json of earlier versions is still read with the same keys; when more than one of these files is at the root the tool stops with exit code 64 and names them. --config reads a path that ends in .json as JSON, any other as YAML. Messages about the run options of the file (an unknown key, a wrong type, a profile that does not exist, a value that makes verdicts weaker), the end of init and the help of --profile link to the description of the keys.

  • xcmutate init: finds the workspace, project or package, the scheme, the unit-test targets and the test-plan configurations, builds, and runs a sample of mutants in the default mode and with the faster modes (--select-tests reach --shared-process, and --confirm-kills restore for app-hosted tests on a simulator, on a simulator of its own). It writes run and the profiles pr and nightly into xcmutate.yml, with the reasons as comments and a link to the description of the keys at the top (into a .json file named with --config: as JSON, with the reasons under _why). An existing xcmutate.yml keeps its other keys and comments. A xcmutate.config.json at the root is replaced by xcmutate.yml with its settings only with --force; without it init writes nothing and shows the file it would write. It chooses a faster mode only when it gave the same verdicts and was also faster per mutant run (the runs without mutants at the start of a shared process left out), and the estimate counts what does not grow with the number of mutants once and the time per mutant only for the share of mutants that were run. The sample is taken from the files given, --path <directory> or the current directory below the root. The destination is written by the simulator's name and OS version, workers only when the simulator's privacy settings could be given to another simulator, and the impact map outside what git tracks and outside work directories. --build-arg, --package-cache and --work-dir are used for the trials and written into run. A full disk is said as such; after a failure init removes its builds and copies (keeping the logs) and its simulator, and the next init removes what a killed one left. It never writes a gate or an option that makes verdicts weaker, keeps the other keys of an existing file, and writes nothing over existing run options without --force. --dry-run, --yes. scripts/verify-init.sh checks it.

  • Run options in the config file: run for every run and profiles.<name> with run --profile <name> (and profile in the action). The command line wins over the profile, the profile over run. buildArg stands for --build-arg, and --prepare cannot be set there (a file in the repository cannot make the tool run a command); paths are relative to the directory of the config file, and a leading ~/ is the home directory. The values go through the same parser as the command line and are part of what --resume compares; the run prints where each came from and the JSON report keeps it (settings). Options that make verdicts weaker (--no-recheck-survivors, --trust-shared-survivors, --confirm-kills none) can be given only on the command line; "confirmKills": "none" in the file stops the run with exit code 64.

  • --select-tests impact --impact-map <file> and --write-impact-map <file>: a run of whole files with --select-tests reach writes which suites ran which file; a later run selects the suites that ran the files changed since the map's commit and the suites of changed test files, then narrows by reach within them. Every run of all tests in that run becomes a run of those suites. The whole selection runs, with the warning impactFallback, when a changed file is not covered (not Swift, not in the map, code run at launch, a test helper) or the map cannot be used. Only the choice of tests comes from the map; the results hold among the chosen suites (warning impactSelection). scripts/verify-impact.sh checks it.

  • --confirm-kills restore (not the default): on an iOS simulator with app-hosted tests and one worker, the run without mutants after a run that did not pass is replaced by putting back a copy of the app's containers and the simulator's keychain taken right before the baseline. What the copy does not cover is compared with the copy (keychain, pasteboard, privacy permissions, notifications, other apps' App Groups, Photos, Contacts and Calendar); when it differs, or putting back fails, the tests are run as with auto. It assumes tests that depend on nothing outside the simulator and give the same result from the same state. The final baseline and the recheck of survivors are not replaced. Warnings restoreUnavailable and restoreFellBack; restoredStates and restoreFallbacks in the JSON report.

  • --stop-when-gate-decided (and stop-when-gate-decided in the action): stop as soon as the result of the gates can no longer change, whatever the mutants still to come give. A failing pull request ends at its first gap (--fail-on-survived, a new gap of --baseline-report) or when --fail-under cannot be reached; a score that stays above --fail-under in every case passes early when it is the only gate. The run ends like one cut short by --time-limit, with gateDecidedEarly, gateDecision and pendingKeys in the JSON report, the warning gateDecided, and the gate's exit code. Off by default.

  • With --shared-process, a mutant that runs by itself against all selected tests (code that runs at launch or once per process, tests that are not known, no narrowing) runs in a process with the tool's driver and stops at its first failing test. Up to that test it is the run of all tests in the driver's order, so the Killed rests on the same evidence as one from a run to the end; a pass of all tests is a Survived; anything else goes to xcodebuild as before. On an app whose tests take 15 minutes, such a mutant cost a full run even when its first test failed. The Killed says so in its detail, as stoppedAtFirstFailure in the JSON report, in the text report and in the time breakdown. --no-stop-at-first-failure runs them to the end under xcodebuild. Not used when the .xctestrun file asks for random order (warning randomTestOrder), nor with several units.

  • The run ends with one line that says where the time of the mutant phase and the final baseline went: the runs without mutants at the start of shared processes, mutants run alone against all tests (with the reason: evaluated before the tests, evaluated unequally often, …), mutants run alone against their own tests and the shared processes lost to crashes or hangs, rechecks, runs without mutants between mutants, the final baseline, and the rest. Also in the text report and as durations.breakdown in the JSON report. A user of an app whose tests take 15 minutes could not tell where a run of four hours had gone. With several workers, the time they ran side by side is divided among them (by the time each was there), so that the parts do not add up to more than the whole.

Changed

  • --workers gives the simulators it creates the privacy settings that the first simulator has for the app under test (granted and revoked as there). Without them a permission dialog stopped shared processes on the new simulators. What simctl privacy cannot set is named in the new warning workerPrivacy. A destination by name that does not name one simulator stops a run with --workers before the build; it was taken for a Mac, and the workers shared one simulator.

  • With --shared-process, a test host started by the tool whose app goes to the background and stays there for 10 s is stopped then, and xcodebuild starts the hosts from there on (directLaunchUnavailable). Such a host is suspended and runs no test; waiting for the time limit cost about five minutes each time.

  • The warning directLaunchUnavailable says first that the results are not affected and what the fallback costs, quotes the lines of the host's output that say why it stopped, and names the file to read. For a test target without a host app, the xctest agent that cannot load the driver's bundle writes its reason (Failure: …) and then its whole environment; the warning showed the last three lines of that environment. It now leaves the environment out and quotes the reason, the dynamic loader's message (Library not loaded, Reason:) or an uncaught exception, and only otherwise the last lines.

Fixed

  • init no longer leaves a directory in the default DerivedData (xcodebuild -list of a package resolved its packages there).
  • run and clean remove the lock files that xcodebuild leaves in the temporary directory for the package state of the run's DerivedData directory (two per work directory).
  • A destination by name with OS= now finds simulators whose runtime identifier has more after the version (iOS-27-2-iPhone19-4).

xcmutate 0.14.0

Choose a tag to compare

@github-actions github-actions released this 26 Nov 08:23

Added

  • list --package <dir>: the same narrowing as run --package <dir>, so that list --since counts the mutants that the run will make. Without the option list behaves as before.
  • --shared-process auto (and shared-process: auto in the action): after the baseline, the tool uses shared processes only when the launches that the mutants would save are at least what the start of a shared process costs (a launch and two runs of the tests per unit). The run, the text report and durations.sharedProcessChoice in the JSON report say which it chose and why. --resume keeps the choice. The default is unchanged (speed.md).
  • A heartbeat: when a phase prints nothing for a minute (the build, the baseline, a shared process in its runs without mutants at the start, a long run of one mutant), one line says which phase is still running, for how long, and how far it has got where a log shows it (source files compiled, tests ended, mutants with a result). The build of a large app had printed nothing else for eight minutes.
  • --progress-file <path>: the progress of the run as JSON Lines (version 1): phases, heartbeats, every printed line, every mutant's result with the estimate of the time left, and the exit code at the end. The action writes it as progress.jsonl with the reports and uploads it with them. The guide for agents tells the agent to follow it in a long run (reports.md).
  • With one process per mutant, the run says at the end when the runs without mutants after failing runs took 30% or more of the mutant phase, and that --shared-process makes these runs inside the process.

Fixed

  • A mutant that made the host end with an uncaught exception could be a Timeout when, on a busy Mac, xcodebuild had not yet said that it restarts the host and no crash report was written in time. The host's own line *** Terminating app due to uncaught exception in the log now makes such a run a Crash, when the line carries the host's name and process ID and no test started or ended after it; the result's detail quotes the line. Lines that do not name the process (Swift's Fatal error:, libc++abi:), which a process that a test starts can also write to the log, are not taken.
  • A host that the tool started for --shared-process and that a test sent to the background (by opening another app or a URL) was ended by the system after about 30 seconds when a background task was in progress (termination code 0x2182bad2), and the warning said only that simctl does not say how the app ended. Under xcodebuild such a host keeps running. The driver now writes down when the app goes to the background and which test was running; a process that ends there makes the tool go back to xcodebuild, also after the runs at the start of the process, and the warning names the test and the cause. The launch record keeps the simulator's log lines about the process's visibility and runningboardd's reason, and termination codes that Apple documents are explained.
  • The estimate of the remaining time with --shared-process said "roughly 0s left" while the first shared process was running, and then jumped to many minutes. It now counts the time of a process that is still running, its start and its runs without mutants included.

Changed

  • --select-tests reach --shared-process: the second of the two runs without mutants at the start of a shared process runs only the suites that the process's mutants reach; the first still runs every selected test and is what is compared with the baseline. The run says so for each such process, and durations.sharedProcess.narrowedStartupRuns counts them. --no-narrow-gate makes both runs of all tests, as before. On an app with 6,900 tests (87 s) and one file whose mutants about 45 tests reach, this halves the start of a shared process. A suite outside the mutants' suites that changes how often a switch is evaluated sends the mutant to a separate process, as before (Fixtures/Regression/OnceOutsideGate).
  • --reporter github writes one ::notice when no mutant is undetected, instead of nothing. The xcode format still writes nothing then.
  • The report for agents gives fixes only for the kinds of gap that it holds; with every mutant detected, fixes is empty.
  • --package with a subdirectory of the repository limits the default files to mutate to that directory, with and without --since (when neither --root nor file arguments are given). The root stays the top of the repository, so paths, stable keys, the accepted file, the config file and the work directory do not change. The action's package input does the same.

xcmutate 0.13.0

Choose a tag to compare

@github-actions github-actions released this 24 Nov 07:09

The first public version.

What it does

  • Mutation testing of a diff. run --since <ref> mutates the lines changed since a git ref and reports every mutant that no test detects, as NotReached (no test runs the code) or Survived (tests run it and still pass).
  • One build for all mutants. Mutants are embedded as runtime switches, in a copy of the repository. run does not modify the working tree.
  • Xcode projects, workspaces and Swift packages, through xcodebuild: app-hosted unit tests on an iOS simulator and tests on macOS, with XCTest and Swift Testing.
  • 27 mutation operators, 19 of them on by default. The defaults follow a rule that was applied to measurements on public packages.
  • Verdicts that need evidence. A mutant is reported as Survived only with a record that it was switched on and a full test count. It is reported as Killed only if the same tests have passed without mutants since the last failing run. Mutants that could not be judged are reported as such and are not counted.
  • Test selection. --only-testing, --select-tests auto (by naming convention) and --select-tests reach (by the suites that executed each mutant, with a recheck of survivors against all selected tests).
  • Faster modes, off by default. --shared-process (several mutants per test process), --workers (several destinations at once) and --reuse (skip mutants that an earlier run killed).
  • Reports: text, JSON, a compact JSON for coding agents, Markdown, HTML, the mutation-testing-elements schema, and warnings for Xcode and for GitHub Actions.
  • Gates and exit codes for CI: --fail-on-survived, --fail-under, --baseline-report ("no new gaps"), --time-limit and --max-mutants.
  • Interrupting and resuming a run (--resume), and recording equivalent mutants with a reason (accept).
  • A GitHub Action, example workflows and a shell script for CI, and a procedure for coding agents that runs the loop "find gaps, write tests, re-check". agent-guide prints it, and agent-guide --install writes a Claude Code skill, a Codex skill or a section in AGENTS.md so that the agent finds it by itself.

Known limits

  • Runs were verified with Xcode 27.2 (macOS and an iOS simulator) and, once, with Xcode 26.6 (a Swift package on macOS). Building from source needs Swift 6.3 or newer (checked with Xcode 26.6 and 27.2).
  • UI tests are not supported.
  • By default every mutant costs one launch of the test host. The faster modes are opt-in.
  • Not tested: an iOS simulator with Xcode 26.6, the prebuilt binary with Xcode 26, the x86_64 half of the release binary, brew install, and most of the action on GitHub (it ran once there, on a Swift package on macOS).

docs/limitations.md lists all limitations, what is not verified yet, and the known issues.