You are previewing Test-Driven iOS Development.

Test-Driven iOS Development

Cover of Test-Driven iOS Development by Graham Lee Published by Addison-Wesley Professional
O'Reilly logo

11. Designing for Test-Driven Development

In the preceding six chapters, we’ve taken the specification for a product and turned it into a working iPhone app, using the principle of test-driven development. It’s time to take a step back, look at what we’ve done, and see what general guidelines can help in designing classes that will be implemented using a test-driven approach.

Design to Interfaces, Not Implementations

Whenever you’re writing a test in a TDD project, you’re designing a part of the class that is being tested: what setup it needs, how its API can be used, and what the class does in response to its API being used. It’s best to stay away from decisions about how the class does what it does when writing the test, and defer these decisions ...

The best content for your career. Discover unlimited learning on demand for around $1/day.