Shelves / Testing
Software Engineering · Volume 11
Testing
Part XI of the Software Engineering roadmap, written out as a textbook that starts from zero. The opening chapter assumes you have written code but few tests, and tests one billing function three ways, including a property test that finds a real bug. From there: what testing is for and what each level costs, unit tests that can actually fail, integration tests against real dependencies, consumer-driven contracts, end-to-end journeys in a real browser, performance testing and chaos experiments. Every chapter opens with a plain-language Start here section and a six-level How deep to go ladder, and ends with a lab of real, measured experiments (the cost of each test level, flaky tests made and cured, coverage against mutation testing, the Go race detector, SQLite against PostgreSQL, a deterministic double-booking race, Pact verification of three provider versions, Playwright locators surviving a redesign, k6 load tests through the capacity cliff, a Toxiproxy fault with and without a fix) and a revision sheet with a quiz. A final chapter of seven projects builds a test suite you would trust to deploy on.
Two ways to read this book
Every chapter has the same shape: Start here (first principles, plain language, small verified examples) → How deep to go (what each mastery level needs) → full-depth sections → Lab (experiments with real measured output) → Revision sheet (key ideas, numbers to remember, pitfalls, glossary, quiz).
How to use this book
- Read one topic at a time. Each topic heading has a Done tick. Tick it only when you can explain the idea aloud without looking, which is roughly mastery level L2–L3 below.
- Run the code. Every comparison block has tabs for each language; type the example out in at least two of them.
- Take the chapter quiz at the end. A score of 80% or more counts as passed. Wrong answers show the explanation, so re-read that topic and untick it if needed.
- Revisit after a delay. The roadmap's loop applies: recall, explain, implement without notes, break it, measure it.
Mastery levels
Languages used throughout
Status as of October 2026: JUnit 6 (September 2025, Java 17 baseline) is current; Testcontainers for Java 2.x renamed its modules (testcontainers-postgresql, package org.testcontainers.postgresql) and dropped JUnit 4; Grafana k6 is on the 2.x line; Playwright is the default choice for browser end-to-end tests. Versions move fast, so check the docs for exact APIs.
Contents
- SC·00Start Here: Your First TestsFor readers who have written code but few or no tests: what a test is and what it buys you, one small billing function tested three ways (example…6 min
- SC·114Testing PhilosophyWhy we test and how much: confidence as the goal, the layers that produce it (types and static analysis, tests, reviews, observability, production…16 min
- SC·115Unit TestingFast, isolated, deterministic tests of units of behaviour: what a unit is, frameworks in each language (JUnit 6, go test, pytest, cargo test, Vitest…25 min
- SC·116Integration TestingTesting your code against real boundaries: why mocks aren't enough, databases (migrations, transactions, isolation, per-test cleanup), message…19 min
- SC·117Contract TestingVerifying that services agree on their interfaces without running them all together: the integration problem in distributed systems, consumer-driven…16 min
- SC·118End-to-End TestingTesting whole user journeys through the real system: what E2E tests are for and how few you need, browser automation with Playwright (auto-waiting…20 min
- SC·119Performance TestingMeasuring how a system behaves under load: questions performance tests answer, the vocabulary (throughput, latency percentiles, concurrency…19 min
- SC·120Chaos and Resilience TestingDeliberately injecting failure to prove systems survive it: the principles of chaos engineering, steady-state hypotheses, blast radius and abort…18 min
- SC·121Testing ProjectsSeven build-it-yourself projects that give the tiffin centre a test suite you'd trust to deploy on: a measured test strategy, a unit suite hardened…7 min