Latest / Software Testing with Fexingo: QA, Automation, and Reliable Software Engineering / Why Shift-Left Testing Saves Your Sprint
Transcript
- Lucas: So we talk a lot on this show about tests that catch bugs after code is written — unit tests, integration tests, end to end. But there's a whole philosophy that says you should catch defects before there's even code to test. It's called shift-left testing. Luna: I've heard the term, but it always felt a bit abstract. Like, what does it actually mean to 'move left' on a timeline? Lucas: Think of a typical software delivery lifecycle as a horizontal line: requirements on the far left, then design, development, testing, staging, production on the far right. Traditional testing happens after development — on the right. Shift-left means you push testing activities to the left, earlier in the process. Luna: So instead of waiting until the feature is built to see if it works, you're checking for problems during design and code review. Lucas: Exactly. And there's a concrete example I want to dig into. A mid-sized e-commerce company — I'll call them ShopGrid — had a team of about 40 engineers. They were shipping weekly, but they were spending nearly 30 percent of every sprint fixing bugs found in staging or production. That's a huge tax. Luna: Right, that's basically a day and a half per week just reworking stuff. Lucas: They decided to try a shift-left experiment. They adopted three specific practices. First, they introduced lightweight threat modeling during sprint planning. For every user story, the team spent five minutes asking: what could go wrong here from a security or logic perspective? Luna: Five minutes per story — sounds manageable. Lucas: Right, it's not a formal security audit. It's just a structured conversation. Second, they enabled automated static analysis on every commit. So before code even made it to a pull request, tools like SonarQube were flagging potential bugs, code smells, and security vulnerabilities. Luna: And the third practice? Lucas: They started requiring testable acceptance criteria written by product managers — not just 'user can log in,' but something like 'given valid credentials, user sees dashboard within two seconds.' That forced clarity upfront. Luna: That alone probably caught a ton of ambiguous requirements before any code was written. Lucas: It did. After three months, they measured the impact. Their bug-fix cycle time — from bug report to deployed fix — dropped by 40 percent. And the number of critical bugs found in production dropped by more than half. Luna: That's a pretty compelling result. But I wonder — does shift-left work for teams with legacy codebases? Because if you're maintaining a ten-year-old monolith, you can't exactly go back and write acceptance criteria for every feature. Lucas: You're right to push on that. The same company had a legacy inventory module that predated their agile transformation. They couldn't shift-left on that overnight. So they used what I'd call a hybrid approach: they applied shift-left only to new features and major refactors, and for the legacy module they used a safety net of regression tests on the right. Over time, as they touched the legacy code, they added lightweight threat models and static analysis. Luna: So it's not all-or-nothing. You ramp up shift-left incrementally. Lucas: Exactly. And that's actually a smarter way to do it. Trying to shift everything left at once would probably break your delivery cadence. Luna: I also want to push back on one thing: the idea that shift-left replaces testing on the right. I've seen teams misinterpret it as 'we don't need end to end tests anymore.' Lucas: That's a dangerous take. Shift-left reduces the volume of bugs that reach the right side, but it doesn't eliminate the need for integration or end to end tests. You still want to validate that the system works as a whole. The goal is to catch the cheap bugs early and reserve the expensive end to end tests for the complex scenarios that can only be caught at that level. Luna: So it's about shifting the balance, not removing right-side testing entirely. Lucas: Right. And there's data to back that up. A study from the National Institute of Standards and Technology found that fixing a bug during design costs about one-sixth of what it costs to fix the same bug during production. So shift-left is as much an economic argument as a quality argument. Luna: That number alone makes a strong case for spending that five minutes in sprint planning. Lucas: If today's tech conversation gave you something usable, something that might save you or your team a headache down the road, consider supporting the show. It keeps us ad-free and focused on stuff like this. You can do that at buy me a coffee dot com slash fexingo. Luna: Yeah, even a small contribution makes a difference. We really appreciate it. Lucas: Alright, back to shift-left. One more thing I want to highlight: the role of culture. Shift-left doesn't work if the team treats it as a qa only initiative. Developers, product managers, and even designers need to buy in. Luna: Because if developers see threat modeling as something QA does, they'll check out during sprint planning. Lucas: Exactly. ShopGrid made shift-left a team goal, not a QA mandate. They tracked a simple metric: percentage of stories that had a threat model and testable acceptance criteria before development started. That made it visible and accountable. Luna: What about the tooling side? Did they use any particular static analysis tool? Lucas: They used SonarQube for static analysis, and they integrated it into CI so every commit triggered a scan. They also used a lightweight threat modeling tool called OWASP Threat Dragon, which is free and open source. The key was making the feedback fast — developers got results within minutes, not hours. Luna: Fast feedback is crucial. If the static analysis takes twenty minutes, developers will start ignoring it or working around it. Lucas: Right, and that's a lesson I've seen teams learn the hard way. If your shift-left tools slow down the pipeline, you'll get resistance. The tools need to be fast and the results need to be actionable — ideally with suggested fixes. Luna: So what's the one thing a team should do this week to start shifting left? Lucas: Start with acceptance criteria. Pick one user story in your next sprint and ask the product owner to write the criteria in a given when then format. Then during the sprint review, check if that clarity reduced rework. If it works, expand from there. Luna: That's a low-risk experiment. One story is easy to try. Lucas: And it costs almost nothing. No new tools, no process overhaul. Just a shift in how you define done before you start coding.