Use XCTest, which Apple provides out of the box with XCode, to test all networking and model layers and plan classes. This is your opportunity to test against several different edge cases since it’s easy to simulate different conditions. Unit testing your controllers is complicated because controllers rely on the UIKit controller life cycle that's not available in the test environment. Therefore, it’s easier to use UI Testing (also provided by Apple with XCode) to write integration tests. Write a few of them covering your happy paths.
Adding your tests on CI and running them automatically on every commit to your mainline branch will help you avoid timely manual tests or a failing app. Your tests will always be up to date and work for you instead of getting in the way.
What You Will Learn
- Do test-driven development with Xcode
- Write robust tests covering just the use cases you need
- Use automated testing to avoid wasting time
Who This Video Is ForSoftware developers and team leads working with Swift on iOS applications in an Apple environment.
- Title: Practical Test-Driven Development with Xcode and Swift: Write Modularized Code for TDD with XCTest and UIKit
- Release date: November 2020
- Publisher(s): Apress
- ISBN: 9781484266670
You might also like
51+ hours of video instruction. Overview The professional programmer’s Deitel® video guide to Python development with …
40 Algorithms Every Programmer Should Know
Learn algorithms for solving classic computer science problems with this concise guide covering everything from fundamental …
Building Microservices, 2nd Edition
Distributed systems have become more fine-grained as organizations shift from code-heavy monolithic applications to smaller, self-contained …
Head First Design Patterns, 2nd Edition
You know you don’t want to reinvent the wheel, so you look to design patterns—the lessons …