Shift left for automatic testing
Picture the stages of building software as a line from left to right: plan, code, build, test, release, operate. Shifting left means moving testing toward the left of that line — starting it earlier, and doing more of it while the code is still fresh.
Plan → Code → Build → Test → Release → Operate
←←← shift left: start testing here, earlier
Why shift left
A bug found while the code is being written takes minutes to fix. The same bug found after release can take days and may reach users. Testing earlier gives faster feedback, cheaper fixes, and more confidence to change things.
Ways to shift left
- Test while coding — write unit tests alongside the code, so each small piece is checked as it is written.
- Test on every change — run the automatic test suite in continuous integration, so a broken change is caught before it merges.
- Agree examples first — describe the expected behavior in plain examples (Given, When, Then) before anyone writes code or automation.
- Review early — read requirements and designs, review code, and run static analysis before the first test even runs.
Shift right too
Shifting left does not replace later testing. Real users and real systems still surprise you, which is why teams also watch and test in production — see devops for automatic testing — and keep a few realistic browser tests at the top of the automatic testing pyramid.