To use TDD you need to go through three design phases, repeatedly in iterations.
The three design phases:
1. RED: Write a failing test 2. GREEN: Make the failing test pass 3. BLUE: Refactor your code (including your tests as well)
4️⃣ Practice a lot
Greatness comes from practicing.
Because of the test-first characteristic, TDD requires a different mindset, therefore additional time to practice.
Make sure you have strong fundamentals by solving multiple Kata exercises!
5️⃣ Apply TDD in your project
Once you finished with Katas, it's time to put TDD in practice in your project.
Start small! Start with a failing test for a function or a class you want to implement! Follow the 3-phase design!
And always keep the three laws of TDD in mind!
✅ Why will TDD help you?
TDD will force you to:
- work in short cycles
- write automated tests
- do continuous refactoring
- continuously analyze the requirements
- write the most optimal production code
Given all of these benefits, TDD is almost a silver bullet.
Enjoy! 🙏❤️
• • •
Missing some Tweet in this thread? You can try to
force a refresh