It's the Design...
After spending a few lessons on test-driven development, we'll now turn our attention to simple design. Why do we need to consider design?
- TDD is not enough: TDD will have a positive side effect on design, but simply doing TDD will not take care of design by itself.
- DRY (Do not Repeat Yourself) is not enough: So far, our refactoring efforts have been focused on removing duplication. This is crucial to write maintainable code, but it is not enough.
- TDD will punish you if you don't understand design: When we find ourselves writing very complex test code, we should consider changing the design of the implementation.
We'll also move from using TDD to solve simple algorithmical problems to problems that require more design decisions.