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
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

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.



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.