Skip to content

Quiz: Technical Debt and Keeping Docs True

Test your understanding of technical debt, debt interest, the debt register, debt triage, refactoring with an agent and keeping documentation true with these review questions.


1. What is a debt register?

  1. A tool that measures how much code is duplicated
  2. A bank account for paying vendor bills
  3. A written list of an app's known technical debt, one row per item, kept in the repository
  4. The project instruction file the agent reads at start-up
Show Answer

The correct answer is C. A debt register, such as docs/tech-debt.md, is the list on the cabinet door. Each row has an ID, the date found, what and where, the kind (deliberate or accidental), the interest, the decision and the status. Because it lives in the repository, the builder and the agent can both read it, and git keeps its history. It isn't a measuring tool (A) or the instruction file (D).

Concept Tested: Debt Register

See: The Debt Register


2. Two debts would each take a few hours to fix: model prices copied into ten files, and results-page styles repeated in three components. Why might they deserve different treatment?

  1. The price code changes about twice a month and each change costs extra, while the styles rarely change, so the price copies charge far more interest
  2. Style debt is always more urgent than code debt
  3. Price copies can't be fixed without rewriting the app
  4. The styles are deliberate debt and the prices are accidental
Show Answer

The correct answer is A. Debt interest is the extra cost a shortcut adds each time the code is changed, run or explained. With the chapter's illustrative numbers, the price fix pays for itself in about 12 weeks, and the style fix takes about 40. Interest on the prices also grows, since an agent that sees ten copies will write an eleventh. How often the code changes matters more than the size of the fix.

Concept Tested: Debt Interest

See: Debt Interest


3. Why should a stale architecture doc worry a builder who works with agents more than one who works alone?

  1. Agents refuse to work on projects with old docs
  2. Stale docs slow down the build step
  3. Agents delete docs they find to be wrong
  4. An agent reads the doc at the start of a session and plans around parts that no longer exist, giving confident wrong answers
Show Answer

The correct answer is D. A person might notice that a doc feels off. An agent starts with a fresh context and trusts what it reads, so a stale doc becomes a confident wrong plan, the way the house folder sent the couple to the wrong breaker. Agents don't refuse (A) or delete docs on their own (C), and docs don't affect the build (B). Generate the facts from code where you can, and update the rest in the same commit as the change.

Concept Tested: Stale Documentation

See: Stale Documentation


4. You find a shortcut in the scoring code that could count an unrun check as passed. The fix would take two hours. How should you triage it?

  1. Accept it with a reason, since two hours is a lot
  2. Pay it now, because it touches a must-be-right part
  3. Log it with a trigger for when you next touch scoring
  4. Leave it out of the register until you have time
Show Answer

The correct answer is B. The first triage question is whether the debt touches a must-be-right part: sign-in, money, private data, the no-false-all-clear rule or the no-locate rule. This one does, so it's paid now whatever it costs. Accepting it (A) or logging it (C) leaves members exposed to false reassurance. Leaving it out of the register (D) loses the finding, and the register exists so nothing gets lost.

Concept Tested: Debt Triage

See: Debt Triage: Pay Now, Log or Accept


5. In the middle of a results-page task, the agent notices a bare catch block in a payment adapter it isn't touching. What should it do?

  1. Fix it on the spot, since it's only a few lines
  2. Ignore it, since it's outside the task
  3. Add a row to the debt register in the same commit and leave the payment code alone
  4. Rewrite the whole payment adapter while it's there
Show Answer

The correct answer is C. The pay now or log rule says to fix debt on the spot only if it is small, inside the code you're already changing, and covered by a test. A payment adapter outside the task fails that test, and changing it mid-task is scope creep in a must-be-right part. Ignoring it (B) loses the finding. Adding the row in the same commit captures it while the details are fresh. At triage it goes straight to pay now, because it touches money.

Concept Tested: Pay Now or Log

See: Pay Now or Log


