Chapter 17: Creating Unit Tests
In This Chapter
Introducing unit testing Understanding unit testing in Xcode Creating a project for unit testing Creating a test case Running tests
Unit testing is a powerful software engineering technique that's supported in Xcode. This chapter outlines the technique so you can understand the theory behind unit testing, and it explains how to use unit testing in practice.
Introducing Unit Testing
You can test software in many ways, and software engineering has evolved formal processes that can simplify design and improve project efficiency.
Software can fail in five ways:
The conceptual model for the user interface is misleading, incorrect, or inconsistent. If typical users make wrong assumptions about the software, the developer has made wrong assumptions about how users think and how they expect the software to work. Failures at this level may not be critical, but they frustrate users and waste their time.
The UI is fragile. Common and inevitable user errors—such as whitespace in text, null entries, misspellings or invalid characters, or accidental mouse clicks—cause the application to fail.
The UI or underlying model isn't secure. Deliberate ...