Module 04 Projects - Testing and Quality
Two projects. Both are production-grade engineering work, not toy examples.
Before picking a project, answer this question: which is harder - writing the code, or proving the code is correct? Most engineers discover the answer is testing, the first time they try to test code they did not design for testability. These projects teach both the mechanics and the design thinking.
Project 01 - Full Test Suite for a Banking System
Estimated time: 5–7 hours | Difficulty: Intermediate
You wrote a BankAccount and SavingsAccount system in the OOP module. Now you prove it works.
This project covers the full testing pyramid:
- Unit tests for every public method with pytest fixtures
- Parametrized tests for edge cases - zero balances, negative amounts, overdraft limits
- Mocked external dependencies - notification services, audit loggers - so tests are deterministic
- Integration tests for multi-account money transfers
- Property-based tests using Hypothesis - prove invariants hold for all valid inputs, not just the ones you thought of
- Performance test - 10,000 transactions in under 1 second
Key learning: How to write tests before you know what the failures will be. Hypothesis will find failures you would never write as explicit test cases.
Coverage target: 90% branch coverage with pytest-cov.
Project 02 - CI Quality Pipeline Setup
Estimated time: 3–5 hours | Difficulty: Intermediate
Configure the complete quality pipeline for a Python project from scratch. No code to write - only configuration files. But configuration is engineering: every choice has a reason.
This project produces:
.pre-commit-config.yaml- ruff, black, mypy, detect-secrets, fast pytestpyproject.toml- full tool configuration for ruff, black, mypy, coverage.gitlab-ci.yml- four-stage pipeline: lint → test → coverage → buildtox.iniornoxfile.py- test matrix across Python 3.10, 3.11, 3.12Makefile-make lint,make test,make coverage,make all
Key learning: Why configuration choices matter as much as code choices. A misconfigured coverage gate, a missing secret detection hook, or a CI pipeline that does not cache properly are the kinds of problems that cost teams hours or cause security incidents.
Coverage gate: Pipeline fails if branch coverage falls below 85%.
How These Projects Connect
Project 01 produces the test suite. Project 02 produces the pipeline that runs that test suite automatically on every commit and push. Together they represent the complete quality engineering workflow at a professional level.
