Jump to ratings and reviews
Rate this book

Test-Driven Development in Swift: Compile Better Code with XCTest and TDD

Rate this book
Leverage Swift to practice effective and efficient test-driven development (TDD) methodology. Software testing and TDD are evergreen programming concepts—yet Swift developers haven't widely adopted them. What's needed is a clear roadmap to learn and adopt TDD in the Swift world. Over the past years, Apple has invested in XCTest and Xcode's testing infrastructure, making testing a new top priority in their ecosystem. Open-source libraries such as Quick and Nimble have also reached maturity. The tools are there. This book will show you how to wield them. 

TDD has much more to offer than catching bugs. With this book, you’ll learn a philosophy for building software. TDD enables engineers to solve problems incrementally, writing only as much code as necessary. By decomposing big problems into small steps, you can move along at a fast pace, always making visible progress. 

Participate in the test-driven development journey by building a real iOS application and incorporating new concepts through each chapter. The book's concepts will emerge as you figure out ways to use tests to drive the solutions to the problems of each chapter. Through the TDD of a single application, you’ll be introduced to all the staples and advanced concepts of the craft, understand the trade offs each technique offers, and review an iterative process of software development. 

Test-Driven Development in Swift provides the path for a highly efficient way to make amazing apps.

What You'll Learn



Write tests that are easy to maintain
Look after an ever-growing test suite
Build a testing vocabulary that can be applied outside the Swift world
See how Swift programming enhances the TDD flow seen in dynamic languages 
Discover how compiler errors can provide the same helpful guidance as failing tests do


Who This Book Is For


Mid-level developers keen to write higher quality code and improve their workflows. Also, developers that have already been writing tests but feel they are not getting the most out of them. 

319 pages, Kindle Edition

Published July 1, 2021

4 people are currently reading
7 people want to read

About the author

Gio Lodi

1 book26 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
7 (58%)
4 stars
3 (25%)
3 stars
2 (16%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 of 1 review
Profile Image for Hoon Wee.
44 reviews2 followers
August 23, 2023
The author explains very well how to write test in Swift & SwiftUI.
I like the idea that we should separate view-model from our SwiftUI view for better testability.
Surely, following practices in this book will automatically grow your Swift project to be more reliable and less error-prone.
Displaying 1 of 1 review

Can't find what you're looking for?

Get help and learn more about the design.