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 ...