liveBook · Manning

Debugging

As explained in Troubleshooting Java, Second Edition

A software investigation technique for finding and solving problems in code, including analyzing how implemented logic works.

Debugging investigates software behavior to find and solve problems, while also helping developers understand, review, extend, optimize, secure, and maintain implemented logic. section 1.0 section 1.1

Developers often use debugging as a broad name for code investigation, but a debugger is only one tool among several investigation techniques. section 1.0 section 2.0

Choose the investigation goal before choosing the tool:

  • Find a root cause by examining runtime behavior and connecting observations to specific code. section 1.0 section 1.1
  • Understand unfamiliar capabilities, frameworks, or libraries by reviewing how their code behaves. section 1.1 section 1.2.2
  • Investigate slowness with a profiler, which shows executed instructions and the time spent on each one. section 1.2.3
  • Use an AI assistant for starting ideas and faster understanding, while retaining responsibility for questions, evidence, and conclusions. section 1.0 section 1.3

A debugger pauses execution so developers can read source code in context and navigate through complex logic. Effective investigation requires slowing down, reading each reached line, and stepping out when the path no longer serves the current question. section 1.1 section 2.4

A small mystery in runtime behavior

A deliberately hard-to-read Java method allocates an array, catches exceptions, changes its inputs, and recursively calls itself. A debugger makes its control flow observable instead of leaving the result to guesswork. section 1.1

Debugging can expose causes beyond visible slowness: an Android application consumed battery because a Bluetooth library created threads without closing them. Performance investigation therefore includes resource behavior, not only response time. section 1.2.3

How Troubleshooting Java, Second Edition covers it

How deep it goes
Explains investigation goals, debugger navigation, profiler use, and AI support, but defers detailed debugger techniques and profiler coverage.
Examples
Uses a recursive exception-heavy method, Spring Security, Hibernate, Bluetooth threads, profilers, and thread dumps as investigative examples.
What it assumes
Assumes a solid troubleshooting foundation and teaches beginners to distinguish investigation goals from debugger-tool usage.
What you can do after
Diagnose/debug with a debugger, profiler, code review, or AI-assisted questioning while relating observations to runtime behavior.
How it connects
Connects debugging with code investigation, debuggers, profiling, AI assistants, external libraries, performance problems, and troubleshooting.

Also explained in

Compare how 16 books explain debugging →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Troubleshooting Java, Second Edition. The section links point to the parts of the book it draws on.