A while ago [Wayback/Archive] b0rk (Julia Evans [Wayback/Archive) wrote an interesting Tweet on finding back where you broke code of which the OCR text reads like this:
strategy: change working code into broken code
If I have a working version of the program, I like to:
- go back to the working code
- slowly start changing it to be more like my broken code
- test if it’s still working after every single tiny change
· ⬊⸳⬈˙⬊⸳⬈˙⬊⸳ OH THAT’S WHAT BROKE IT!!!
I like this because it puts me back on solid ground: with every change make that DOESN’T cause the bug to come back, I know that wasn’t the problem.
by JULIA EVANS @bork wizardzines.com
This is similar (her arrows were of varying length) to using a binary search algorithm hunting for where the code was broken using bisection: repeatedly halving your search space to quickly zoom into the problem.
Another important aspect is that small commits while fiddling to solve an issue can help you determine what small commit was actually solving the issue.
Read the rest of this entry »