The 7 commandments of debugging

Squash it quick!

Thou shalt keep Calm!

Real bugs happen in production, when your systems are under heavy load or when you need them the most. Yes your boss is doing a demo of the software to clients. Yes, it is black friday and money is at stake. Yes your company is losing money. Yes you will have to explain yourself. But now is the time to keep calm. Stress will not help you. It will make the matter worse. Pro tip: Kick your boss out of the room, especially if he stresses you.

Thou shalt check the Plug!

If the screen is black, the power might be out. The computer might be unplugged. Do not take anything for granted. Do not assume anything as sometimes the most obvious and the most unlikely is happening.

Thou shalt reproduce it!

Until you can reproduce it, you won’t fix it. If you did not fix it, it is not fixed. It will happen again. You can buy yourself time by restarting your systems, but you need to reproduce the issue.

Thou shalt divide and conquer!

Way before developers used the “divide and conquer technique to create more efficient algorithms, men of war and other politicians used that exact technique to succeed in their endeavours. None other than Niccolò Machiavelli wrote about it in the Art of War as well as in the Discourses on the First Decade of Titus Livius

Thou shalt change one thing at a time!

Do not update packages and change the code, do one or the other not both! You will not know what made the matter worse. You might have fixed the issue with the code, and introduced an even bigger problem upgrading a package. Do not change two things in your code either! Just one and test. Remember you are debugging, not making things nicer, or trying to improve anything. Just squash the bug, release the hotfix. Pro tip: Of course you have tests… run them you are not wasting time!

Thou shalt take notes!

Take notes of everything you do, you will have to explain yourself, or you might need help. If you are able to share what you did quickly people will not try what you already did. Then when the issue is resolved, you will be able to do a nice post mortem and put measures in place so that the issue does not happen again.

Thou shalt share with others!

Your failure is valuable experience! Share it with others. Leave a comment of your most frightful experience. We all have one.

Tech Lead/Software engineer. I am currently working on Legal Technologies and Computational Law. I enjoy opera, philosophy nature and literature.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store