Step 10, add the bug as a test to the CI to prevent regressions? Make sure the CI fails before the fix and works after the fix.
What do you do with the years old bug fixes? How fast can one run the CI after a long while of accumulating tests? Do they still make sense to be kept in the long run?
Debugging: Indispensable rules for finding even the most elusive problems (2004)
31–40 of 238 posts
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#32I know it is the best route, I do know the system (maybe I wrote it) and yet time and again I don’t take the time to read what I should… and I make assumptions in hopes of speeding up the process/ fix, and I cost myself time…
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#33Here's a walk through on using it: https://nickjanetakis.com/blog/using-git-bisect-to-help-find...
I jumped into a pretty big unknown code base in a live consulting call and we found the problem pretty quickly using this method. Without that, the scope of where things could be broken was too big given the context (unfamiliar code base, multiple people working on it, only able to chat with 1 developer on the project, etc.).
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#34Make sure you're editing the correct file on the correct machine.
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#35Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#36Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#37Make sure you're editing the correct file on the correct machine.
I find myself doing this all the time now I will temporarily add a line to cause a fatal error, to check that it's the right file (and, depending on the situation, also the right line)
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#38Step 10, add the bug as a test to the CI to prevent regressions? Make sure the CI fails before the fix and works after the fix.
I've lost count of how many things i've fixed only to to see;
1) It recurs because a deeper "cause" of the bug reactivated it.
2) Nobody knew I fixed something so everyone continued to operate workarounds as if the bug was still there.
I realise these are related and arguably already fall under "You didn't fix it". That said a bit of writing-up and root-cause analysis after getting to "It's fixed!" seems helpful to others.
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#39Title is: David A. Wheeler's Review of Debugging by David J. Agans
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#40Don't be too embarassed to scatter debug logmessages in the code. It helps.
My second rule:
Don't forget to remove them when you're done.