Skip to main content

Golden debugging practices for a software developer


Debugging is really a hard and challenging phase in software development. It needs to be taken care and can be a highly sellable skill if you are good in debugging. Days would come where you should have mental skills to tackle the questions thrown by bugs. Let's have a look at some of the techniques in debugging right from the basic level.

Don't Panic

Be it at your desk or at a quality analyst's cabin or even when reading the mail of the bug raised, key idea is not to panic. There will be moments of critical issues being reported in a difficult time of a milestone. One should overcome the mental fights and focus on what the issue is.

Give importance to key details

Now you are in the place of a crime scene. You are investigating the crime scene. So take note of every available details in the console, the behavior, debug logs if any, etc. Get back to your desk and analyze the data you collected. You might have some thoughts right away if you are lucky.

Don't believe the bug in first place

Once the issue is raised, a confident developer will first doubt the tests as to why the bug would occur. So get in touch with the tester directly and squeeze him for details until you are convinced. Ask him to reproduce, test in different configurations/environments, etc. I'm sure a good tester would be free to respond to your queries.

"It is not a bug"

Sometimes, you may have faced issues where the cannot be accepted as a bug. As a developer who knows the in and out of the product can call it an invalid bug right away. In other cases, devs can discuss with their peers on the validity of the bug.

Diff of your code

Even after all the above steps, if you agree on the bug, first thing you would want to do is check the diff of the code in which the bug occurred and the last commit. This really helps anyone on the first level.

Debuggers

I'm a huge fan of debuggers. Debuggers like gdb are really useful if you know how to use them. All the IDEs these days also have an inbuilt debugger. Code editors like Atom, VS code have plugins for debugging. Keep breakpoints and identify where it occurs. They work like a charm!

debugging practices
Don't be this guy. ROFL.

Debug logs matter

Religiously go through the debug log line to line and try to locate everything in your code. Sometimes the exception/crash may have occurred in a third party module also. So it is vital that everything is logged with right levels.

Take breaks

Mostly you would like to go with the flow and debug the issue. But sometimes it may prolong and you surely have to take a break and come back to resume the process freshly. I'm sure you will have new thoughts when you do.

Talk with peers

In case of the debugging process is turning out too long and eating up a significant amount of time in your JIRA, don't hesitate to have a word with your peer about what has been going on. Make him understand the situation, he may suggest you some ideas that may really work. Or he may even take different calls according to the situation.

debugging practices

Once you keep following the above practices, you will surely find a way to win the battle between bugs and yourself. I bet there is no better feel than to debug the issue all by yourself and it really really increases your confidence level towards the product.

Comments

Popular posts from this blog

Sachin Tendulkar's legendary journey

"I see myself when I see Sachin play"  -Cricketing legend Sir Don Bradman Sachin Ramesh Tendulkar, had represented India at the age of 16. Rather than asking 'How old are you?', people who were longing to query his age would have asked him 'How young are you?'. Such a prodigy he was and still is one. He was given his first international cap on 15 November 1989 and exactly 23 years and 364 days later, he played his last international cricket match for his nation and on a combo, it was his 200th test match.              Sachin has scored over a 34,000 international runs, and there are no exclamations for that huge milestone after describing him as a prodigy. But still seeing another cricketer of his quality and matching his frequency, is very far away from my eyes. But who knows he might be somewhere playing cricket in schools, or schooling in kinder gardens, or building blocks in play schools, or might even be an unhatched embryo.  ...

Object oriented SDK development

If you are someone who is into object oriented SDK development and looking for some best practices on API design, I have got you covered here. I have used C++ as the base to explain the core. OpenCV is one of the frameworks I have come across that does an exceptional job in providing classic and productive APIs in C++. Let's not waste time an quickly jump into the best practices of object oriented API design. Design easy-to-read API names First and foremost thing to consider in an object oriented SDK is the API name itself. Your API names should reveal everything. Keeping APIs as small as possible can be a difficult task but that is what you should deliver. The API should do what the name says. Nothing more. Nothing less.  Write your headers and review it Before you jump into development, it is important to code what the user wants. To have a crosscheck on that, write a header file(.h or .hpp) containing the public/private functions and data members. In this process, ...

The art of sleeping

     They say that living is an art but I am starting to think that sleeping is an art, too! It’s just not as easy as it was when I was a kid. Being an adult, sleep is not just a sleep. It encompasses of a mixture of various feelings that we undergo in the day life. A happy sleep requires 3 things. i.e., satisfaction at heart, peace in mind and the harmony in soul. But I say, the foremost requirement for a good sleep is a good day at the work. When you gave your all, at the work and go to the bed, I bet you it is the most amazing feel in the world.     Now, why is sleeping an art? I had a research on controlling the sleep. And to my fortune, it paid off. The research was about the concept of self alarm. Yes, an automated alarm within us which would wake us up from the sleep. The idea was very simple. I had an inner consiousness while sleeping which kept an indegenous alarm within me which would wake me up around the intended time.(No more ringing bells or 6am ...