Chapter 10: Testing Networking Code
Almost all iOS apps communicate with some kind of server to synchronize data to other devices or to provide additional features that are not possible on the iOS device alone. As the code of the server application is separate from the code of the iOS application, the unit tests for the iOS app should not test features implemented in the server application. The unit tests for the iOS app should only fail if the code of the iOS app has bugs.
To achieve that, the unit tests need to be independent of the server application. This separation has several advantages. The main ones are as follows:
- The unit tests are faster when they don't need to wait for the responses of the server.
- The unit tests do not fail because ...
Get Test-Driven iOS Development with Swift - Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.