Testing logic with XCTest

Even if you haven't written any tests before, you might have thoughts or ideas about it. To start testing code, you don't need to have a computer science degree or spend days studying the absolute best way to test your code. In fact, the chances are that you're already testing your code and you don't even know it.

So, what does it mean to test your code? That's what this section aims to make clear. You will first read about the different types of tests you can write. Then, you'll learn what XCTest is and how you can set up a test suite for an app. Finally, you'll learn how to optimally test some actual code and how code can be refactored to make it more testable.