Take a request from context to code.
For engineers and architects. About 8 min to read.
Trace an implementation decision back to a documented rule.
The lesson
Read the acceptance criteria and inspect the source material selected for the change. Identify which states, fields or dates determine the outcome. Compare the proposal with the expected example and check how it fits the existing repository. The question worth holding onto is not whether the code looks right: it is which field the code read, and whether a test exists where reading the wrong one would give a different answer.
Two implementations that agree today
A refund path can read the discount recorded on the original transaction line, or recompute it from the current catalog price. Both return the same amount while the price has not moved, which covers the case in the ticket and usually the test as well. The two diverge the first time somebody reprices the item, months later, with nobody looking.
The test has to set a different catalog price, or it is not testing the thing that matters.
Your exercise
A report counts review time by subtracting the claim-open date from today, for every claim. Find the error. Then explain why only changing the start date still fails when a claim has several waiting intervals.
Show a sample answer
Subtracting from the open date counts elapsed time, which includes every period spent waiting for documents. Moving the start date forward fixes one case and no others: the measure has to accumulate the intervals spent in review states and skip the rest, so a claim with two waiting periods still needs both excluded. Test the transition where review resumes after documents arrive, with at least two pauses in the fixture.