Courses / Web apps & analytics / Software Testing and Test-Driven Development

Free courseSelf-paced

Software Testing and Test-Driven Development

Write requirement-driven unit and integration tests in Python, use the red-green-refactor cycle and report regressions with evidence.

  • Who it's for. Beginning programmers who can write small Python programs and want to prove their code works.
  • Before you start. Courses: Programming Problem Solving.
  • 30 to 51 hours of study with practice
  • 8 modules, 52 lessons
  • 3 guided projects and a final project

What you'll learn

  • Turn a vague requirement into concrete, checkable examples and a prioritised test list.
  • Write precise assertions with a unit test runner and read failures to decide whether the test or the code is wrong.
  • Design test cases with equivalence partitions, boundary values, decision tables and state sequences.
  • Keep tests isolated and deterministic and diagnose flaky tests by cause.
  • Drive a small feature with red-green-refactor and explain where the discipline helps and where it does not.

Skills you'll gain

  • Testable requirements
  • Assertions
  • test runners
  • Normal
  • boundary cases
  • Test isolation
  • TDD cycle
  • Integration tests
  • Doubles
  • fixtures
  • Regression reporting

Tools you'll use

  • Python
  • unittest
  • unittest.mock
  • sqlite3

Details to know

  • Certificate on completionIssued after your final project is reviewed
  • 8 module checkpointsA quiz and a practical task close each module
  • Self-pacedStudy any time; your progress is saved

How every lesson works

Each lesson follows the same four steps, so you always know what comes next.

  1. 01

    Watch & Learn

    A short animated video explains one idea at a time.

  2. 02

    Guided Practice

    Work through an example step by step and check the result.

  3. 03

    Quiz & Challenge

    Short questions check the idea has landed before you move on.

  4. 04

    Mini Project

    Build something useful from a project brief.

Learn at your own pace

This is a self-paced course. There are no live classes and no fixed timetable.

  • Start any timeStudy when it suits you. Lessons are short, so they fit around work or college.
  • Pick up where you left offYour progress is saved to your account.
  • Ask when you're stuckUse Ask Mentor inside the learning platform.

Your path in 4 phases

Each phase ends with something you have built and checked.

  1. 01

    Modules 1 to 3

    Specified and boundary-tested rules module

    Covers Testable requirements, Assertions and test runners and Normal and boundary cases.

    You build: Guided project: Specification-by-example table and observable acceptance criteria for a small rule set (parking, fees or similar, chosen by the learner and approved by the trainer).

  2. 02

    Modules 4 to 5

    Test-driven isolated feature

    Covers Test isolation and TDD cycle.

    You build: Guided project: Per-instance state and injected clock or seed in the feature Step log showing red, green and refactor for at least five test-list items.

  3. 03

    Modules 6 to 7

    Integration and doubles for the feature

    Covers Integration tests and Doubles and fixtures.

    You build: Guided project: Repository integration and round-trip tests against in-memory SQLite Contract suite run against real and fake stores.

  4. 04

    Module 8

    Final project and assessment

    Covers Regression reporting, then the final project: Tested feature library with unit integration and regression evidence.

    You build: Final project.

Full curriculum

8 modules and 52 lessons, 30 to 51 hours of study

01Testable requirements6 lessons, 3 to 4 hours

Lessons

  • What a passing test does and does not show
  • Ambiguous requirement to concrete examples
  • Acceptance criteria written as observable behaviour
  • The oracle: where expected values come from
  • Testability: observable results and controllable inputs
  • Building a prioritised test list

After this module you can

  • Given a function and a small passing suite, state which inputs the suite supports a claim about and name one input class no test covers.
  • Rewrite a vague one-sentence requirement as at least five concrete input/expected-output examples and list the questions that remain open.
  • Produce an ordered test list for a feature that covers a main path, boundaries, errors and one 'cannot happen' case, and justify the top three priorities.
02Assertions and test runners6 lessons, 3 to 4 hours

Lessons

  • Anatomy of a unit test: arrange, act, assert
  • Choosing the precise assertion and reading its message
  • Asserting exceptions precisely
  • Comparing floats with tolerance
  • Failure versus error: reading a red result
  • Discovery, selection and order independence across runners

After this module you can

  • Write a unittest TestCase whose methods each have a distinct arrange, act and assert part and run it with the standard discovery command.
  • Select the most specific assertion method for equality, membership, identity and truthiness checks and predict the failure message for a wrong value.
  • Run a single test, a class or the whole suite with unittest's command line and show by running in reversed order that the suite does not depend on order.
03Normal and boundary cases7 lessons, 3 to 5 hours

Lessons

  • Equivalence partitions from a rule
  • Boundary value analysis: on, off and in points
  • Invalid input: deciding and testing the error contract
  • Decision tables for combined conditions
  • Data-driven cases with subTest
  • State and sequence cases
  • Invariants and seeded randomised checks

After this module you can

  • Split an input domain into valid and invalid equivalence classes from a written rule and pick one representative per class.
  • For each interval boundary in a rule, list the on-point, off-point and an in-point and write tests that catch an off-by-one in the comparison operator.
  • State two invariants of a function and test them over many inputs from a seeded random generator, reporting the seed on failure.
