Version 1 (modified by Chuck, 15 years ago) |
---|
A debugger is an interactive program for setting breakpoints, inspecting variables and so on. However, a debugger is not strictly required to fix bugs.
The fundamental requirement is to correct your understanding of how your program is behaving in the context of the inputs and environment in which the bug occurs. Of course, a debugger helps you gain that understanding, but there are also non-debugger-based techniques to do so:
- Add more contracts in order to reveal the bug closer to its source.
- Add more unit tests to isolate and verify various behaviors expected of your methods and classes.
- Add more assert statements in the implementation to reveal the bug close to its source.
- Note that Cobra's assert is informative, meaning that upon failure it will show the values of each sub-expression in the asserted condition.
- Add trace statements to show both values as well as execution flow.
- Use the ObjectExplorer to browse and inspect objects and their related objects at run-time.
See also: DebuggingTopics