ArticleslgStudy

computer science

Shift-left testing

Shift-left testing is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Shift-left testing rather than just read about it. In short: Shift-left testing is an approach to software testing and system testing in which testing is performed earlier in the lifecycle (i.e. moved left on the project timeline). It is the first half of the maxim "test early and often".

Shift-left testing — main illustration
Shift-left testing — illustration

Key takeaways

  • Shift-left testing belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Shift-left testing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Shift-left testing from memory before moving on to harder problems.

Reference excerpt

Shift-left testing is an approach to software testing and system testing in which testing is performed earlier in the lifecycle (i.e. moved left on the project timeline). It is the first half of the maxim "test early and often". It was coined by Larry Smith in 2001.

Harm because of late testing Shift-left testing aims to prevent the following types of harm caused by late testing:

Insufficient resources allocated to testing. Undiscovered defects in requirements, architecture, and design, along with significant effort wasted while implementing them. Difficulty debugging (including identifying, localizing, fixing, and regression testing defects) as more software is produced and integrated. Reduced code coverage during testing as a result of encapsulation impeding white-box testing. A “bow wave” of technical debt that can cause a project to fail.

Types of shift-left testing There are four basic ways to shift testing earlier in the life-cycle (that is, leftward on the classic V-model). These can be referred to as traditional shift-left testing, incremental shift-left testing, Agile/DevOps shift-left testing, and model-based shift-left testing.

Traditional shift-left testing As illustrated in the following figure, traditional shift-left moves the emphasis of testing lower down (and therefore slightly to the left) on the right hand side of the classic V model. Instead of emphasizing acceptance and system level testing (e.g., GUI testing with record and playback tools), traditional shift-left concentrates on unit testing and integration testing (e.g., using API testing and modern test tools).

Incremental shift-left testing As illustrated in the following figure, many projects developing large and complex software-reliant systems decompose development into a small number of increments (Vs) having correspondingly shorter durations. The shift-left illustrated by the dashed red arrows occurs because parts of the single, large waterfall V model’s types of testing (shown in gray) are shifted left to become increments of the corresponding types of testing in the smaller incremental V models. When each increment is also a delivery to the customer and operations, then incremental shift-left testing shifts both developmental testing and operational testing to the left. Incremental shift-left testing is popular when developing large, complex systems, especially those incorporating significant amounts of hardware.

Agile/DevOps shift-left testing As illustrated in the following figure, Agile and DevOps projects have numerous short duration Vs (sprints) in lieu of a single or small number of V as in the previous two examples of shift-left testing. These small Vs would also be modified if one or more early sprints are used to block out the basic requirements and architecture or if test-first and test-driven development (TDD) are being performed. The shift-left occurs because the types of testing on the right sides of the earliest of these tiny Vs are to the left of the corresponding types of testing on right side of the larger V(s) they replace. While the following figure appears remarkably the same for Agile and DevOps, Agile testing is typically restricted to developmental testing and does not include operational testing, which occurs once the system is placed into operation.

Model-based shift-left testing The previous forms all concentrated on testing earlier in the development cycle. However, they all test after software exists and seek to uncover only implementation defects. Model-based testing moves testing to the left side of the Vs, by testing requirements, architecture, and design models. This shift begins testing almost immediately, instead of waiting a long time (traditional testing), medium time (incremental testing), or short time (Agile/DevOps) for software to become available to the right side of the Vs.

References

External links "Shift Left" Devopedia What is Shift Left Testing

Illustrations

Shift-left testing illustration
Shift-left testing illustration
Shift-left testing illustration

Worked examples

Example 1 — a first encounter with Shift-left testing

Start with the simplest possible case. Write down what Shift-left testing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Shift-left testing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Shift-left testing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Shift-left testing

In research
Shift-left testing appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Shift-left testing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Shift-left testing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Software testing, so understanding it makes those chapters shorter.
In everyday life
Look for Shift-left testing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Shift-left testing” →

How to study Shift-left testing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Shift-left testing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Shift-left testing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Shift-left testing in simple terms?

Shift-left testing is an approach to software testing and system testing in which testing is performed earlier in the lifecycle (i.e. moved left on the project timeline). It is the first half of the maxim "test early and often".

Why does Shift-left testing matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Shift-left testing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Shift-left testing.

Tags

  • Software testing

Keep exploring