Unit tests in action

Let's get started with writing our first unit tests in Xcode. First, we'll start off in a clean project while we learn the basics, and then later on we'll integrate unit testing into our Snippets project.

In this section, we'll start by learning how to set up a project with unit testing capabilities. Then we'll take a look at how to write a unit test using the XCTest framework. Finally, we'll take a look at how to run our tests and measure their results.

Setting up the project

Time to set up a new project, you know the drill. But not so fast! This time we're going to be exploring the last two settings that we haven't yet used in the project creation process: the Include Unit Tests and Include UI Tests options (seen in Figure ...

Get Learning Xcode 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.