DoorDash Used Copilot to Convert Its XCTest-Based iOS Test Suite to Swift Testing

· Source: InfoQ · Field: Technology & Digital — Software Development & Engineering, Artificial Intelligence & Machine Learning · Depth: Intermediate, quick

Summary

DoorDash successfully migrated its extensive iOS XCTest-based test suite to Swift Testing, leveraging Copilot and robust reliability safeguards. This modernization effort, detailed by engineer Matheus Gois, yielded significant performance improvements, with Swift Testing proving four to seven times faster than XCTest due to parallel execution capabilities for both synchronous and asynchronous code. The migration also enhanced failure diagnostics through the `#expect` macro, accelerating debugging. To scale this transition across the company, DoorDash implemented a tooling-first approach, empowering individual teams with shared guidelines and a developer-friendly environment featuring Cursor, SweetPad, and a custom MCP server. This process resulted in approximately 60% faster test execution in CI, 40% faster overall builds, reduced infrastructure costs, and reclaimed developer time.

Key takeaway

For engineering leaders overseeing large, legacy test suites, consider adopting AI coding assistants like Copilot to accelerate modernization efforts. Your teams can define specific migration rules to automate syntax conversions, freeing engineers to focus on correctness. Implement rigorous reliability gates, such as requiring multiple consecutive passes, to ensure the stability of newly migrated tests and prevent the introduction of flakiness into your CI/CD pipelines.

Key insights

Automated migration with AI assistants and strict reliability gates can modernize large test suites efficiently.

Principles

Method

DoorDash used Cursor with a "migration rule" to automate XCTest to Swift Testing conversion, including `XCTAssert` to `#expect` and `@Test` macro insertion, then validated each migrated test with ten consecutive successful runs.

In practice

Topics

Best for: CTO, VP of Engineering/Data, Machine Learning Engineer, Software Engineer, AI Engineer, MLOps Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by InfoQ.