Learning & application · 2 of 3
One need, two specifications, two decisions
A correct total can conceal a deficit in a particular period.
Synthetic teaching example. The arithmetic below illustrates requirements conformity and adequacy to a hypothetical use. Its acceptance is limited to the declared didactic ConOps and fixtures. It is not validation of an agronomic model or an assessment performed with external developers.
The need and intended use
A hypothetical analyst needs to identify every deficit period in a twelve-period horizon, so those periods can be investigated. Demand and supply use the same illustrative unit. There is no storage, carryover or compensation between periods. This last condition is a stipulation of the exercise; applying it to a real system would require domain justification.
The code can implement this stipulated rule. It cannot decide whether a real system has carryover, whether the observations are representative, or whether a proposed intervention is scientifically justified.
The input contract
C-INPUT-1 requires exactly twelve ordered periods, P01–P12; supply and demand arrays of twelve integers in the range 0–10000; and the unit demo_units_per_period. All four fields are required. Extra fields, invalid types, duplicate/reordered periods and missing observations are rejected. A recorded zero is valid; a missing value is not silently converted to zero.
| Period | Supply | Demand | Direct arithmetic |
|---|---|---|---|
| P01 | 10 | 10 | No deficit |
| P02 | 14 | 10 | Surplus of 4 |
| P03 | 6 | 10 | Deficit of 4 |
| P04–P12, each | 10 | 10 | No deficit in each period |
| Horizon total | 120 | 120 | Aggregate balance is zero |
Two identified specifications
SRS-AGGREGATE v1
Validate the input, calculate total supply and total demand, and report their difference. This specification does not promise a list of deficit periods.
SRS-PERIOD v1
Validate the input and report every period in which demand exceeds supply, with its deficit. Preserve period identity and order. Equality is not a deficit.
The first specification is deliberately insufficient for the stated per-period need. An aggregate routine may pass verification against SRS-AGGREGATE, but it fails verification against SRS-PERIOD and is rejected for this ConOps. It has not passed the same requirement that it violates.
A small implementation
The downloadable Python module validates the shared contract before either function. The essential computations are shown below; the kit contains the complete validation code, fixtures, tests and runner.
# After C-INPUT-1 has been checked:
balance = sum(supply) - sum(demand)
deficits = [
{"period": p, "deficit": d - s}
for p, s, d in zip(periods, supply, demand)
if s < d
]
Criteria before results
The need, assumptions, both specifications, contract, fixtures and direct expected outputs were recorded and hashed before running the example. The expectations were hand-tabulated; neither candidate generated its own reference answers.
| Assessment | Prospective criterion |
|---|---|
| Verification | Match explicit expected outputs for six valid fixtures; reject sixteen invalid fixtures with the declared contract error; leave inputs unchanged. |
| Intended-use adequacy in the exercise | Identify P03 with deficit 4 under the no-carryover condition. A zero aggregate balance alone is insufficient. |
| Limits | Withhold claims about real-world model validity, intervention effectiveness and external developer comprehension. |
Show the observed result and scoped decisions
44 of 44 function–fixture comparisons passed in the recorded preparation run. Each of the six valid and sixteen invalid fixtures was exercised against both functions. The receipt records Python version, time, source hashes, expectations, observations and preservation of inputs.
| Candidate | Verification reference and result | Decision for the declared use |
|---|---|---|
| Aggregate routine | SRS-AGGREGATE: PASS; output totals 120/120, balance 0. SRS-PERIOD: FAIL; missing period-level output. | Rejected. Does not identify P03's deficit. |
| Period routine | SRS-PERIOD: PASS; output P03, deficit 4. | Accepted for this didactic ConOps and fixtures only. |
A domain validation claim would require evidence connecting a real need, domain assumptions, observations and model behavior to the real decision. This finite synthetic example supplies no such empirical evidence.
Trace the decision back to its basis
| Need or constraint | Implementation / evidence | Effect on decision |
|---|---|---|
| Locate every deficit period | SRS-PERIOD; period_deficits; offset-surplus and multiple-deficit fixtures | Period identities and deficits are required; totals alone are insufficient. |
| No inter-period compensation | Declared ConOps; direct comparison of supply and demand in each period | P02 surplus cannot erase the P03 deficit. |
| Preserve meaning of missing data | C-INPUT-1; null, type, unit, ordering and length rejection cases | Invalid data cannot produce an apparently complete result. |
| Prevent retrospective acceptance | Pre-execution freeze and independent expected values | The observed output is assessed against a previously declared reference. |
Related Manual records include DM-0021 and DM-0022 (rationale and assumptions), DM-0023 (traceability), DM-0028 (units and temporal semantics), DM-0029 (prospective criteria), and DM-0108 (requirement-linked tests). These are explanatory relationships; no certified record is changed.
Inspect or run the example
Download the learning and fresh-reader kit
Extract the ZIP, read README.md, then run python run_demo.py with Python 3.10 or newer. On Windows, py -3 run_demo.py is also suitable. Only the standard library is used. The command writes a new receipt and preserves the preparation evidence.
Kit contents include the complete example, both specifications, predeclared fixtures and results, the conceptual diagram source, the transfer task, assessor guide, blank observation template and checksums.