In this chapter, we took a look at how to implement a View Controller with a table view using TDD. We split the table View Controller into code that manages the view hierarchy and code for the data source, and the delegate of the table view.
We discussed how to write tests to drive the development of sub views, outlets, and actions and how to use fake objects to isolate the micro feature to be tested. The usage of mock objects allowed us to create fast, isolated, and reliable tests. This way, we were able to write tests for the table view cell without the need to instantiate the real data source of the table view.
Next, we implemented the detail View Controller using TDD. We added MapKit to the project in order to show the location of the to-do item in case a user added an address.
Finally, we wrote tests to drive the implementation of the input View Controller. We also took a look at how to stub an asynchronous API to make the test execution fast.
In this chapter, we set up the system under tests using code and instantiating from a storyboard. You should now be able to use both techniques depending on the feature you test.
In the next chapter, we will take a look at how to build the network layer of the app using TDD without a finished server side.