What is shift-left testing?
Definition
Shift-left testing means starting test work earlier in delivery: testers review requirements, tests are written before or with the code, and fast automated checks run on every change before it merges. The aim is to find defects when they are cheapest to fix, while still keeping system, end-to-end and production testing later in the pipeline.
Where does the term shift-left testing come from?
Picture the delivery schedule drawn left to right, from requirements to release. Shifting left means testing work starts closer to the left edge. Larry Smith named the idea in Shift-Left Testing, a Dr. Dobb's article from September 2001. His version is worth rereading, because it is not what many teams now do under the label.
Smith did not move testing onto developers. He moved testers into the development team. A QA engineer was assigned when each task was first staffed, went to the team's meetings, and wrote the test specification while the functional specification was still being written. His reason was blunt: "Development programmers are quite simply not good at finding bugs." One payoff he reported was speed. Bugs he found were fixed in minutes instead of days, because he walked over to the developer instead of filing them through the bug tracker.
The current mainstream definition comes from the ISTQB Certified Tester Foundation Level syllabus (v4.0.1, September 2024, section 2.1.5). It calls shift left another name for its early testing principle, and adds a limit that is easy to skip: testing earlier "does not mean that testing later in the SDLC should be neglected."
What moves left in practice?
The syllabus lists five practices. Each one catches a class of defect before it becomes expensive to find:
| Practice | What it catches | Where that defect used to surface |
|---|---|---|
| Testers review the specification | Ambiguous, incomplete or contradictory requirements | Acceptance testing, or in production as a "bug" nobody specified |
| Test cases written before the code | Misread requirements, untestable designs | System testing |
| CI, and better still CD, with automated component tests | Regressions in the code just changed | A release candidate weeks later |
| Static analysis before dynamic testing, or as part of an automated process | Certain code defects, faster than running the code | Code review or test runs |
| Non-functional tests from the component level | Performance or security problems in one component | A full system test environment near release |
The syllabus is honest about the cost. Shift left may need extra training, effort or money early, in exchange for savings later, and it only works when stakeholders are convinced.
What is the difference between shift-left and shift-right testing?
Shift left runs checks before a change merges. Shift right runs checks after it ships. Microsoft's Shift right to test in production (last updated November 28, 2022, so an older source) describes tier-based deployments that reach a small share of users first, plus monitoring, failover testing and fault injection. They answer different questions, and mature teams do both.
| Shift left | Shift right | |
|---|---|---|
| When | Before merge, often before code exists | After deployment |
| Question | Is this change correct? | Does the system behave in the real environment, with real traffic? |
| Typical checks | Spec reviews, unit and component tests, static analysis, contract tests | Tier-based rollouts, production monitoring, failover tests, fault injection |
| Cost of a miss | A red build | A user-facing incident |
Microsoft's Azure DevOps guidance frames it as a choice per test type: teams decide where in the pipeline each test runs and use shift-left or shift-right strategies to move it earlier or later.
What does a shift-left test strategy look like?
Microsoft published one in Shift testing left with unit tests, last updated November 28, 2022, so an older source. It classifies tests by their dependencies and run time:
| Level | What the test depends on | Where Microsoft suggests running it |
|---|---|---|
| L0, L1 | Only the code under test (unit tests) | As part of the build |
| L2 | The code plus dependencies such as SQL or the file system | Before commit |
| L3 | A testable service deployment, with stubs for key dependencies | A failing run fails the pull request |
| L4 | Production, with a full product deployment | A failing run can block the deployment |
The guidance gives example budgets for the fast lane: an average under 60 ms per L0 test, under 400 ms per L1 test, and no test at this level over 2 seconds. It also discourages UI tests, because they tend to be unreliable.
The case study shows the timescale. One Microsoft team started with 27,000 legacy functional tests and retired all of them over 42 sprints, about two and a half years (Microsoft Learn). Many old tests were deleted rather than rewritten. Once the team had a fast, reliable CI signal, a pull request took about 30 minutes to merge, including a run of 60,000 unit tests, according to the same case study. DORA's test automation capability sets its own target for the developer loop: developers should get feedback from automated tests in less than ten minutes, both locally and in CI.
Example: a time budget for the fast lane
A shift-left suite often decays the same way: someone adds a test with a hidden network call, the fast lane gets slow, and people stop running it before they push. This check turns Microsoft's L0 budget into a gate. The tests use Node.js's built-in runner; the slow test stands in for a hidden dependency.
// price.test.mjs
import { test } from 'node:test'
import assert from 'node:assert/strict'
const total = (items, couponPct = 0) =>
Math.round(items.reduce((s, i) => s + i.price * i.qty, 0) * (1 - couponPct / 100))
test('[L0] sums price times quantity', () => {
assert.equal(total([{ price: 500, qty: 2 }]), 1000)
})
test('[L0] applies a percentage coupon', () => {
assert.equal(total([{ price: 1000, qty: 1 }], 15), 850)
})
test('[L0] rounds to whole cents', async () => {
await new Promise(r => setTimeout(r, 200)) // stands in for a hidden slow dependency
assert.equal(total([{ price: 333, qty: 1 }], 10), 300)
})
// budget.mjs: fails the build when the fast lane gets slow. Budgets from Microsoft's L0 guideline.
import { readFileSync } from 'node:fs'
const AVG_MS = 60, MAX_MS = 2000
const xml = readFileSync(process.argv[2], 'utf8')
const tests = [...xml.matchAll(/<testcase name="([^"]+)" time="([\d.]+)"/g)]
.map(([, name, sec]) => ({ name, ms: Number(sec) * 1000 }))
.filter(t => t.name.startsWith('[L0]'))
const avg = tests.reduce((s, t) => s + t.ms, 0) / tests.length
for (const t of tests) console.log(`${t.ms.toFixed(1).padStart(7)} ms ${t.name}`)
console.log(`L0 average ${avg.toFixed(1)} ms (budget ${AVG_MS} ms)`)
const tooSlow = tests.filter(t => t.ms > MAX_MS)
if (avg > AVG_MS || tooSlow.length) {
console.error('L0 budget exceeded: move slow tests to a later stage or remove the dependency')
process.exit(1)
}
Run on 2026-11-19 with Node.js 22.9.0:
$ node --test --test-reporter=junit --test-reporter-destination=l0.xml price.test.mjs
$ node budget.mjs l0.xml
0.7 ms [L0] sums price times quantity
0.1 ms [L0] applies a percentage coupon
201.6 ms [L0] rounds to whole cents
L0 average 67.5 ms (budget 60 ms)
L0 budget exceeded: move slow tests to a later stage or remove the dependency
All three tests passed, and the build still failed, which is the point. With a 120 ms delay the average was 41.2 ms and the gate passed, so one slow test can hide under an average: tighten MAX_MS if that matters to you. Your timings will differ by machine.
Why do shift-left efforts fail?
- Testing is handed to developers and testers leave the room. DORA's research favors developers owning the automated suites, but the same page says testers still matter: pair them with developers, and keep them on exploratory and usability testing. Smith's 2001 version needed both roles from the start.
- The fast lane stops being fast. Microsoft notes that suites taking hours drift toward the last moment before release, and teams start tolerating failures. Budgets like the one above catch this early.
- Later testing gets cut. End-to-end and production checks still find what unit tests cannot. Keep a few end-to-end tests on critical journeys.
- The specification never gets tested. Reviewing requirements with a tester's eye needs no tooling at all.
When regressions do slip through, the regression testing entry covers how to pin them with tests. For delivery data on how few teams deploy on demand, see our post on DevOps and TestOps in 2026. Our DevOps and TestOps engineers come to pipelines from test automation (SDCLabs founded Codeception and CodeceptJS): we split large suites across containers, order the stages so the quickest checks report first, and track flaky tests until they are fixed.
Sources
- Shift-Left Testing, Larry Smith, Dr. Dobb's (Wayback Machine snapshot 2024-11-24), 2001-09-01
- Certified Tester Foundation Level Syllabus v4.0.1, section 2.1.5 Shift Left, ISTQB, 2024-09-15
- Shift testing left with unit tests, Microsoft Learn (Azure DevOps), 2022-11-28
- Shift right to test in production, Microsoft Learn (Azure DevOps), 2022-11-28
- Capabilities: Test automation, DORA, 2025-07-17
Frequently asked questions
Why is it called shift left?
Delivery is usually drawn as a timeline from left (requirements) to right (release and operations). Moving testing activities earlier moves them to the left on that drawing.
Does shift-left testing mean developers do all the testing?
No. Developers usually own the fast automated checks, but testers still review specifications, design test cases, explore the product and judge usability. The 2001 article that named the idea moved testers into the development team rather than removing them.
Is shift-left the same as test-driven development?
TDD is one shift-left practice: the unit test is written before the code. Shift left is broader and also covers requirement reviews, static analysis, CI checks and early non-functional testing.
What is shift-left security?
The same idea applied to security: threat modeling during design, dependency and secret scanning on every change, and security tests in CI, instead of a single security review just before release.
How do you measure whether shift-left testing works?
Track where defects are found (review, CI, staging or production), how long CI feedback takes, and your change failure rate. If more defects are caught before merge and fewer reach production, it is working.
Read next
Related terms
Sergey AlmyashevChief Operating Officer14+ years in QA, automated, exploratory and performance testing, and continuous integration and delivery within Scrum, helping teams in product and outsourcing companies organize teams, processes and tools.LinkedIn