Don’t fix your tests too quickly
You know the classic workflow to fixing bugs?
- Find bug
- Write test
- Make sure test fails
- Fix bug
- Makes sure test passes
- Profit!
Sometimes, after you fix the bug, the test still fails. This means the test was flawed!
In this case, besides fixing the flawed test, you should go back to step 1 – undo the bugfix, write a better test or fix the test, make sure it fails with the original code, and only then fix it (the “lazy flow” is just to fix the test and watch it turn green, but then you don’t really know it tested what you wanted).