6. You want the agent to collapse the ten copies of model prices into one price table. What should be the first step?

  1. Write tests that record what each of the ten places computes today, so any behavior change shows up
  2. Delete all ten copies and write the table from scratch
  3. Ask the agent to do it in one commit to save time
  4. Update the README to describe the new table
Show Answer

The correct answer is A. Refactoring means changing structure without changing behavior, and tests that pin current behavior are the only way to know behavior didn't change. Then make one move at a time: create the table, commit, point one file at it, run the tests, commit, and so on. Starting over (B) or one big commit (C) hides which step broke something. Docs (D) come in the same commits as the change, not first.

Concept Tested: Refactoring with an Agent

See: Refactoring With an Agent Behind Tests


7. Suppose launching without staging was deliberate debt, while dev-only plugins in the production build were accidental. Why does the difference call for different habits?

  1. Deliberate debt never needs paying, and accidental debt always does
  2. Accidental debt is the builder's fault, so it must be hidden
  3. Deliberate debt is always cheaper than accidental debt
  4. Deliberate debt can be written down at the moment of choice, while accidental debt has to be gone looking for
Show Answer

The correct answer is D. When you choose a shortcut, you know the reason now and won't in three months, so write the row then. Accidental debt doesn't announce itself, so a periodic "find the shortcuts" pass with the agent is how it gets found. Deliberate debt still charges interest and may need paying (A). Accidental debt isn't a mark against the builder (B), since an agent with a fresh context doesn't know what the last session built.

Concept Tested: Deliberate Debt

See: Deliberate Debt and Accidental Debt


8. In the dating-safety app, one debt item ID was once given to two different items. What goes wrong?

  1. The register file becomes too large to open
  2. Commits and comments that point at the ID could mean either item, so marking one fixed can hide the other
  3. Git refuses to commit a file with duplicate IDs
  4. Nothing, since IDs are only labels
Show Answer

The correct answer is B. An ID lets every other record, such as a commit message, a code comment or a pull request, point at the same item. If TD-042 names two things, "fixes TD-042" might close the wrong one, and the other quietly drops off the list. That's why a debt item ID is never changed and never reused. File size (A) and git (C) aren't affected. Option D misses that the label is what holds the links together.

Concept Tested: Debt Item ID

See: Debt Item IDs


9. Which facts in a README are good candidates for docs generated from code, and which must a person write?

  1. Everything can be generated, including why decisions were made
  2. Nothing should be generated, since scripts make mistakes
  3. Ports, routes and environment variable names can be generated; reasons such as why the score is 50 when nothing ran must be written by a person
  4. Only the app's description can be generated
Show Answer

The correct answer is C. Facts the code already knows, such as the list of routes, ports or required variables, can be pulled out by a script, so they change whenever the code does and can't go stale. Decisions and their reasons live in people's heads, not the code, so a person writes them, ideally in the same commit as the change. The dating-safety app's README listed the wrong ports, which a generated list would have prevented.

Concept Tested: Docs Generated from Code

See: Docs Generated From Code


10. A builder proposes spending a week clearing every row in the debt register before building anything new. How should you judge this plan?

  1. Poor plan: triage first, pay what touches must-be-right parts or is quick, log the rest with triggers, and accept what isn't worth fixing
  2. Good plan, since a register should always be empty
  3. Good plan, as long as the agent does it in one large commit
  4. Poor plan, since debt should never be paid once logged
Show Answer

The correct answer is A. Debt doesn't go to zero, and it shouldn't, because some shortcuts are good trades. Clearing everything spends a week on rows whose interest is near zero while new work waits. Triage spends effort where a mistake hurts members or interest is high, and an accepted row keeps its reason so nobody rediscovers it. One large commit (C) makes mistakes hard to find. Option D ignores that some debt must be paid now.

Concept Tested: Debt Triage

See: Debt Triage: Pay Now, Log or Accept