What do you do when you find a bug? Tackle it now or lock it away. Does it matter? Many will argue the benefits of choosing the right time to fix it, but does it really add up? Could delay be a little too convenient?
In most cases we:
- Discover it – either ourselves or it’s reported by a user, either way we need to check it’s real
- Log it
- Assess whether it should get fixed and prioritise
- Stick it in some kind of backlog
- Create a test and fix based on information in backlog
Why? The bug might not be worth fixing or fixing might not add as much value as another story in the backlog and so it should be prioritised. This leads to a number of possible outcomes all with different costs:
- Bug will never be fixed and is deleted – Just the cost of logging and assessment, well until somebody finds it again and the whole process starts again with an annoying feeling of de-ja-vu
- Bug should not be fixed but will stay logged – As above but when it’s found again it should be quicker to dismiss – you now have to maintain lists of old bugs, accumulation of technical debt
- Bug will be fixed but not right now – Cost of logging assessment and backlog management, and inconvenience caused to the customer until it’s fixed, accumulation of technical debt
- Bug will be fixed immediately – cost of logging, assessment and of interruption to existing backlog work
An alternative is
- Discover it
- Create a test and Fix
Why? Ok, so perhaps it might not need to be fixed but we can eliminate all the logging and assessment and rediscovery above by just fixing it. Whats more since the bug will usually be recreated as part of the discovery step the developer can quickly create a test and fix while it’s fresh in everyones mind. Fixing immediately reinforces a stop-the-line mindset allowing us to learn from the immediate feedback before we potentially do more damage. In a solid code-base where bugs are rare and can be easily fixed, I’m dubious there is ever a good reason to delay the fix. If bugs take a considerable time to fix you need to take a look at the way you are coding.
What do you think?