Skip to content
ML Academy

Engineering, production, governance, cost, communication · insight-1304

Hand engineers a specification with test vectors, not a notebook

Evidence type
practitioner heuristic
Difficulty
medium
Roles
Data scientist, ML engineer
Industries
cross-industry

Summary: situation, action, reason, boundary

  1. Situation

    A data scientist passes a notebook to engineers to reimplement in the serving stack (hypothetical).

  2. Action

    Deliver the input schema with units and null rules, the transformation and scoring specification, pinned library versions, and a file of input and expected-output pairs including edge cases with agreed tolerances. Engineers run the vectors in their CI.

  3. Reason

    A file of executable examples turns a prose description into a checkable contract and exposes mismatches before traffic does.

  4. Boundary

    Any model whose logic is reimplemented by another team or language.

Symptom or risk

The reimplementation differs in rounding, missing-value handling, category order and time zones, and each team blames the other when production disagrees with the notebook.

Exceptions

If the exact artefact is deployed as is, test vectors still guard environment changes but are less critical.

Trade-offs

Building vectors takes effort and needs updating when the model changes.

Pitfalls

Vectors made only of typical rows, which pass while edge cases diverge.

Lessons and concepts