what's new in Unit test
Generated on 3/4/2025
1 search
In the context of unit testing, several new features and improvements were introduced at WWDC 2024, particularly focusing on Swift Testing and Xcode 16:
-
Swift Testing:
- Swift Testing is now the default testing solution in Xcode 16. It provides expressive APIs, making it simple to write tests. It is cross-platform and developed as an open-source package.
- Tests are written by adding a function with a
@test
attribute to your test suite. You can use macros like#expect
to evaluate the result of Swift expressions. - Swift Testing supports parameterized tests, allowing each provided argument to run in parallel as its own test case.
- Tags can be used to organize and filter tests, making it easier to manage large test suites. Tags can be applied to individual tests or entire suites, and tests can be grouped by these tags in the test navigator.
-
Xcode 16:
- Xcode 16 introduces improvements to the test navigator, allowing for better organization and execution of tests. You can use quick actions to rerun specific tests quickly.
- The test macro in Swift Testing allows for parameterized tests, where each argument runs as its own test case, and the navigator displays each case individually.
- The test plan editor has been redesigned to help manage test plans more effectively, including the ability to save tag preferences.
For more detailed information, you can refer to the sessions Meet Swift Testing and Go further with Swift Testing.

Xcode essentials
Edit, debug, commit, repeat. Explore the suite of tools in Xcode that help you iterate quickly when developing apps. Discover tips and tricks to help optimize and boost your development workflow.

What’s new in Swift
Join us for an update on Swift. We’ll briefly go through a history of Swift over the past decade, and show you how the community has grown through workgroups, expanded the package ecosystem, and increased platform support. We’ll introduce you to a new language mode that achieves data-race safety by default, and a language subset that lets you run Swift on highly constrained systems. We’ll also explore some language updates including noncopyable types, typed throws, and improved C++ interoperability.

What’s new in Xcode 16
Discover the latest productivity and performance improvements in Xcode 16. Learn about enhancements to code completion, diagnostics, and Xcode Previews. Find out more about updates in builds and explore improvements in debugging and Instruments.

Meet Swift Testing
Introducing Swift Testing: a new package for testing your code using Swift. Explore the building blocks of its powerful new API, discover how it can be applied in common testing workflows, and learn how it relates to XCTest and open source Swift.

Platforms State of the Union
Discover the newest advancements on Apple platforms.

Go further with Swift Testing
Learn how to write a sweet set of (test) suites using Swift Testing’s baked-in features. Discover how to take the building blocks further and use them to help expand tests to cover more scenarios, organize your tests across different suites, and optimize your tests to run in parallel.