29 Unit Testing

As you implement a new feature in your application, you will want to ensure that the feature works the way that you intend it to. The fastest and most reliable way to verify that your code works is to write automated tests and run them against your code often. As you are building a new feature, you can repeatedly run your automated tests to guarantee that the code that you have written results in the behavior that you want.

Unit testing is a particular kind of automated testing in which the individual components, the units, of your application are tested. These units are the building blocks of your application. Typically, they are your application’s classes.

The advantage of testing units is that you are able ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.