DoorDash Used Copilot to Convert Its XCTest-Based iOS Test Suite to Swift Testing
Sergio De Simone ยท article ยท 2026-05-09 source โ Reader ๐ฅ๏ธ
DoorDash migrated its iOS test suite from XCTest to Swift Testing at scale by combining AI-assisted code transformation (Cursor/Copilot with migration rules) with strict reliability gates (ten-consecutive-pass requirement), achieving ~60% faster CI tests while surfacing hidden concurrency defects that sequential execution had masked.
practical ยท case study report โ Third-party InfoQ summary of a DoorDash engineering blog post. Reports a specific migration project โ tools, process, and quantified outcomes โ with minimal theoretical framing.
Structure
| Part | Role |
|---|---|
| Problem statement: CI bottleneck from serialized XCTest | Establishes the business pain โ double-digit-minute CI runs slowing all engineers |
| Performance case for Swift Testing | Presents benchmark data: 4-7x faster via parallelism, plus richer failure diagnostics |
| Organizational model: team-owned migration with shared tooling | Describes the scaling strategy โ each team migrates its own tests using common tools and guidelines |
| AI-assisted tooling stack: Cursor + SweetPad + custom MCP server | Details the developer environment and the 'migration rule' that automates mechanical conversion |
| Reliability gates: ten-consecutive-pass rule | Describes the quality bar that each migrated test must meet |
| Bazel adoption mid-migration | Shows adaptability โ extended the agent workflow to include Bazel test commands |
| Hidden defects surfaced by parallelism | Reports that shared state, order dependencies, and timing assumptions were exposed |
| Quantified outcomes | Summarizes results: ~60% faster tests, ~40% faster builds, reduced costs |
Key terms
- Swift Testing
Apple's modern test framework using #expect macros and @Test attributes, with native parallel execution for both sync and async code - migration rule
A Cursor prompt/configuration that automates the mechanical conversion patterns from XCTest to Swift Testing (import changes, assertion rewrites, macro insertion) - ten-consecutive-pass rule
A reliability gate requiring each migrated test to pass ten consecutive runs before being accepted, eliminating flakiness and timing sensitivity - SweetPad
A VS Code extension providing Xcode integration, used to build targets and run tests from within the editor - custom MCP server MCP (Model Context Protocol)
A locally-running server exposing an execute_vscode_command tool that lets the AI agent trigger builds and test runs directly
Propositions
- empiricalSwift Testing is 4-7x faster than XCTest due to native parallel execution of both synchronous and asynchronous tests
- empiricalcorroboratedAI coding assistants can reliably automate mechanical code migration when paired with strict reliability gatessupportsArchitecture as Code to Teach Humans and Agents About Architecture ยท p3 โ Empirical instance: AI migration became reliable only when strict deterministic reliability gates defined success.refinesCloudflare Launches Code Mode MCP Server to Optimize Token Usage for AI Agents ยท p4 โ Conditions Cloudflare's assumed LLM code-generation correctness: DoorDash found LLM codegen reliable only when paired with strict verification gates (ten consecutive passes).supportsAgents don't know what good looks like. And that's exactly the problem. ยท p5 โ Empirical case: AI migration was reliable only when paired with strict reliability gates (ten consecutive passes), evidence that deterministic guardrails are what make agents safe.supports โHow Datadog Used Claude and Cursor for Test-Driven Production Migration ยท p1 โ Datadog's conclusion that the test suite's strength set the trust ceiling is a second production instance of DoorDash's claim that AI can reliably automate mechanical code migration when paired with strict reliability gates โ here the gate is the comprehensive test suite plus the live validator.
- empiricalThe #expect macro delivers richer failure messages than XCTAssert, accelerating debugging
- empiricalSequential test execution masks concurrency defects (shared state, order dependencies, timing assumptions) that parallel execution exposes
- practicalcorroboratedTooling-first, team-owned migration with shared guidelines scales better than centralized migrationsupports โThe Hard-Stop Rule: From 3 HCM Monoliths to 120 Domain Microservices ยท p4 โ Both argue that tooling/platform investment owned close to the team, rather than a centralized migration program, is what actually scales a large migration.
- empiricalThe migration delivered ~60% faster test execution in CI and ~40% faster overall builds
Arguments
The XCTest-to-Swift-Testing migration was worth the investment
Implicit premises:
- CI pipeline speed is a meaningful lever for engineering productivity
- The cost of building the tooling and running the migration was less than the ongoing CI cost savings
AI-assisted migration can be made reliable through strict post-migration verification
Implicit premises:
- Ten consecutive passes is a sufficient threshold to detect flakiness
- The agent's error-fixing capability is good enough to resolve most migration issues without human intervention
Narratives
โ
Questions addressed
- โ
How can a large iOS team migrate from XCTest to Swift Testing at scale?
Team-owned migration with shared AI tooling (Cursor + migration rules) and strict reliability gates (ten-consecutive-pass rule) - โ
What tooling and process safeguards make AI-assisted code migration reliable?
Migration rules for mechanical conversion, custom MCP server for in-editor builds/tests, and a ten-pass gate to catch flakiness - โ
What performance gains does Swift Testing offer over XCTest?
4-7x faster in benchmarks; ~60% faster CI tests and ~40% faster builds in production - โ
What hidden defects does parallel test execution surface?
Shared state, order dependencies, and timing assumptions previously masked by sequential execution
Gaps
- missing evidenceNo data on what fraction of migrations the AI completed without human intervention vs. those requiring manual fixes
- unjustified assumptionThe ten-consecutive-pass threshold is presented without justification โ why ten and not five or twenty?
- scope omissionNo discussion of tests that could not be migrated (e.g., UI tests, tests with XCTest-specific features)
- missing evidenceCost of building the tooling (MCP server, migration rules, Bazel integration) is not quantified against the savings
- inconsistencyThe article conflates Copilot and Cursor โ the title says 'Copilot' but the body describes Cursor throughout
- scope omissionNo mention of how the migration handles XCTest-specific patterns like setUp/tearDown lifecycle or XCTestCase subclassing
Closes gaps elsewhere
- [FULL WORKSHOP] AI Coding For Real Engineers - Matt Pocock, AI Hero ยท g1 โ Provides a non-TypeScript, mobile (iOS/Swift) data point: DoorDash manufactured the missing fast feedback loop via strict reliability gates (ten consecutive passes, Bazel integration) to make agent-driven migration work at scale.
- 11) AI-spesial med Vilde Opsal og Anders Sveen ยท g4 โ Gives a concrete worked example of what an eval for code-agent output looks like: a deterministic ten-consecutive-pass reliability gate applied to each AI-migrated test before acceptance.
- The Organization Is the Bottleneck ยท g5 โ Partially addresses whether AI can build the missing foundations itself: DoorDash used coding agents to modernize its own test-suite safety net (tooling-first, team-owned, gated migration) rather than requiring the foundation to pre-exist.
Related documents
- Agents don't know what good looks like. And that's exactly the problem.
- Cloudflare Launches Code Mode MCP Server to Optimize Token Usage for AI Agents
- Architecture as Code to Teach Humans and Agents About Architecture
- Grafana's gcx and MCP Server Reach GA for Telemetry-Driven Agent Development
- 11 Tips For AI Coding With Ralph Wiggum
- Addy Osmani's Post
- Agent Skills: Google-Backed AI Coding Agent Workflow
- Have your agent record video demos of its work with shot-scraper video
- Agentic AI and Code Reviews
- Presentation: From AI Agent Demo to Production: Automated Testing and Evaluation