TestingVol. 11 · Part XI
0 / 0

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.

9 chapters◷ ~2 h to read ✓ 195 topics? 9 quizzes

Two ways to read this book

New to the subjectStart with the opening Start Here chapter and read chapters in order. In each chapter, read the Start here section, run its examples, answer Check yourself before opening the answers, and take the quiz. Read the deeper sections once the Start here quiz is easy; leave the hardest parts for a second pass. Build the projects in the final chapter as you go.
Experienced engineerSkip the opening chapter. In each chapter, read the Revision sheet at the end first and take its quiz; skim Start here; then use How deep to go to pick the internals sections and lab experiments that fill your gaps. Tick a topic only when you could teach it.

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

  1. 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.
  2. Run the code. Every comparison block has tabs for each language; type the example out in at least two of them.
  3. 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.
  4. Revisit after a delay. The roadmap's loop applies: recall, explain, implement without notes, break it, measure it.

Mastery levels

L1 RecognitionDefine it and identify it.
L2 WorkingUse it correctly in code or config.
L3 InternalsExplain why it works.
L4 DebuggingDiagnose failures and performance problems.
L5 DesignChoose among competing approaches.
L6 ProductionOperate it under scale, failure, security and cost.

Languages used throughout

JUnit 6 · Mockito · AssertJgo test · testifypytest · Hypothesiscargo test · proptestVitest · PlaywrightTestcontainers · Pactk6 · Gatling · Chaos Mesh

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

  1. 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
  2. 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
  3. 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
  4. SC·116Integration TestingTesting your code against real boundaries: why mocks aren't enough, databases (migrations, transactions, isolation, per-test cleanup), message…19 min
  5. SC·117Contract TestingVerifying that services agree on their interfaces without running them all together: the integration problem in distributed systems, consumer-driven…16 min
  6. 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
  7. SC·119Performance TestingMeasuring how a system behaves under load: questions performance tests answer, the vocabulary (throughput, latency percentiles, concurrency…19 min
  8. 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
  9. 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