What are the steps in the debugging process?
The debugging process usually consists of the following: examine the error symptoms, identify the cause, and finally fix the error. This process may be quite difficult and require a large amount of work, because of the following reasons:
How does defensive programming help in debugging a program?
Defensive programming can help reduce the distance between the cause and the effect of an error. Symptoms may be difficult to reproduce. Replay is needed to better understand the problem. Being able to reproduce the same program execution is a standard obstacle in debugging concurrent programs.
Do you feel proud when you fix bugs in a program?
As a matter of attitude, programmers should not feel proud when they fix bugs, but rather embarrassed that their code had bugs. If there is a bug in the program, it is only because the programmer made mistakes. Even after careful thought and defensive programming, a program may still have defects.
When is a debugging tool a good thing?
If you ran into an error (exception) while running your app, that can be a good thing! An exception is an unexpected event encountered when running code, typically an error of some kind. A debugging tool can take you to the exact place in your code where the exception occurred and can help you investigate possible fixes.
What does it mean to debug in Visual Studio?
Debugging means to run your code step by step in a debugging tool like Visual Studio, to find the exact point where you made a programming mistake. You then understand what corrections you need to make in your code, and debugging tools often allow you to make temporary changes so you can continue running the program.
Is it possible to debug someone else’s code?
It is often more difficult to debug someone else’s code. If it’s not your code, it’s possible you might need to spend time learning exactly what the code does before you can debug it effectively. When writing code, start small, and start with code that works! (Good sample code is helpful here.)