Summary of 🚀 TDD, Where Did It All Go Wrong (Ian Cooper)
Ian Cooper, in his presentation on TDD, delves into the current issues surrounding Test-Driven Development and the growing resistance towards it. He stresses the need to test behaviors in the system rather than implementation details. The TDD methodology consists of three key steps: red, green, refactor.
Key Steps in TDD Methodology
- Red phase: Write tests to show failure in the absence of correct implementation.
- Green phase: Quickly make the test pass, even if it means committing coding sins like copying from Stack Overflow.
- Refactor phase: Focus on eliminating duplication and enhancing code quality without introducing new tests.
Importance of Decoupling Tests
Cooper highlights the importance of decoupling tests from implementation details to ease refactoring. Refactoring should concentrate on public contracts and stable APIs, leaving implementation details untested. He cautions against heavy mocking, advocating for a focus on code smells and knowing when and how to refactor. He promotes a hexagonal architecture to separate core domain logic from external concerns through adapters.
Testing Prioritization
- Developer tests should be prioritized over integration testing and reliance on external tools.
- Avoid excessive use of IOC containers and mocks, focusing on testing behaviors over methods and classes.
- Adjust TDD approaches based on certainty in implementation details.
Conclusion
In conclusion, Cooper encourages viewers to watch the video online for further discussions on the topics covered.
Notable Quotes
— 00:00 — « No notable quotes »
Category
Educational