My preferred workflow when fixing a bug: 1
My preferred workflow when fixing a bug:
1. Can I write an isolated, automated test for this bug? If not, refactor so I can.
2. Write failing test
3. Fix the failing test
Now I have:
- Proof the bug is fixed 🐞
- Documented expected behavior 📃
- Regression protection 🥽
#tdd
Even after years, this requires patience and self-control. It's tempting to just start the app and manually click around. But doing so misses out on all the benefits I mentioned above.
Refactoring and tests also save time in the short term when the scenario is hard to setup.