StuckOut

ResourcesProgramming

How Experienced Engineers Actually Debug

Debugging is a method nobody teaches and everybody is marked on. Here is the method.

6 min read

Read the error properly

Most students skim the first line. The stack trace tells you the file, the line and the call path. Read it fully before changing anything.

Halve the problem

Do not guess at fixes. Find a point in the middle where you can check whether the state is still correct. Whichever half is wrong, halve that. Five halvings finds a bug in thirty lines.

Change one thing

Changing three things and seeing it work teaches you nothing, and you cannot undo the two that were unnecessary.

Reproduce before you fix

If you cannot make it happen on demand, you cannot know you fixed it. The bug that goes away on its own comes back during marking.

Still not moving?

If this did not unstick you, the problem is probably specific to your code or your data. Send it over and we will look at the actual thing.

Send my requirements →

Related subjects