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