Software Testing Fundamentals
Write fast, readable automated tests with a unit-test framework and decide what to test at each level of the test pyramid.
4 objectives 6 steps about 115 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Write unit tests with a unit-test framework (pytest in the reference stack, Vitest for JavaScript/TypeScript) using arrange-act-assert, parametrized cases and shared fixtures, including tests for error paths.
- Replace slow or external collaborators with test doubles (fakes, stubs or mocks), and explain when a fake is preferable to a mock.
- Write in-process endpoint tests for a web endpoint or other entry point, asserting on its observable outputs (status, headers, body or return value).
- Choose the test level (unit, integration, end-to-end) for a behavior and use a coverage report to find untested branches.
Lesson plan
6 steps, about 115 min · 5 of 5 lessons available so far
- Why Automated Tests, and What to Test First Concept · 15 min
- Framework Essentials: Asserts, Fixtures and Parametrized Cases (pytest or Vitest) Worked example · 25 min
- Fakes, Stubs and Mocks Without Over-Mocking Concept · 20 min
- Lab: Testing Endpoints with a Test Client Lab · 25 min
- Reading Coverage and Choosing Test Levels Worked example · 15 min
- Check: Find the Missing Test Knowledge check · 8 questions
Practise it
Add a pytest suite to your FastAPI app: parametrized unit tests for a validation helper, a fake repository injected through a dependency override, endpoint tests for 2xx, 404 and 422 cases, and a branch-coverage report whose remaining gaps you explain. Learners on a JavaScript stack meet the same objectives with Vitest against a Node or Next.js route handler.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own Web FrameworkIntermediate · 8–15 h
- Build your own PromiseIntro · 3–6 h
- Build your own Command-Line ToolIntro · 3–8 h
References
Hard prerequisites
Unlocks
On these roadmaps
Progress and evidence for this skill are shared across all of them.