Unit 17 · lesson

Version 1 Must Be Testable, Not Perfect

Version 1 is the first integrated implementation you can evaluate against requirements.

Its purpose is not to look finished. Its purpose is to create evidence.

Build vertical behavior first

A useful implementation slice crosses the real architecture:

input/fixture -> parse/model -> core behavior -> output

One complete narrow path gives more information than ten disconnected classes containing placeholders.

Then add requirements incrementally.

Maintain a requirement trace

Use:

requirementcomponent(s)test caseVersion 1 status
R1parserT1/T2pass
R2score serviceT3/T4pass
R3formatterT5not yet

A requirement without an implementation owner or test is not finished because the app launches.

Create the test matrix before final polish

Include:

  • normal cases;
  • boundary cases;
  • invalid cases;
  • empty-data behavior;
  • one interaction/integration case;
  • one regression case from a defect found during development.

Full-JDK lane: encode appropriate unit cases in JUnit 6 and preserve runner output.

Browser core: use deterministic expected/actual checks and preserve the same matrix.

Leave evidence of reality

If Version 1 has a defect, do not immediately erase it from history.

Preserve:

requirement violated
input/state
expected
actual
reproducer
current hypothesis

Unit 18 will turn one real failure into a root-cause and revision dossier.

If your first implementation somehow passes every case, deliberately inject a bounded code defect into a copy, such as an off-by-one boundary or reversed comparison. Do not invent fake evidence claiming the original naturally failed.

Label deliberate fault injection honestly.

Separate incomplete from failing

These are different:

Not implemented: R5 has no Version 1 behavior yet.
Failing: R3 is implemented but test T7 produces wrong output.
Passing: R2 satisfies T3/T4.

Do not mark an unimplemented feature as a failed test if no behavior exists to test.

Version 1 review

Before moving on, another learner or your future self should be able to answer:

  • What requirements are implemented?
  • Which are not?
  • Which tests pass?
  • Which fail?
  • What limitation is known?
  • What environment was actually executed?

Evidence

Submit Version 1 source/project, the requirements trace, the test matrix with actual results, and one preserved defect or clearly labeled injected-fault copy for Unit 18 analysis.