Integration tests

In Chapter 6, Putting It All Together, we saw that unit tests could only test micro features in isolation. The next step would be to use integration tests to make sure that individual features play well together. In integration tests, you do not mock other components. Instead, you use the real implementation and write tests that make sure that the different parts of the code base interact with each other in the way you anticipated.

You can also use XCTest to implement integration tests. But the setup is more complicated than in the tests we have seen in this book. You use real classes and structs, and even network requests can fetch real data from a web service. What makes integration tests more complicated is that you don't want ...

Get Test-Driven iOS Development with Swift 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.