Practice question · Sort into groups
Sort each debugging move by whether it reasons from evidence or merely guesses.
Groups: Reasoning from evidence · Debugging by guessing
- Change a loop bound because it looks wrong, then re-run
- Set a breakpoint and read the actual register values
- Insert a delay because the fault feels like a timing problem
- Single-step and watch which instruction first writes the bad value
Hints
- Ask of each move: does it produce an observation, or does it only produce a change?
- A move that could make the symptom vanish without revealing why is a guess, however plausible.
Show the answer
Reasoning from evidence: Set a breakpoint and read the actual register values, Single-step and watch which instruction first writes the bad value
Debugging by guessing: Change a loop bound because it looks wrong, then re-run, Insert a delay because the fault feels like a timing problem
Why
Breakpoints, single-stepping and memory dumps all make hidden state observable; changing bounds, adding delays and rewriting produce no evidence at all. The danger of the guessing moves is that they can make a symptom disappear while leaving the real fault in place.
Practise Machine-Level Debugging Logic
The app has 7 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Machine-Level Debugging Logic
- Order the steps of narrowing down a machine-level bug by binary search in time.
- A program is made to run on eight cores instead of one and gets four times faster, not eight. What sets the…
- Moore's law described transistor counts doubling roughly every two years, and single-core clock speeds…
- An 8-bit register holds the pattern 11111111. Select every statement that is true.