© Gio Lodi 2021
G. LodiTest-Driven Development in Swifthttps://doi.org/10.1007/978-1-4842-7002-8_2

2. XCTest Introduction

Gio Lodi1  
(1)
Mount Martha, VIC, Australia
 

In the previous chapter, we saw how to write code that tests code. While it was fun to construct a few functions to help us with that, to be productive and professional, it’s much better to use a testing library.

A testing library, or framework in Swift terminology, provides the scaffold on which to build tests, run them, and gather their results. In the Apple ecosystem, XCTest is the default testing framework, and it comes bundled with the Xcode IDE.

If you like to get to know your tools before starting to work with them, you’ll enjoy the following XCTest overview. If, on the other hand, ...

Get Test-Driven Development in Swift: Compile Better Code with XCTest and TDD 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.