Chapter 3: Test-Driven Development in Xcode
For test-driven development (TDD), we need a way to write and execute unit tests. We could write the tests into the main target of our Xcode project but that would be impractical. We would have to separate the test code from the production code somehow, and we would have to write some scripts that execute the text code and gather feedback about the results of the tests.
Fortunately, this has already been done. It all started in 1998, when the Swiss company Sen:te developed OCUnit, a testing framework for Objective-C (hence the OC prefix). OCUnit was a port of SUnit, a testing framework that Kent Beck had written for Smalltalk in 1994.
With Xcode 2.1, Apple added OCUnit to Xcode. One reason for this step was that they used it to develop Core Data at the same time that they developed Tiger, the OS with which Core Data was shipped. Bill Bumgarner, an Apple engineer, wrote this later in a blog post: