Growing Object-Oriented Software Guided by Tests
What You'll Learn
You'll learn how to build larger systems using outside-in TDD, starting with acceptance tests that drive the design from the user's perspective inward.
The Outside-In Approach
Up until now, we've focused on TDD at the unit level—writing tests for individual classes and methods. But how do you build a complete system this way?
Outside-in TDD (also called "London School" or "acceptance-test-driven development") starts at the system's boundary—where users interact with your software—and works inward, layer by layer.
Think of building a house: instead of perfecting individual bricks first, you start with the blueprint (acceptance test), then frame the structure (high-level components), then work down to the details (unit tests for each component).
The Process
- Write an acceptance test that describes a complete user scenario or business requirement
- Run it and watch it fail (you haven't built anything yet!)
- Identify the first missing piece at the boundary
- Drop down to the unit level and TDD that component
- Use test doubles for dependencies you haven't built yet
- Return to the acceptance test, see what's missing next
- Repeat until the acceptance test passes
The acceptance test stays red for longer—it's your north star, guiding all lower-level development. Each unit test cycle gets you one step closer to making that acceptance test green.
This approach ensures you build exactly what's needed (no speculative features) and naturally discovers the interfaces between components as you work inward.
Key Takeaway: Outside-in TDD builds systems by starting with failing acceptance tests and working inward through layers, using unit tests and test doubles to implement each component you discover along the way.