Accel Thinking

AI Literacy Articles

What Makes a Good Debugging Question? Give Humans and AI Reproducible Evidence

Turn 'it does not work' into a minimal, reproducible, privacy-safe question with clear expected and actual behavior.

“My code does not work” provides almost no evidence. A useful debugging question lets another person or an AI reproduce the failure, compare expected and actual behavior, and focus on the first incorrect state.

The Core Idea

Include the goal, minimal runnable code, input, expected result, actual result or complete error, relevant environment, what you tried, and one focused question.

The Stack Overflow guide to a Minimal, Reproducible Example uses three practical criteria: minimal, complete, and reproducible. Remove irrelevant code, include everything needed to run the example, and test that the reduced example still fails.

A Seven-Part Template

  1. Goal: Describe the intended behavior.
  2. Minimal code: Include the smallest readable program that still fails, as text.
  3. Input: Give exact input or reproduction steps.
  4. Expected: State the value or state you expected.
  5. Actual: Copy the complete error, traceback, or observed output.
  6. Environment and attempts: Include relevant versions and what you already tested.
  7. Focused question: Ask about the specific transition or concept you do not understand.

Weak vs. Strong

A weak question says, “My Shell Game code does not work.” A strong question shows a start at 1, swap 1 and 2, expected position 2, actual position 1, and the two if statements that reproduce the failure. It then asks why the second condition becomes true and how to make the branches exclusive.

That small example can be run immediately. A two-row dry run reveals that the first assignment changes the truth of the second condition. The minimal fix is if / elif.

When Asking AI

Ask for an explanation before a patch: identify the first incorrect state, explain the cause, and make the smallest change. Also ask for a test that fails before the fix and passes afterward. Then run and independently verify the suggestion.

Privacy and Security

Never paste passwords, API keys, tokens, private keys, student records, client data, internal connection strings, or proprietary code you are not authorized to share. Replace real data with a structurally similar fictional sample. If a secret has already been exposed, revoke or rotate it; deleting a message is not sufficient.

After You Receive an Answer

Explain which state or assumption changed, rerun the minimal failing case, add boundary and neighboring-branch tests, keep the test as a regression check, and summarize the cause in your own words.

Copyable Template

Goal:
Minimal runnable code:
Input or reproduction steps:
Expected result:
Actual error or output:
Environment:
What I tried:
Focused question: