Re:Debugging with Hypotheses
by greenyoda on Saturday January 17, 2015 @06:12PM
(#8905925)
"Again, do not fix if you do not understand."
I think that's the most important point of the article. If you don't understand the code you're fixing well enough to be able to explain what the bug does or why your fix fixed it, you'll have no way of knowing that (1) the bug (and not just a particular limited case of it) is actually fixed and (2) that you haven't introduced additional bugs by fixing the first one.
If you're reviewing someone's code and they can't explain to you how their fix removed the bug (e.g., they just changed random stuff around and the bug "went away"), that's a bad sign.
I think that's the most important point of the article. If you don't understand the code you're fixing well enough to be able to explain what the bug does or why your fix fixed it, you'll have no way of knowing that (1) the bug (and not just a particular limited case of it) is actually fixed and (2) that you haven't introduced additional bugs by fixing the first one.
If you're reviewing someone's code and they can't explain to you how their fix removed the bug (e.g., they just changed random stuff around and the bug "went away"), that's a bad sign.