Debugging

Muhammad Wahaj Mubeen
2 min readMar 12, 2021

--

Debugging

Finding and removing bugs

“In computer programming and software development, debugging is the process of finding and resolving bugs (defects or problems that prevent correct operation) within computer programs, software, or systems.” (source: wikipedia)

Why do we even need debugging when we can simply avoid errors?

Normally programmers are considered smart as they deal with complex and challenging problems, but that’s not the case! Not that they don’t deal with complex problems but they do make some mistakes during development which is a common human trait. As I discussed earlier, bugs can be really hard to track or even exist but not found for a long time.

Even extensive testing using the latest tools cannot guarantee a bug free software. BUT testing and conformance to software engineering techniques greatly affects to bugs proportion in a software system.

Is programmer and debugger the same guy?

“A good programmer is the one who is a good debugger”

Every programmer is always testing every time he/she implements a new functionality. During this testing, if a bug occurs, programmer knows and proceeds with finding and removing it at the spot. It is much easy to find and remove as the complexity level is not high. Later the bug is found, more the cost is.

How to debug?

Once a bug occurs, programmers go after the specific function or class where that bug is found. Different programmers use different approaches but most common is ‘breakpoints’.

Programmers place some ‘breakpoints’, like print statements at different places where they suspect the bug to. As the flow starts, system will crash with executing all the print statements before the bug occurs. This way programmers know that the bug is not present within these executed statements. So the next step is to check the code which is leading to unexecuted print statements.

Imagine spending much time in finding and removing a bug only to get a new bug

Well, NOT SO FUNNY! Ask a developer about this meme and you’ll hear a crying soul telling you something starting with ‘Once I spent…’

Debugging is a hectic process and can really test the patience of a normal human being. Thankfully there are many tools that support programmers to debug their codes.

--

--

Muhammad Wahaj Mubeen

Software Engineer @Nayatel -- Android | JAVA | REACT JS | REACT NATIVE | PHP | SPRING BOOT