The Principles of Debugging
Even though debugging is an art rather than a science, there are definite principles that guide its practice. We will discuss some of them in this section.
At least one of our rules, the Fundamental Principle of Confirmation, is rather formal in nature.
The Essence of Debugging: The Principle of Confirmation
The following rule is the essence of debugging:
- The Fundamental Principle of Confirmation
-
Fixing a buggy program is a process of confirming, one by one, that the many things you believe to be true about the code actually are true. When you find that one of your assumptions is not true, you have found a clue to the location (if not the exact nature) of a bug.
Another way of saying this is:
Get The Art of Debugging with GDB, DDD, and Eclipse now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.