BEHAVIOR_INVENTORY.md describes business flows
`BEHAVIOR_INVENTORY.md` is needed before changes in a system where actual behavior matters. It is not a file list or an architecture diagram: each entry describes a business flow, inputs, observable outputs, existing tests, missing checks, and a characterization candidate.
The candidate must have an explicit `yes` or `no`. `yes` is appropriate for a high-risk/high-business-criticality flow, an uncovered edge case, or a situation where code and documentation conflict.
Schema for one entry
| Field | Content |
|---|---|
| Flow | Name of the business scenario and its boundaries |
| Current behavior | What the system actually does, with a confidence label |
| Inputs | Reproducible data, state, time, flags, or events |
| Outputs | Statuses, amounts, dates, records, messages, or side effects |
| Existing tests | Tests and the level they cover |
| Missing checks | Specific uncovered conditions or manual checks |
| Characterization candidate | yes / no and a short rationale |
| Evidence | Source, test, config, log, or another anchor |
Five required flows
- pause/resume subscription — check subscription state, pause interval, resume date, and next charge;
- partial refund in the middle of billing period — record amount, period, rounding, and observable ledger output;
- failed payment followed by successful retry — separate failure, retry schedule, subsequent success, and user notification;
- plan switch on billing day — check date precedence, old/new plan, and the amount at the period boundary;
- upgrade/downgrade in the middle of a period — separate prorating, effective date, credits, and the future invoice.
Inputs, outputs, and evidence must be reproducible
For each flow, specify the minimum inputs: state identifier, timestamp or billing date, plan, amount, feature flag, and an external event if needed. Outputs must be observable: a status transition, invoice/refund amount, next billing date, persisted record, or message. Do not write “works correctly” without a concrete observable result.
Show existing tests with their path and level. If there are no tests, that is a missing check, not proof that the behavior is wrong. Separate confirmed facts, assumptions, and manual verification just as in ARCHITECTURE_CURRENT.md.
From inventory to a characterization candidate
- Choose approximately 10–15 strongest candidates rather than every possible condition.
- Set
yesfor costly, uncovered, or conflicting flows; setnowhen behavior is sufficiently confirmed and risk is low. - Record reproducible inputs and observable outputs.
- Add evidence anchors and a list of what must be checked manually.
- Pass high/high entries to RISK_MAP.md with a concrete action.
- Do not write characterization tests as part of this discovery task.
Canonical lesson source · JavaRush
Open JavaRush material