Jacob’s Tech Tavern

Jacob’s Tech Tavern

Migrating XCTest to Swift Testing

Convert your entire test suite in minutes

Jacob Bartlett's avatar
Jacob Bartlett
Oct 14, 2024
∙ Paid
11
1
Share

Swift Testing, introduced with Xcode 16, was one of the neatest additions to our iOS engineering toolkit in a long time. Building on similar foundations to SwiftData the year before, it utilised macros to offer clean, flexible, expressive APIs for our tests.

I naturally wanted to convert Bev, my handy battle-hardened sample project. But I wanted to make it more useful than that:

I wanted to create something you could apply yourself to any-sized codebases, to migrate in minutes and not months.

I discovered how to migrate my entire test suite from XCTest to Swift Testing semi-automatically. I’ve come up with a set of techniques that can apply to your entire codebase at once.

We’ll start with the low-hanging fruit and work outwards to the more complex edge-cases.

Paid subscribers get full access to this article, plus my full Quick Hacks library. You’ll also get all my long-form content 3 weeks before anyone else.

Keep reading with a 7-day free trial

Subscribe to Jacob’s Tech Tavern to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Jacob Bartlett
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture