What’s new in testing — WWDC 2020

Praveen Kumar
Aleph Publications
Published in
6 min readJul 18, 2020

--

Apple has announced some new APIs and improvements for the XCTest framework in WWDC 2020. Let’s explore these in this article.

Improved error representation and stack traces for easy navigation

It’s very common to share code between test cases by refactoring common parts into re-usable functions. See the example below:

I have written a function to check that there are no white spaces in a string. In the above tests, the first one will fail and the second one will be a pass. Let’s see how Xcode 11.4 will display the error messages.

You can see that the error is shown inline 31, but the actual failure is in line 21. If we run the same tests in Xcode 12 you will see something like this:

--

--