Should I migrate to Swift Testing?

Asked on 2026-07-08

1 search

Yes — Apple’s guidance is to migrate to Swift Testing, especially for new tests and for gradually modernizing existing XCTest suites.

Why migrate

  • Modern API: Swift Testing uses expressive macros like @Test, #expect, and #require.
  • Better Swift fit: It was designed with Swift concurrency in mind and runs tests in parallel by default.
  • Cross-platform: It’s open source and works across Apple platforms, plus other platforms like Linux and Windows.
  • Incremental migration is supported: You can keep XCTest and Swift Testing in the same target and move tests over in small chunks.

Apple’s recommended approach

From Migrate to Swift Testing:

  • Don’t feel pressured to rewrite everything at once
  • Start by writing new tests in Swift Testing
  • Migrate frequently changed tests first
  • Use test framework interoperability to reuse existing helper code during the transition

When to keep XCTest

Apple says to keep using XCTest for a few cases:

  • UI Automation
  • Performance Testing APIs
  • Tests involving Objective-C exceptions

Bottom line

If your project can use Swift Testing, yes, migrate — but do it incrementally. Apple presents it as the modern direction for Swift testing, while still acknowledging that XCTest remains necessary in some scenarios.

If you want, I can also summarize the exact migration strategy Apple recommends.

Should I migrate to Swift Testing? | Ask WWDC