Adopting TDD for bugfix

Hi there, recently I’ve got a valuable experience as I see it 🙂 and would like to share my thoughts on that topic with you in that short note.
The idea is following I’ve tried to use TDD within bug fixing process. Based on my previous experience developers majority and me personally avoid to start adopting TDD when develop their apps from scratch and there are some reasonable arguments to do so;)
Let’s imagine the guy that giving a smart speech on some dev conference how cool it will be to incorporate TDD in your project by coding… calculator. Bingo!

For sure it’s even impossible to see such trivial apps somewhere in modern enterprise world. When you face with various complex integrations, multithreading processes it’s going to be quite tricky to start “from scratch development” by applying TDD there. So another thing is to build up a skeleton app some kind of “minimum viable product” and cover it with basic unit tests scenarios and then be prepared for constantly changing requirements 🙂 Then starting from that stage you may introduce extremely simple rule set:
- You’ve got a new requirement or bug 🙂
- Modify existing or write new unit test to brake you existing functionality according to new change
- Fix implementation — make the tests green again 🙂 and enjoy

Conclusion:
Incorporating this simple practice during your development provides you with all TDD benefits without having pain in the ass 😉 such as writing codebase by TDD from the very beginning.
Not sure if it was somehow helpful and relevant for you but I found this technique very useful and successfully adopted that on my project.