Comparing Call-Order and Observable-Outcome Checks
Comparing Call-Order and Observable-Outcome Checks
Predict the results of a strict internal call-order check and an observable-outcome check after a harmless refactor and after a behavior regression.
Unit testingReturns one step above the limit.
Prepare diagnostic context → Prepare warning label. Independent internal preparations with no externally visible effects.
Warning raised.
Prepare diagnostic context → Prepare warning label. Matches expectation.
Warning raised. Same input one step above the limit.
Prepare warning label → Prepare diagnostic context. Expected order stays diagnostic context → warning label.
Warning raised, as expected, at the same stub input.
Predict which check still passes.
Predict which check passes when the helpers swap order and the verdict stays the same.Expected: diagnostic context → warning label. Observed: warning label → diagnostic context.
Expected and observed: warning raised.
Actual and expected order: diagnostic context → warning label.
No warning. Expected warning raised for the same input.
Predict which check catches the regression.
Predict which check catches a wrong verdict when the internal calls still match.Expected and observed: diagnostic context → warning label.
Expected warning raised; observed no warning.
Assert strict order when the sequence itself is required behavior.
Pin the expectations
Set up separate checks for internal call order and the returned verdict.
Technical boundaries. The replay uses a temperature stub fixed one step above the limit and assumes the two helper calls have no externally visible effects. It compares the baseline with a helper swap and a wrong verdict for that same input.