Software Testing and Quality

After this course you can write a unit test that fails for the right reason, choose cases that find bugs, test a service against a real database and its API contract, cure a flaky suite, measure a suite with mutation testing, test time, concurrency, money and AI features, run tests fast in CI, and write the test strategy for a product.

36/36 CHAPTERS5 MODULES~41 H WRITTEN SO FAR
START WITH Why we test: what a test can and cannot prove ▸
LAB STACK

labs/testing: Ojaline's checkout service (FastAPI and SQLite on Python 3.9) as the system under test, with a fake payment provider, pytest, Hypothesis, a mutation-testing tool, Playwright for browser tests, a deterministic fake model for AI evals, a small Python model checker and an example CI pipeline; ten seeded bugs applied as patches for the senior project. No Docker required.

SHOW UP TO

BEFORE YOU START

This course assumes you can already do the following. Each line says where ATLAS teaches it.

MODULE 1

Foundations

BEGINNER 7/7 WRITTEN

Why we test, a first unit test, what a good test looks like, test doubles, choosing cases and running tests on every change. You finish by putting a legacy function under test and finding its bug.

  1. 01 Why we test: what a test can and cannot prove A green suite says these inputs gave these outputs on this code. It does not say the code is right, and the gap is where the incidents live 40 MIN
  2. 02 A first unit test Arrange, act, assert: write one test for one function, watch it fail for the wrong reason and then the right one, and read what pytest tells you 40 MIN
  3. 03 What a good test looks like: one behaviour, a clear failure A test is read most when it fails. Write it for the person reading the failure at two in the morning. 40 MIN
  4. 04 Fakes, stubs and mocks, and when each one lies Three ways to replace a dependency in a test, and the one thing none of them can promise: that the real thing still behaves like your copy 50 MIN
  5. 05 Choosing cases: boundaries, equivalence classes and the unhappy path You cannot test every input. Split them into classes the code treats alike, test one inside each class, test both sides of every edge, then decide what the bad inputs should do 45 MIN
  6. 06 Running tests on every change A test nobody runs proves nothing: put the fast tests before the push, the full suite on every merge, and the slow ones overnight 45 MIN
  7. 07 Project: put a legacy function under test and find its bugPROJECT Pin what the old code does, ask what must always be true, and let a property find the input you would never have tried 90 MIN
MODULE 2

Testing a service

WORKING 9/9 WRITTEN

The shape of a suite, integration tests with a real database, API and contract tests, browser tests, test data, flaky tests, coverage and mutation testing, and test-driven development. You finish with a suite for the shop API.

  1. 08 The shape of a suite: pyramid, trophy and what fits your system How many tests at which level is a cost decision: measure what each tier costs and what it touches, then choose the shape for this system 45 MIN
  2. 09 Integration tests with a real database A dict can pretend to be your repository. It cannot pretend to be your constraints, your transactions or your SQL, and those are where the order bugs live. 50 MIN
  3. 10 API and contract tests Test the service through its front door, then test the one thing a mock cannot: that both sides of a wire still agree about what crosses it 55 MIN
  4. 11 End-to-end and browser tests The one test that drives the real page, the real API and the real database together: what it proves, why it flakes, and how to write the few you keep 50 MIN
  5. 12 Test data and fixtures: building the world a test needs Every test needs a world to run in. Build it fresh, name only what matters, and a shuffled run stops being a surprise 45 MIN
  6. 13 Flaky tests: causes, quarantine and cure A test that fails one run in twenty is not noise: it is a measurement, and you can take it, then fix the wait, the shared state or the product 60 MIN
  7. 14 Coverage and mutation testing: measuring the tests Coverage says which lines ran. Mutation testing breaks the code on purpose and counts how many breaks your tests notice. Use the first to find what you skipped and the second to find what you did not check 50 MIN
  8. 15 Test-driven development in practice, and when not to Red, green, refactor in steps small enough to survive a bad afternoon, a rule built that way in the lab, and the cases where writing the test first is the wrong tool 55 MIN
  9. 16 Project: a suite for the checkout service that runs in under two minutesPROJECT Four tiers, a flaky test cured, a coverage floor and a mutation score you set and defend, all behind one gate with a clock on every stage 150 MIN
MODULE 3

Hard things to test

SENIOR 9/9 WRITTEN

