Code Coverage - Measuring What You Test (and What You Miss)
Master code coverage at engineering depth - line vs branch vs condition coverage, coverage.py internals with sys.settrace, pytest-cov, .coveragerc configuration, pragma no cover, coverage in CI, and mutation testing with mutmut to find tests that pass but don't catch bugs.
Hexagonal Architecture
Ports and Adapters - structuring Python applications so business logic is independent of frameworks, databases, and external services.
Linting and Formatting - Ruff, Black, isort, and mypy
Master Python code quality tooling at engineering depth - Ruff's rule categories, Black's opinionated formatting, isort profiles, mypy static type checking, pyproject.toml configuration, and how to wire all tools into a coherent developer workflow.
Mocking - Patch Where the Name Is Used, Not Where It Is Defined
Master Python mocking at engineering depth - the golden patching rule, Mock vs MagicMock, patch as decorator and context manager, autospec, side_effect, AsyncMock, pytest-mock, and the typo that silently passes your tests.
Module 04 - Testing and Quality Overview
Build production-grade test suites at engineering depth - unittest, pytest, mocking, TDD, code coverage, linting, and pre-commit hooks that enforce quality at every commit.
Module 04 Projects - Testing and Quality
Overview of the two hands-on engineering projects for the Testing and Quality module - a full pytest suite for a banking system and a complete CI quality pipeline setup.
Pre-Commit Hooks - Automate Quality Gates Before Every Commit
Master the pre-commit framework at engineering depth - Git hook mechanics, .pre-commit-config.yaml structure, building production hook pipelines with ruff, black, mypy, detect-secrets, and pytest, CI integration, team adoption strategy, and hook performance tuning.
Project 01 - Full Test Suite for a Banking System
Build a production-quality pytest test suite for the BankAccount and SavingsAccount system - fixtures, parametrized edge cases, mocked external dependencies, integration tests, Hypothesis property-based tests, and 90% branch coverage enforcement.
Project 02 - CI Quality Pipeline Setup
Configure a complete Python quality pipeline from scratch - pre-commit hooks, pyproject.toml tool configuration, GitLab CI four-stage pipeline, tox/nox multi-version testing, Makefile targets, coverage gate, and JUnit test report artifacts.
pytest - The Industry-Standard Test Framework
Master pytest at full engineering depth - assertion rewriting via AST transformation, fixtures with scope, conftest.py, parametrize, monkeypatch, capsys, built-in marks, essential plugins, and pyproject.toml configuration for production test suites.
Python Code Coverage Practice Problems & Exercises
Solve 11 Python code coverage problems (4 Easy, 4 Medium, 3 Hard). Practice coverage.py exercises, branch coverage with hints, runnable code, and solutions.
Python Linting and Formatting Practice Problems & Exercises
Solve 11 Python linting and formatting problems. Covers linting practice, formatting exercises, flake8 problems. Hints and solutions.
Python Mocking and Test Doubles Practice Problems & Exercises
Solve 11 Python mocking and test doubles problems. Covers mocking practice, unittest mock, mock patch. Hints and solutions.
Python Pre-Commit Hooks Practice Problems & Exercises
Solve 11 Python pre-commit hooks problems. Covers pre-commit config, git hooks, pre-commit tutorial. Hints and solutions.
Python pytest Framework Practice Problems & Exercises
Solve 11 Python pytest framework problems. Covers pytest practice, pytest exercises, pytest problems. Hints and solutions.
Python TDD Principles Practice Problems & Exercises
Solve 11 Python tdd principles problems. Covers TDD practice, test driven, red green, TDD tutorial. Hints and solutions.
Python unittest Framework Practice Problems & Exercises
Solve 11 Python unittest framework problems (4 Easy, 4 Medium, 3 Hard). Practice unittest practice, unittest exercises with hints, runnable code, and solutions.
TDD Principles - Write the Test First, Let Failure Guide the Design
Master Test-Driven Development at engineering depth - the Red-Green-Refactor cycle, the three laws of TDD, worked BankAccount example, test naming, the test pyramid, London vs Detroit schools, and when TDD surfaces design problems before production.
unittest - The Standard Library Test Framework
Master Python's unittest framework at engineering depth - TestCase lifecycle, all assertion methods, assertRaises as context manager, setUp/tearDown/setUpClass, unittest.mock.patch, TestSuite, skip decorators, and subtests for parametrised testing.