Topics / Engineering practice

How to verify a change without trusting its author’s explanation.

Choose evidence whose expected result comes from an agreed requirement, then make the result reproducible on the reviewed revision.

Start outside the implementation.

If the same mistaken assumption shapes the code, its generated tests and its review summary, agreement is easy. Find an independent basis: an API contract, an approved requirement, a previously observed incident or a domain decision.

Illustrative example

A tax calculation rounds at the wrong stage.

The implementation rounds every line item, and its tests calculate expected values the same way. The agreed rule rounds the invoice total. Choose an input where the two methods differ, calculate the expected result from the rule, and inspect the output.

Run a counterexample with an independent expected result

For this teaching example, the stated rule is to round the invoice tax once, after adding the line amounts. Three lines of 0.05 at 10% tax distinguish that rule from rounding each line. The rounding rule is invented for this example.

Save the following as rounding_example.py and run python3 rounding_example.py. It uses only Python’s standard library.

from decimal import Decimal, ROUND_HALF_UP

cent = Decimal('0.01')
rate = Decimal('0.10')
lines = [Decimal('0.05')] * 3

# The implementation and its original test round each line.
actual = sum((amount * rate).quantize(cent, rounding=ROUND_HALF_UP)
             for amount in lines)
author_expected = sum((amount * rate).quantize(cent, rounding=ROUND_HALF_UP)
                      for amount in lines)

# The stated rule rounds the invoice tax once, after summing the lines.
contract_expected = (sum(lines) * rate).quantize(cent, rounding=ROUND_HALF_UP)
print(f'Author-derived check: {actual == author_expected}')
print(f'Observed tax: {actual:.2f}')
print(f'Contract tax: {contract_expected:.2f}')
print(f'Contract check: {actual == contract_expected}')
assert actual == Decimal('0.03')
assert contract_expected == Decimal('0.02')
assert actual != contract_expected

Recorded on October 9, 2026 with Python 3.14.7:

Author-derived check: True
Observed tax: 0.03
Contract tax: 0.02
Contract check: False

The script exits successfully because its assertions confirm the expected demonstration: the two calculations disagree. The contract check is still false. Change the implementation to follow the agreed rule and rerun it before treating the requirement as met. This example checks one rounding distinction; it does not verify a billing system.

Retain enough to repeat the challenge.

RecordWhy it matters
Requirement and authorityEstablishes where the expected behavior came from
Input and expected outcomeMakes the challenge specific
Code and environment revisionsIdentifies what was actually checked
Observed result and artifactLets another reviewer inspect the conclusion
LimitsKeeps untested conditions visible

Independence has several meanings.

A separate model, a separately designed test and an organizationally independent verifier are different arrangements. Use the one required by the consequence and assurance plan. Changing the model name alone does not guarantee independent reasoning.

Proof helps connect the claim to the evidence and its basis. Your team still decides who may establish intent, what evidence is sufficient and who has authority to accept the result.

Try it on your software

Choose one claim to challenge independently.

Bring the author’s explanation and the contract it is supposed to satisfy.