Behavior contract before changing the source state

A migration must preserve more than happy-path output. A behavior contract covers inputs, outputs, errors, side effects, order and timing where they are observable, idempotency, retries, persistence, and recovery behavior.

The contract does not mean that implementation or internal structure remains unchanged. It defines what must be compared between source and target and which deviation requires an owner decision.

Phased migration plan

PhaseEvidence gateDecisionRollback/hold
Discoverysource state and scope are reproducibleproceed to analysishold on critical unknowns
Analysischangelog, graph, and matrix have anchorschoose a pilotnarrow scope or hold
Pilotbounded slice and behavior checkstest the target hypothesisreturn to the source checkpoint
Verificationfocused and contract checksexpand or reworkrollback on discrepancy
Expand / holdrisk gate and owner decisionincrease coverage or stopdisable/rollback by procedure
Retirementexit criteria and migration evidenceremove the old path only after evidencekeep coexistence

Phase fields that cannot be skipped

  • one bounded scope and a responsible owner;
  • a concrete evidence gate, not a general “check it”;
  • exit criteria that can be observed or reproduced;
  • a practical rollback or hold action with a known return point;
  • a GO, HOLD, narrow, or rollback decision with an explanation and open unknowns.

A plan is not evidence that migration was completed

A documented migration plan describes a future sequence and decision criteria. It does not prove that dependencies were updated, the pilot passed, production is compatible, or rollout finished. An actual result appears only after real commands, tests, review, and an evidence record.

If the behavior contract cannot be checked or the compatibility matrix contains a blocking Unknown, the correct decision is HOLD rather than an optimistic GO.

Canonical lesson source · JavaRush

Open JavaRush material