A green test suite for Model M does not mean the factor premium is real. It does mean that stated identities hold under declared tolerances — and that a broken weight constructor fails loudly before a paper trial. This note decides which identity is worth a test and when a tolerance is an economic limit rather than a float accident, building on testing numerical code without reteaching put–call parity oracles.
Learning objectives. By the end of this note you should be able to:
- pick invariants that protect M's dollar-neutral long-short book;
- separate float noise from an economically material weight leak;
- write two concrete tests (weight sum; known-input expected return);
- refuse the claim that "all tests passed" as model validation.
In this lesson
- The decision: which identity, which tolerance?
- Artifact: two tests for M
- Choosing identities worth encoding
- What a green suite authorises
- Worked decision: widen the band or fix the code?
- Desk checkpoint: suite vs validation
- Pitfall: testing the market in unit tests
- Decision card: green enough?
Before you start
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or browse the Professional Quant Practice syllabus.