04Test isolation6 lessons, 3 to 4 hours

Lessons

  • Shared mutable state between tests
  • setUp, tearDown and addCleanup
  • Temporary files and directories
  • Controlling time and randomness
  • Diagnosing flaky tests by cause
  • Waiting for results without sleeping

After this module you can

  • Find the module-level or class-level mutable object that couples two tests and replace it with state created per test.
  • Use setUp for per-test construction and addCleanup for resources so cleanup runs even when the test fails.
  • Replace a fixed `time.sleep` in a test of a background task with polling against a deadline that fails with a clear timeout message.
05TDD cycle7 lessons, 3 to 5 hours

Lessons

  • Red: a failing test for the right reason
  • Green: the smallest change that passes
  • Refactor on green without changing behaviour
  • Triangulation: letting a second example force generality
  • Choosing the next test from the list
  • Bug fixes: reproduce first, then fix
  • Limits of TDD: spikes, design and misuse

After this module you can

  • Write one test for an unimplemented behaviour, run it, and confirm it fails with a message that names the missing behaviour rather than a typo.
  • Make a failing test pass with the smallest change, even a constant, and explain why the next test will force generalisation.
  • Identify common TDD mistakes and cases where a different approach (spike, exploratory work, test-after) is justified, with a stated reason.
06Integration tests6 lessons, 3 to 4 hours

Lessons

  • Unit, integration and end-to-end: what each isolates
  • Testing a boundary: a repository against a real database
  • Round-trip and serialisation checks
  • Setup and teardown for real resources
  • Contract tests between a real component and its fake
  • Pushing a failing end-to-end check down the pyramid

After this module you can

  • Classify given tests as unit, integration or end-to-end by what boundary they cross and state what each can and cannot tell you about a failure.
  • Test a repository class against an in-memory SQLite database to check that its SQL and mapping really work.
  • Given a failing high-level test, write the lowest-level test that reproduces the defect and decide which higher-level tests are redundant.
07Doubles and fixtures7 lessons, 3 to 5 hours

Lessons

  • The five kinds of test double
  • Dependency injection with hand-written stubs and fakes
  • Mock objects: return_value and side_effect
  • Where to patch: the name the code looks up
  • Autospec: doubles that keep the real signature
  • State versus behaviour verification, and over-mocking
  • Fixtures and test data builders

After this module you can

  • Name the double (dummy, stub, fake, spy, mock) described by a short code snippet and say what it verifies.
  • Inject a collaborator through the constructor and replace it with a hand-written stub or fake in a test, without any mocking library.
  • Replace repeated object construction in tests with a builder function that sets sensible defaults and lets each test override only what matters.
08Regression reporting7 lessons, 3 to 5 hours

Lessons

  • Regression tests from defects and their naming
  • Line and branch coverage: reading the report
  • Coverage without assertions: executing is not checking
  • Mutation analysis by hand: kill or survive
  • Mutating a specification to audit a suite
  • Writing a failing-test triage and regression report
  • Assembling the evidence pack for the feature library

After this module you can

  • Turn a closed defect into a permanent regression test with a behaviour-based name, a minimal input and a comment linking to the report.
  • Run a coverage report with branch measurement on a small module and identify one partially covered branch and the test that would cover it.
  • Assemble the capstone evidence pack: suite results on reference and planted defects, coverage, mutation log and the regression report, with commands that reproduce each artefact.

What you'll build

3 guided projects along the way, then a final project.

  • Specified and boundary-tested rules module

    after module 3
  • Test-driven isolated feature

    after module 5
  • Integration and doubles for the feature

    after module 7

Final project

Tested feature library with unit integration and regression evidence.

What you submit

Source and artefact submission: the library, unit tests, integration tests, contract tests and regression tests in one repository Functional checks: suite passes on the reference.

How it's reviewed

Trainer-reviewed demonstration, scored on: Objective: planted-defect kill count, shuffled-order and repeat runs, no sleeps, setup reproducibility (pass/fail each).

Where you'll use it

  • Turn a business rule into boundary test cases before the code is written.
  • Add an integration test against a SQLite repository and isolate a slow external service with a test double.

Roles that use these skills

  • Software Developer
  • QA Engineer
  • Test Automation Engineer

Earn the certificate by building, not watching

  1. Complete the lessons and pass each module checkpoint.
  2. Build your final project and demonstrate it.
  3. OUTLEARN reviews your project and issues your certificate. It is not issued automatically.

Frequently asked questions

What do I need before starting?

Completion of Programming Problem Solving or equivalent: you can read and trace small programs, write functions with conditions, loops and collections, and run a script from a terminal. Python is the lab language, so you also need to read basic Python (functions, lists, dicts, classes with methods, exceptions); a short diagnostic is in COURSE-PLAN.md.

When do I get a certificate?

We do not issue certificates until you successfully build and demonstrate your live project. Staff issue certificates after review; nothing is issued automatically.

Be first in when Software Testing and Test-Driven Development opens

Email us and we will tell you as soon as enrolment opens.

Notify me when it opens
FreeOpens soon
Notify me