I Migrated 50K Lines From XCTest to Swift Testing: The Wins, the Scars, and the Call I’d Make Today
Photo: Intel Free Press, CC BY-SA 2.0, via Wikimedia Commons
Last spring, our team in Austin made the call: move the unit-test suite of a 50K-line iOS app from XCTest to Swift Testing. Not a pilot. Not a side project. A real migration, done alongside feature work, with a release train that did not stop. By early 2026, the suite was mostly converted. Here’s what actually happened.
The trigger was not hype
We had about 3,100 tests. XCTest worked, but async tests were noisy, parameterized cases duplicated code, and test names read like testThatPushesRoute_whenSignedIn(). Swift Testing’s macros promised better failure output and less ceremony. The pitch was simple: less boilerplate, faster feedback.
That was enough. We did not migrate because it was new. We migrated because our test suite had become a maintenance tax.
What got faster
Test discovery and parallel execution were cleaner. Parameterized tests with @Test(arguments:) collapsed hundreds of near-duplicate cases into readable tables. #expect failures pointed at the exact expression instead of a vague line number, which cut the time I spent rereading test setup.
We deleted roughly 900 lines of fixture and helper code. CI runtime dropped about 18%, though I’d credit most of that to collapsing duplicate parameterized cases, not to framework magic. Async tests felt better too: async throws and structured concurrency fit the framework instead of fighting it.
What broke first
Expectations. XCTestExpectation does not map one-to-one. confirmation exists, but behavior around multiple fulfillments and timeouts required rewrites. Some tests depended on setUpWithError ordering and shared mutable state. Swift Testing’s suite model made that isolation problem visible—and then made those tests fail.
UI tests still need XCTest. Performance tests still need XCTest. Plenty of third-party helpers import XCTest. Our custom CI reporter expected XCTest-style XML, so we had to build a second ingestion path. Objective-C tests stayed put. None of this was fatal, but it was real work.
The side-by-side strategy that saved us
We did not do a big-bang conversion. We kept the existing XCTest target for UI tests, performance tests, and anything touching Objective-C. We created a separate Swift Testing target for converted unit tests. Shared helpers moved into a local package so both targets could use them.
CI ran both lanes. We converted folder by folder: pure logic first, then view models, then async services. We stopped before UI tests. That boundary kept the migration boring, which is exactly what you want when you are shipping every two weeks.
The decision framework I’d use today
Migrate now if your unit tests are greenfield, your async surface is growing, your CI can ingest new result formats, and your team is comfortable running two test frameworks for a quarter. Migrate later if you are UI-test heavy, carry Objective-C, depend on custom reporters, or are in a release freeze. Hybrid is not a failure. Hybrid is the sane default for most teams I talk to.
Tips if you go
Start with pure functions and value types. Use parameterized tests aggressively—they are the clearest win. Keep suites shallow; @Suite is for grouping, not inheritance cosplay. Name tests as sentences with @Test descriptions. Pin your toolchain so a random CI update does not rewrite failure output mid-sprint. Budget 20% more time than you think, and run both frameworks in CI for at least a quarter.
What still feels unfinished
The reporting story is not fully settled. UI testing has no real migration path yet. Mixed-target projects still feel like two toolchains pretending to be one. And every time I write confirmation, I miss the muscle memory of XCTestExpectation for about five seconds.
Would I do it again? Yes—for unit tests, with the same hybrid boundary. But I would not sell it as a clean rewrite. It is a migration, and migrations leave marks.