All posts
// / Blog

Hot take: most ML projects have zero tests. And most ML engineers don't know what to test.

Testing ML systems is fundamentally different from testing software. You're not just checking "does this function return the right output?" You're checking "does this statistical system behave within acceptable bounds?"

What I test in every ML project:

Data tests: schema validation, distribution checks, null/missing value detection, duplicate detection. These run before training and catch 60% of issues.

Model tests: performance above threshold on test set, performance above threshold on each important subgroup, predictions within expected range, latency within SLA.

Pipeline tests: training reproducibility (same data + same config = same results), preprocessing consistency between training and inference, end-to-end integration from input to prediction.

Regression tests: when you change anything, verify you haven't broken things that were working.

The framework: pytest for orchestration, Great Expectations for data validation, custom assertions for model performance.

Setting this up takes about two days. After that, every code change runs through the test suite automatically. It's caught more bugs than I can count, and it's saved me from deploying broken models more times than I want to admit.

Write tests for your ML code. Your future self is begging you.

#MLTesting#MachineLearning#SoftwareEngineering#QualityAssurance#MLOps#Pytest