Skip to content

Deployment Patterns

CI/CD for ML: Test the Model, Not Just the Code

10 min+100 XPStep 1/10

Your unit tests don't know what a model is

Classical CI answers 'does the code work'. ML adds two questions it can't answer: does the pipeline produce a valid model, and is that model good enough to ship? So the pipeline gets three test layers:

  • Code tests — the usual unit and integration suspects, now covering feature logic too
  • Data tests — schema, ranges, null rates, and distribution checks on every pipeline input
  • Model tests — evaluation on golden data, against both a minimum bar and the incumbent champion

Fail any gate and the pipeline stops — the artifact never earns a 'deployable' tag in the registry.

insight

'Training completed without errors' is the ML equivalent of 'it compiles'. Congratulations — the model might still be garbage.