A computer bug is a mistake in the code that causes a program to produce an incorrect or unexpected result. Bugs can manifest themselves at different phases of the program execution (e.g., compile time, runtime). Debugging code is an essential part of programming. Debugging is an art, not a science. There exist useful debugging techniques and approaches. Most importantly, as you code and debug more, your experience helps figuring out what causes the error. The following posts describe the bug history, common errors and error messages, and the guidelines and tools for debugging programs.
- Why is it called a bug?
- This post provides a brief history of the program bug.
- Common Error Messages in Python
- Mistakes happen and some mistakes are common for beginners. Common compile- and run-time errors, the error messages produced, and suggestions on how to fix them are discussed in this post.
- Debugging Programs without Compile-time and Run-time Errors
- The program has no compile-time and run-time errors, but something is still wrong. It may produce no output, it may produce the wrong output, or it may be stuck in an infinite loop. This post discusses strategies on how to debug such a program.
- Common mistakes not producing an error message
- This post provides examples of common mistakes leading to incorrect output.