Testing in Practice
The testing that shows up in real codebases: suite structure, unit and integration boundaries, fakes and fixtures, API and browser automation, flakiness, CI, coverage, visual and accessibility checks, and the metrics worth reporting.
Start courseWhat you will cover
- Structuring a Test SuiteHow a suite is laid out decides whether people run it. Naming, grouping, shared setup, the fast/slow split, and keeping the failure message enough to diagnose from.30 min
- Unit Tests That Earn Their KeepThe difference between testing behaviour and testing implementation, why the second kind fails on every refactor, and how to pick the unit worth isolating.30 min
- Integration Tests and Their SeamsWhere to cut a system so an integration test is both realistic and fast: the seams worth testing across, and the ones that are really end-to-end tests in disguise.30 min
- Faking External ServicesThird-party APIs are slow, rate-limited and occasionally down. Stubs, fakes, recorded responses and local doubles — and how to notice when your fake has drifted from reality.30 min
- Test Data Fixtures and FactoriesShared fixtures rot and duplicated setup hides intent. Factories with sensible defaults, building only what the test is about, and making the interesting value obvious.30 min
- Database State and IsolationTests that pass alone and fail together are almost always sharing state. Transactions, truncation, per-test schemas and why ordering dependence is a bug in the suite.30 min
- Testing an HTTP APIStatus codes, headers, schemas and error bodies — testing the contract rather than the handler, including the authorisation cases everyone forgets.30 min
- Browser Tests With PlaywrightEnd-to-end tests that are not a liability: auto-waiting instead of sleeps, one user journey per test, tracing a failure, and running the same spec across browsers.35 min
- Locators and Page ObjectsWhy CSS-path selectors break every sprint. Locating elements the way a user finds them, test ids as a deliberate contract, and page objects that help rather than hide.30 min
- Killing Flaky TestsA flaky test is a bug report about your suite. The four real causes — timing, shared state, ordering, real non-determinism — how to reproduce each, and why retries are not a fix.30 min
- Running the Suite in CIGetting from works-on-my-machine to a signal the team trusts: what runs on a pull request versus nightly, caching, artefacts on failure, and keeping the pipeline honest.30 min
- What Coverage Does Not Tell YouLine, branch and path coverage, what each measures, and why a 90% number can sit on top of tests that assert nothing. Using coverage as a question, not a target.25 min
- Visual and Snapshot TestingCatching the change no assertion describes. Snapshot tests and their rot, visual diffs and their noise, and how to keep either from becoming a rubber stamp.30 min
- Accessibility Checks in the PipelineWhat an automated audit can catch, the much larger part it cannot, and how to wire the machine-checkable half into CI without pretending the job is done.30 min
- Bug Triage and Quality MetricsRunning triage so the queue stays meaningful, and choosing measures that survive contact with incentives — escaped defects and time-to-detect over test counts and pass rates.30 min