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:

  • Use cobra -d option to get debugging symbols so that uncaught exceptions will include source line numbers for the stack frames.
  • 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 DetailedStackTrace to get more information when uncaught exceptions occur.
  • Use the ObjectExplorer to browse and inspect objects and their related objects at run-time.

See also: DebuggingTopics