Repository navigation
Releases
xcmutate 0.17.0
Fixed
- With
--shared-processon a simulator, a test target built by Xcode 26 no longer makes the tool fall back toxcodebuildwith the warningdirectLaunchUnavailable. Xcode 26 writes the Main Thread Checker into the.xctestrunfile 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 inputdestinationand the config file names none) insettings.fromFile, which is meant for values of the config file. It now goes into a new fieldsettings.defaults. The linesettings from xcmutate.yml: …at the start of a run lists it afterdefaults:. The reportversionstays 2, since the field is new andfromFilekeeps its meaning; reports of 0.15.1 and 0.16.0 have the default infromFile, with the source "the default of the GitHub Action". docs/reports.md describessettings.
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.shchecks 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 aternary-swapthat 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
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
--rootinside 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--resumefinds 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--resumegives up the unfinished runs of its root in the other directories when it starts its own journal; a run that stops before leaves them.--resumecontinues a run only for the same root and sources, and--reusetakes over results only for the same sources, as before.cleansays when a directory holds an unfinished run that--resumecould continue.cleanremoves every directory of the repository and root, andclean --orphansremoves a directory when its repository no longer exists, no longer when only the worktree of its last run was removed.
Added
runremoves, at its start, the default work directories under~/Library/Caches/xcmutatethat no run has used for more than 14 days, and prints each one with its root and size.--clean-unused-after <days>(keycleanUnusedAfter) sets the number of days;0turns 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,
runprints the path and size of its work directory and thecleancommand that removes it (dufor at most 5 seconds; not after Ctrl-C). runandcleanremove 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
Fixed
--select-tests reachwith 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
profileand withoutdestination, the action boots nothing and the run takes the destination of the config file (the profile's, else the one ofrun), orplatform=macOSwhen 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 whensimulator-permissionscannot be granted. Before, it passedplatform=macOS, which replaced a simulator of the profile.--profileinargscounts as a profile,--destinationinargsas a destination. Withoutprofile, an emptydestinationis stillplatform=macOS, except with--destinationinargs: the action then adds noplatform=macOS(before, it passed both, and the run had two destinations). - When
xcodebuildfinds 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>orrun) and how to give another one: when the action runs it, its inputdestination, elsewhere--destinationor 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 ofworkersinnightlysays 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
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,offand08are 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.yamlis found too.xcmutate.config.jsonof 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.--configreads a path that ends in.jsonas 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 ofinitand the help of--profilelink 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 restorefor app-hosted tests on a simulator, on a simulator of its own). It writesrunand the profilesprandnightlyintoxcmutate.yml, with the reasons as comments and a link to the description of the keys at the top (into a.jsonfile named with--config: as JSON, with the reasons under_why). An existingxcmutate.ymlkeeps its other keys and comments. Axcmutate.config.jsonat the root is replaced byxcmutate.ymlwith 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,workersonly 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-cacheand--work-dirare used for the trials and written intorun. 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.shchecks it. -
Run options in the config file:
runfor every run andprofiles.<name>withrun --profile <name>(andprofilein the action). The command line wins over the profile, the profile overrun.buildArgstands for--build-arg, and--preparecannot 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--resumecompares; 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 reachwrites 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 warningimpactFallback, 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 (warningimpactSelection).scripts/verify-impact.shchecks 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 withauto. 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. WarningsrestoreUnavailableandrestoreFellBack;restoredStatesandrestoreFallbacksin the JSON report. -
--stop-when-gate-decided(andstop-when-gate-decidedin 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-undercannot be reached; a score that stays above--fail-underin every case passes early when it is the only gate. The run ends like one cut short by--time-limit, withgateDecidedEarly,gateDecisionandpendingKeysin the JSON report, the warninggateDecided, 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 toxcodebuildas 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, asstoppedAtFirstFailurein the JSON report, in the text report and in the time breakdown.--no-stop-at-first-failureruns them to the end underxcodebuild. Not used when the.xctestrunfile asks for random order (warningrandomTestOrder), 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.breakdownin 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
-
--workersgives 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. Whatsimctl privacycannot set is named in the new warningworkerPrivacy. A destination by name that does not name one simulator stops a run with--workersbefore 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, andxcodebuildstarts 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
directLaunchUnavailablesays 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, thexctestagent 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
initno longer leaves a directory in the default DerivedData (xcodebuild -listof a package resolved its packages there).runandcleanremove the lock files thatxcodebuildleaves 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
Added
list --package <dir>: the same narrowing asrun --package <dir>, so thatlist --sincecounts the mutants that the run will make. Without the optionlistbehaves as before.--shared-process auto(andshared-process: autoin 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 anddurations.sharedProcessChoicein the JSON report say which it chose and why.--resumekeeps 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 asprogress.jsonlwith 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-processmakes 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,
xcodebuildhad 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 exceptionin 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'sFatal 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-processand 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 code0x2182bad2), and the warning said only thatsimctldoes not say how the app ended. Underxcodebuildsuch 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 toxcodebuild, 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-processsaid "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, anddurations.sharedProcess.narrowedStartupRunscounts them.--no-narrow-gatemakes 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 githubwrites one::noticewhen no mutant is undetected, instead of nothing. Thexcodeformat still writes nothing then.- The report for agents gives
fixesonly for the kinds of gap that it holds; with every mutant detected,fixesis empty. --packagewith a subdirectory of the repository limits the default files to mutate to that directory, with and without--since(when neither--rootnor 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'spackageinput does the same.
xcmutate 0.13.0
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.
rundoes 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-limitand--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-guideprints it, andagent-guide --installwrites a Claude Code skill, a Codex skill or a section inAGENTS.mdso 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.