A.4 Summary
In this appendix, you learned about unit testing and how to write unit tests in Swift.
Unit tests are little tester programs that live alongside productive app code. Every time unit tests are executed, they test your app code through precoded test cases, ensuring that the given inputs produce the expected outputs.
In the programming paradigm called test-driven development (TDD), tests and functions are developed simultaneously, ensuring a high test coverage rate and robust tests.
In Swift, there are two options to code unit tests. XCTest is the legacy syntax, offering a traditional approach based on inheritance, naming conventions, and assertions. Swift Testing is the new syntax, offering a modern approach based on annotations ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access