Skip to main content

📘 Test-Driven iOS Development in Swift

This resource is a comprehensive guide to applying Test-Driven Development (TDD) in iOS app development using Swift 5.5. It covers the essentials of TDD, including unit tests, integration tests, and UI tests, providing practical examples and exercises throughout.

Details

URL: 🔗 https://www.oreilly.com/library/view/test-driven-ios-development/9781803232485/

Published: March 2022

Authors: Dr. Dominik Hauser

Tags:
TDD, Swift, iOS Development, Unit Testing, Xcode, Combine, SwiftUI

Key Points

  • In-depth coverage of TDD principles and practices in iOS development
  • Practical examples and exercises for hands-on learning
  • Focus on writing maintainable, flexible, and extensible code
  • Covers unit tests, integration tests, UI tests, and snapshot tests
  • Introduces Combine framework, async/await, and SwiftUI testing

Summary of Contents

  • Introduction:

    • Importance of TDD in agile software development
    • Overview of the book's structure and objectives
  • Section 1: The Basics of Test-Driven iOS Development

    • Chapter 1: Your First Unit Tests:
      • Introduction to unit tests and writing the first test case
    • Chapter 2: Understanding Test-Driven Development:
      • TDD workflow: red, green, refactor
      • Advantages and disadvantages of TDD
    • Chapter 3: Test-Driven Development in Xcode:
      • Using Xcode for TDD, running tests, debugging, and using the test navigator
  • Section 2: The Data Model

    • Chapter 4: The App We Are Going to Build:
      • Overview of the app and setting up the project
    • Chapter 5: Building a Structure for ToDo Items:
      • Implementing and testing the ToDoItem struct
    • Chapter 6: Testing, Loading, and Saving Data:
      • Storing and loading data with Combine and testing asynchronous code
  • Section 3: Views and View Controllers

    • Chapter 7: Building a Table View Controller for the To-Do Items:
      • Writing tests for table views and using diffable data sources
    • Chapter 8: Building a Simple Detail View:
      • Testing UI elements and user interactions
    • Chapter 9: Test-Driven Input View in SwiftUI:
      • Testing SwiftUI views using ViewInspector
  • Section 4: Networking and Navigation

    • Chapter 10: Testing Networking Code:
      • Writing tests for async/await code and handling errors
    • Chapter 11: Easy Navigation with Coordinators:
      • Testing navigation between view controllers and fixing common bugs
Link to the Book