Property-based testing, time and concurrency, tests across services, performance, security, data pipelines, AI features and money. You finish with a suite that catches ten seeded bugs, measured by mutation score.

  1. 17 Property-based testing: say what is always true, let the machine hunt An example test checks the inputs you thought of. A property states a rule for every input and a generator goes looking for the one that breaks it 50 MIN
  2. 18 Testing time, randomness and concurrency Three inputs your test does not control: the clock, the dice and the scheduler. Hold each one still, print the seed, and make two threads arrive on the same beat 65 MIN
  3. 19 Testing across services: fault injection and deterministic simulation A timeout is not a failure, it is a question you cannot answer. Make the provider fail on demand, then let one seed explore the failures you would never think to combine 55 MIN
  4. 20 Performance and load tests as part of the suite A test that fails when the service gets slow is a test with a budget: count the work, open the load, and set thresholds you can defend 55 MIN
  5. 21 Security testing: fuzzing, scanners and abuse cases Test the rules security depends on, feed the API what no customer would, and know what a scanner can and cannot tell you 55 MIN
  6. 22 Testing data pipelines and migrations A migration runs once and cannot be undone by a code review. A pipeline runs every night on data nobody chose. Test both against data you built to be awkward. 55 MIN
  7. 23 Testing AI features: evals as tests, and tests written by AI A model gives a different answer on a different day, so a test of it is a rate with an interval, a few cases that may never fail, and ordinary tests around it, and a test an assistant writes for you is only as good as the faults it catches 60 MIN
  8. 24 Testing money: invariants, reconciliation and evidence for a regulator Tests before release prove the arithmetic. A reconciliation after release proves the books. An evidence file proves the reconciliation ran, and you have to design all three 60 MIN
  9. 25 Project: a suite that catches ten seeded bugs, measured by mutation scorePROJECT Ten bugs are hidden in the checkout service. You are not told what they are. Write tests until every one is caught, then measure what the suite would still miss 180 MIN
MODULE 4

Quality across an organisation

STAFF 6/6 WRITTEN

A test strategy, CI at scale, testing in production, quality metrics and AI agents in the test loop. You finish with the test strategy for a payments product.

  1. 26 A test strategy for a product A strategy is an argument with evidence: the risks, the cheapest level that covers each, what you leave out, and numbers you can re-measure 55 MIN
  2. 27 CI at scale: speed, sharding and test selection When the suite takes 41 minutes, nobody waits for it: split the files by measured time, run only what a change can reach, and keep one full run as the net 55 MIN
  3. 28 Testing in production: canaries, flags and synthetic checks Staging cannot reproduce your users. Test the change on a slice of real traffic, with a size you chose, a rule for stopping you wrote first, and a switch that works in seconds 55 MIN
  4. 29 Quality metrics that mean something A metric is a question with a definition, a source, a decision it informs and a list of uses it must never get. Compute coverage, mutation score, flake rate, escape rate and time to green on the lab, then watch each one break when someone sets it as a target 55 MIN
  5. 30 AI agents in the test loop: generation, triage and what to verify An agent writes tests fast and fixes red builds faster, and both jobs have a failure that looks like success: a suite that is green because nothing checks anything, and a fix that is green because the test was edited. Measure the first, and treat a changed expectation as a change to the specification 60 MIN
  6. 31 Project: the test strategy for a payments productPROJECT Write six pages that say how Owoleaf's wallet is judged safe to release, and make every number in them trace to a command you ran 180 MIN
MODULE 5

Frontier and judgment

PRINCIPAL 5/5 WRITTEN

The history of the ideas, what research says about tests and defects, formal methods where they pay, and what not to test.

  1. 32 A history: from debugging to test-driven development to chaos Every testing technique was invented to fix the blind spot of the one before it, and you choose better when you know which blind spot you are paying to fix 45 MIN
  2. 33 What the research says about tests, reviews and defects Eight studies, what each one measured, how many things it looked at, and what it cannot tell you. Then a ten-bug replication of the best-known one on the checkout lab 55 MIN
  3. 34 Formal methods where they pay: TLA+, model checking and proofs A test samples the runs you can afford. A model checker visits every run of a small model. A proof covers every run of a rule. Each costs more than the one before, and each pays only in the right place 55 MIN
  4. 35 What not to test: the tests that cost more than they protect Every test costs time to run, time to read and time to fix when the code moves. Measure what each one buys, delete the ones that buy nothing, and write the rule a new test must meet 55 MIN
  5. 36 Capstone: the quality strategyPROJECT Write the strategy for 300 engineers and about 150 services: tiers, floors, owners and a twelve-month plan, backed by what one service can show and honest about what it cannot 240 MIN