Chapter 12. Unit Testing

<feature><title>In This Chapter</title>
  • Creating a Unit Test Harness

  • Testing an Application from Within

  • Refactoring

</feature>

All of our development of Linrg and Linear so far has left out one essential consideration: How do we know it works?

Yes, we know generally what to expect, and we have used the Xcode debugger to verify that what the application does makes sense, but we don’t have the time or the discipline to test for every possible error, every time. Nor to repeat those tests every time our code changes—which is the only way to be sure of catching bugs as soon as possible after we introduce them. This discipline of verifying that each little part of your application works is called unit testing. The meticulous search ...

Get Xcode 3 Unleashed 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.