Skip to content
  • Home
  • How To
  • M0
  • M1
  • Agents
  • M2
  • M3
  • M4
  • M5
  • Module 6 - MLOps
  • Progress
  • Contact
  • Pricing
  • Sign in
  • Future
  1. Module 6M6
  2. ›
    S1Project Discipline and Testing
  3. ›
    Intro
  4. ›
    S1›Intro
  1. Module 6
  2. ›
  3. Section 1

Section 6.1: Project Discipline and Testing

A training script that runs in one shared environment, from one folder, is not yet something a team can rebuild. This section takes Lesson 3.2.3's price pipeline, restated in full, and turns it into a project: a uv project with its own environment, exact pins and a lock file, a src package run with python -m listings.train, and a git history. Then it tests the project twice over, first its code with pytest, then the trained model's behavior: a score floor, prices that must not move when nothing that matters changes, and prices that must move the right way when something does.

Everything before this module ran in (bootcamp), the environment Modules 2 to 5 filled one install at a time. Deactivate it and the same script stops on its first import, ModuleNotFoundError: No module named 'joblib', because nothing outside that environment says what the script needs. The failures this section catches are quiet. A copied project that installs from its lock gets the same 11 packages and retrains the same model, 56,562 0.766, where one built from a loose list can resolve other versions on another day. And an encoder that forgets the order of the condition levels still passes a score floor at an error of 59,623, prices "good" below "fair" on every listing, and fails exactly one of 17 tests.

Lessons

  1. From Script to Project - the script restated, a uv project, exact pins with uv add, the lock and uv sync, the src layout and python -m, the folder a command runs from, and what git keeps.
  2. pytest - pytest as a development dependency, test files and assert, fixtures and conftest.py, fixture scope, parametrize and ids, tmp_path, the [tool.pytest] table, and reading a failure.
  3. Testing ML Systems - behavior tests on a trained fixture, the score floor, invariance tests, direction tests, the condition order, the output schema and refusals, and the failure only one test sees.

By the end you will be able to:

  • Turn a working script into a uv project that anyone can rebuild exactly from its lock, and run it from its own environment.
  • Write pytest tests with fixtures, parameters and temporary folders, configure the suite in pyproject.toml, and read what a failure prints.
  • Test a trained model's behavior, a score floor, invariance and the direction of an effect, and catch a model that scores well and prices wrongly.
  • Decide which behavior belongs in the suite, and leave out a direction the model does not actually hold.
Your progress
Current streak
🔥 0
Lessons marked today
0 / 3
Longest streak
0

Sign in

The bootcamp

  • Curriculum
  • How To
  • Pricing
  • Changelog
  • Future

The community

  • Discord
  • Reviews
  • Contact

Follow

  • Instagram
  • X
  • TikTok
  • Reddit

Legal

  • Terms
  • Privacy
  • Refunds

Coming soon on November 16, 2026

The AI/ML Newsletter, free.

SubscribeComing soon on December 1, 2026

Confirm by email, unsubscribe in one click.

Theme