And so it begins! London is first up. Sandro Mancuso takes the lead for the next five episodes, creating a Twitter-like app using the outside-in "London School" approach. In this episode Sandro completes the first few use cases. The acceptance tests for those use cases pass. The unit tests and the production code are written. And, in this episode, we see the first hint of the double edged sword of mocking: we see how the outside-in approach drives architecture. We see how the unit tests drive design. And we also see how the prodigious use of mocks may make the unit tests and production code fragile. Note: You can find the code here. Three branches are of interest: The starting-point branch is where both implementations began. The openchat-outside-in branch captures the tomato by tomato history of the London approach. The openchat-unclebob branch captures the tomato by tomato history of the Chicago approach. Enjoy!
This was a very intense session, and I nearly lost it at the end. We discovered that our concept of unit and acceptance tests differ markedly and we use them for different purposes. Sandro uses acceptance tests to probe the architecture. He uses unit tests to drive the architecture. His acceptance tests do not completely probe behavior. His unit tests do, but at the expense of the fragility imposed by mocks. Will that fragility cause trouble in the end? The benefits are clear, but are the costs worth it?
Sandro has a secret: he knows something that I don't. He's waiting to spring the trap on me yet again. But, other than that, things are moving along with a semblance of clockworks. The development steps are becoming rote. The design and architecture are becoming apparent. Three APIs done and the sausage machine is starting to crank.