Test-Driven Development

Now that we have a good handle on how to create a unit test, we are going to delve into the realm of test-driven development (TDD). TDD, in a nutshell, is figuring out the least number of objects you need to create in order to get your application to work the way you want it to. TDD utilizes the idea that you will write your tests first rather than after you have already completed your application.

If we write tests for the app now, we’ll just be checking functionality we already know works. In TDD, we write the test first, fail for lack of any working functionality, then press ahead and actually create the functionality.

Why do we want to do all this extra work before we write a line of code? Let’s jump in the Way ...

Get iOS 8 SDK Development, 2nd 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.