Reproduce: The first task in any debugging effort is to learn how to consistently reproduce the bug. If it takes more than a few steps to manually trigger the buggy behavior, consider writing a small driver program to trigger it programmatically
Progressively Narrow Scope:
Avoid Debuggers
Change Only One Thing at a Time
Insert Trace Statements: A trace statement is a human readable console or log message that is inserted into a piece of code suspected of containing a bug, then generally removed once the bug has been found.
Consult the Log Files of Third Party Products
Search the Web for the Stack Trace
Introduce Design by Contract
Wipe the Slate Clean : Create an entirely new mini-application whose sole function is to demonstrate the presence of your bug.
Intermittent Bugs:
Exploit Locality: So when you encounter a new bug, think of those parts of the code in which you have previously found bugs, and whether nearby code could be involved with the present bug.
Read the Documentation
Introduce Dummy Implementations and Subclasses: Where an object is invoked only via interfaces, consider replacing the object with a simple, custom object of your own that is hard-wired to perform correctly under very specific circumstances.
Recompile / Relink
Probe Boundary Conditions and Special Cases
Check Version Dependencies
Check Code that Has Changed Recently
Don't Trust the Error Message
Wooden Indian: When you're really stuck on a bug, it can be helpful to grab a colleague and explain the bug to them, together with the efforts you've made so far to hunt down its source.
Don't Speculate:
Don't be too Quick to Blame the Tools
Understand Both Problem and Solution
Monitor Your Own Fault Injection Habits
Introduce Debugging Aids Early
Loose Coupling and Information Hiding
Write a Regression Test to Prevent Reoccurrence
Sajnos az eredeti site nem él