Testing Fundamentals

Build a test architecture that gives your pipeline the confidence to deploy any change, even when dependencies outside your control are unavailable.

Phase 1 - Foundations | Scope: Team

Continuous delivery requires that trunk always be releasable, which means testing it automatically on every change. A collection of tests is not enough. You need a test architecture: different test types working together so the pipeline can confidently deploy any change, even when external systems are unavailable.

Testing Goals for CD

Your test suite must meet these goals before it can support continuous delivery.

GoalTargetHow to Measure
FastCI gating tests < 10 minutes; full acceptance suite < 1 hourCI gating suite duration; full acceptance suite duration
DeterministicSame code always produces the same resultFlaky test count: 0 in the gating suite
Catches real bugsTests fail when behavior is wrong, not when implementation changesDefect escape rate trending down
Independent of external systemsPipeline can determine deployability without any dependency being availableExternal dependencies in gating tests: 0
Test doubles stay currentContract tests confirm test doubles match realityAll contract tests passing within last 24 hours
Coverage trends upEvery new change gets a testCoverage percentage increasing over time

In This Section

PageWhat You’ll Learn
Test ArchitectureThe principles behind a CD test suite: the pyramid, the trophy, and determinism
What to TestWhich boundaries matter and how to eliminate external dependencies from your pipeline
Pipeline Test StrategyWhat tests run where in a CD pipeline and how contract tests validate test doubles
Getting StartedAudit your current suite, fix flaky tests, and decouple from external systems
Defect Feedback LoopTrace defects to their origin and prevent entire categories of bugs
Test TypesDefinitions of each test type and where it runs in the pipeline
PatternsHow to fully test eight common component patterns, from API providers to stateful services
Applied Testing StrategiesCross-cutting concerns and a pre-ship checklist for any component
Test Feedback SpeedWhy suite speed matters and the targets that follow from cognitive limits
Testing AntipatternsCommon testing antipatterns and how to get an existing suite back on track
Testing GlossaryDefinitions for testing terms as this site uses them

The Ice Cream Cone: What to Avoid

An inverted test distribution, with too many slow end-to-end tests and too few fast unit tests, is the most common testing barrier to CD.

The ice cream cone anti-pattern: an inverted test distribution where most testing effort goes to manual and end-to-end tests at the top, with too few fast unit tests at the bottom

The ice cream cone makes CD impossible. Manual testing gates block every release. End-to-end tests take hours, fail randomly, and depend on external systems being healthy. For the test architecture that replaces this, see Pipeline Test Strategy and the Testing reference.

Next Step

Automate your build process so that building, testing, and packaging happen with a single command. Continue to Build Automation.


Content contributed by Dojo Consortium, licensed under CC BY 4.0. Additional concepts drawn from Ham Vocke, The Practical Test Pyramid, and Toby Clemson, Testing Strategies in a Microservice Architecture.



Test Architecture

Test architecture, types, and good practices for building confidence in your delivery pipeline.

What to Test - and What Not To

The principles that determine what belongs in your test suite and what does not - focusing on interfaces, isolating what you control, and applying the same pattern to frontend and backend.

Pipeline Test Strategy

What tests run where in a CD pipeline, how contract tests validate the test doubles used inside the pipeline, and why everything that blocks deployment must be deterministic.

Getting Started

Practical steps to audit your test suite, fix flaky tests, decouple from external dependencies, and adopt test-driven development.

Defect Feedback Loop

How to trace defects to their origin and make systemic changes that prevent entire categories of bugs from recurring.

Test Types

Definitions of the test types used throughout this site.

Patterns

Eight common component patterns and how to test each fully. Each page covers what to verify, positive and negative cases, double validation, pipeline placement, and a small code example.

Applied Testing Strategies

Practical guidance for fully testing eight common component patterns: API providers, API consumers, scheduled jobs, user interfaces, event consumers, event producers, CLI tools and libraries, and stateful services.

Test Feedback Speed

Why test suite speed matters for developer effectiveness and how cognitive limits set the targets.

Testing Antipatterns

Common testing antipatterns that block CD, plus a migration guide for getting an existing suite back on track.

Testing Glossary

Definitions for testing terms as they are used on this site.