DoorDash successfully migrated their XCTest-based iOS test suite to Swift Testing using GitHub Copilot, achieving significant performance improvements and modernizing their testing infrastructure.
In the competitive landscape of mobile app development, test suite performance can make or break developer productivity. DoorDash recently undertook a significant modernization of their iOS testing infrastructure, migrating from XCTest to Swift Testing with the assistance of GitHub Copilot. This strategic move delivered substantial performance gains while maintaining rigorous quality standards, according to DoorDash engineer Matheus Gois.

The Performance Imperative
DoorDash's iOS development team faced a common but critical challenge: their XCTest-based test suite had become a bottleneck in their continuous integration pipeline. "Slow, mostly serialized XCTest runs had clogged DoorDash's iOS continuous integration, or CI, pipelines," Gois explained. "As our apps and shared packages grew, the CI test step stretched into double-digit minutes, consumed more CI resources, and slowed iteration for every engineer."
The anticipated benefits of migrating to Swift Testing included improved performance and better failure diagnostics. Benchmarks confirmed that Swift Testing was four to seven times faster than XCTest, primarily due to its ability to run tests in parallel for both synchronous and asynchronous code. Additionally, the #expect macro delivers richer failure messages, which helps accelerate debugging—something that becomes increasingly important as test suites grow.
A Systematic Migration Approach
To ensure a successful migration across their organization, DoorDash implemented a multi-faceted approach that balanced automation with human oversight:
- Team Ownership: Each team owned the migrations of their own tests, using a common set of tools and shared guidelines
- Tooling-First Approach: A consistent, repeatable workflow common to all teams
- Reliability Gates: Strict measures to minimize the risk of flakiness in migrated tests
The technical implementation leveraged several innovative tools and techniques. DoorDash engineers built a developer-friendly environment using the AI coding assistant Cursor, SweetPad for Visual Studio Code/Xcode integration, and a custom MCP (Model Context Protocol) server enabling engineers to build targets and run tests before and after the migration directly within the editor.
"The main tool exposed is execute_vscode_command, which takes a commandId such as sweetpad.build.build or sweetpad.build.test and runs that action," Gois described. "The server starts automatically when the SweetPad extension activates and stops when the editor closes."
Automating the Conversion Process
The core of the migration was a custom "migration rule" created for Copilot that automated most of the mechanical conversion from XCTest to Swift Testing. This rule handled:
- Changing import statements
- Converting XCTAssert to #expect
- Inserting the @Test macro
- Handling async/await where required
- Other syntactic transformations
This automation allowed engineers to focus on test correctness rather than syntax changes, significantly accelerating the migration process.

Ensuring Reliability in a Parallel World
A critical challenge in the migration was ensuring that tests remained reliable after moving to Swift Testing's parallel execution model. To address this, DoorDash implemented a strict reliability requirement: each migrated test had to pass ten consecutive runs, eliminating any flakiness and time sensitivity before adoption.
Midway through the migration, DoorDash adopted Bazel, which required them to extend their agent workflow. "Specifically, they included the bazel test commands directly in the prompt, enabling the agent to run tests locally without manual intervention," Gois noted. "This also supported an iterative loop in which the agent would run the tests and fix any errors surfaced, and repeat the process until it got a clean execution."
This approach kept Bazel at the center of their reliability story. "It does not matter whether the tests are triggered from a local terminal or through SweetPad and Cursor," Gois emphasized. "The same targets run, the same ten-run rule applies, and every package is held to the same standard."
Uncovering Hidden Issues
The migration process revealed issues that had been masked by XCTest's largely sequential execution. "This process surfaced hidden issues—such as shared state, order dependencies, and timing assumptions," Gois explained. "All of those were masked by XCTest's largely sequential execution but exposed by Swift Testing's parallel model."
These discoveries, while challenging in the short term, ultimately led to a more robust and reliable test suite. By addressing these issues during the migration, DoorDash improved the overall quality of their testing infrastructure.
Tangible Results and Benefits
The migration to Swift Testing delivered impressive results:
- Approximately 60% faster test execution in CI
- About 40% faster overall builds
- Reduced infrastructure costs
- Reclaimed developer time
These improvements translate directly to faster development cycles and more efficient use of engineering resources—critical advantages in a competitive market like food delivery.
Broader Implications for Mobile Development
DoorDash's experience offers valuable insights for organizations considering similar migrations:
AI-Assisted Migration is Feasible: The successful use of Copilot for test conversion demonstrates that AI tools can effectively handle complex code transformations when properly guided.
Parallel Execution Exposes Hidden Issues: Moving to a parallel test runner like Swift Testing can uncover problems that sequential execution masks, leading to ultimately more reliable tests.
Tooling Ecosystem Matters: Custom tools and integrations (like the SweetPad extension and MCP server) can significantly improve the developer experience during migrations.
Reliability Requires Rigorous Testing: Automated migrations need robust validation processes to ensure quality isn't compromised.
For organizations with large XCTest-based codebases considering a move to Swift Testing, DoorDash's approach provides a proven blueprint for achieving modernization while maintaining quality and developer productivity.

Comments
Please log in or register to join the discussion