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

3. Getting Started with Test-Driven Development

Gio Lodi1  
(1)
Mount Martha, VIC, Australia
 

In the previous chapters, we talked about the advantages of using tests to drive the design of the code and how to write tests using Apple’s XCTest framework. It’s now time to see concrete examples of Test-Driven Development.

We’ll learn how to implement a piece of logic as an iterative process of writing tests and then making them pass. We’ll see how TDD lets us focus first on getting the code right and then on making it clean. Finally, we’ll discover how, in a language like Swift, the compiler complements the feedback loop that drives the software implementation ...

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.