MMS • Sergio De Simone

Depop migrated approximately 10,000 unit tests from XCTest to Swift Testing with partial assistance of coding agents, modernizing its testing infrastructure and substantially reducing CI runtime.
According to Depop engineer Anastasia Petrova, team decided to migrate for several reasons, including the recognition that “Swift Testing is where Apple Development is going”, better support for parallel execution, first-class integration with Swift Concurrency, and advanced features like parameterized tests, nested suites, and test traits. Another objective was to standardize the use of Swift Testing across the codebase, as existing tests did not follow any agreed-upon convention.
A key benefit of the migration was test parallelization, which brought a significant reduction in execution time on the CI runner:
Swift Testing runs tests in-process on Swift Concurrency’s cooperative thread pool, so when one test suspends on await, another test uses that thread. That is a much better fit for a small VM, and our early benchmarks showed roughly an 80% runtime improvement between XCTest with no parallelization and Swift Testing with it.
As mentioned, AI agents played only a supporting role in the migration. The team preferred a manual, syntax-based approach based on swift-testing-revolutionary, an open-source SwiftSyntax-based converter enforcing Apple’s migration guidance. There were several reasons why the team chose not to rely entirely on AI for the migration:
Even with strict instructions, AI tended to subtly modify tests beyond the mechanical mapping. In some cases, the conversion looked less as a syntactic transformation, and more as a “rewrite” or a slight refactoring of tests. While this approach would still work fine in general, and maybe even produces slightly better tests, it would dramatically complicate the review process.
However, an agent orchestrated the whole process, from running the conversion script and executing the tests to opening a PR. When test execution across 100 repetitions revealed no errors or flakiness, and the PR did not include any changes to the codebase, the PR was auto-approved. When test execution failed, the agent was instructed to fix the test and the PR flagged for human review.
Petrova explains that a few unexpected issues arose during the migrations process, including data races, testing passing locally and failing on CI, limitations of the converter, and the overhead of PR review. Most data races where resolved giving each test its own instance or using @Suite(.serialized) to temporarily force serialization. CI-only failures were primarily related to UI-related tests executing on secondary threads, which was addressed by forcing all UI-related tests to be @MainActor-isolated. Finally, automatic conversion did not automatically leverage advanced Swift Testing features like parameterized tests, nested suites, and test traits, which required a separate manual refactoring effort.
While Depop used AI primarily as an orchestrator for its migration, other companies have experimented with a greater degree of AI involvement. For example, Sixt engineer Ibrahim Oktay described how they rewrote 7,000 unit tests using AI, completing the work in a single afternoon at an AI cost of just $106. According to Oktay, the key to this approach was develooping a custom conversion agent equipped with ~1200 migration rules specific to their app’s architecture.