AI-assisted code generation has changed the capabilities of organizations to produce code. In this article, Hélder Ferreira discusses the impact on software quality created by this new situation. The main problem is that this new code is often created by tools that lack the knowledge of the global context of both the application infrastructure and the process being automated. Using functional tests as a baseline might help to limit the risks.
Author: Hélder Ferreira, Director of Product Management, Sembi, https://www.sembi.com/
Everyone knows that AI “speeds” up development. Recent research found that developers using AI tools increased their coding activity, measured by commits, by as much as 180%. But producing more code doesn’t necessarily mean better software: AI-generated code often introduces errors that leave developers picking up the pieces.
AI-generated code forces software developers to rework and debug the code that “only took a few seconds” to create. What’s missing and keeping AI from accurately producing and shipping code is a written, testable record of how the product should behave. Much of this context lives in disconnected tools or internal knowledge, leaving AI to guess at a developer’s intent. This is where test artifacts help AI-assisted development. Test context breaks down detailed user flows written in step by step detail. Unlike requirements or other dev artifacts that show a snapshot of how features were once built, tests capture your product’s truest expected behavior and your regression suite aggregates the cumulative and latest expected behavior of your product functionality including the multitude of edge cases, data variations, and environments it needs to support in the real world.
Rather than treating tests as a final validation checkpoint, software development leaders would benefit more from a tests-as-context approach that allows functional tests to provide a behavioral baseline that AI can build against. Adopting a more integrated approach to software quality lets organizations transition from defective AI-generated code to AI that builds software near-autonomously.
The Debugging Loop Nobody Wanted
Today, the AI software development lifecycle (SDLC) enables AI to begin writing code for a new feature automatically, without the context required for existing functionality. This means that while it may introduce a new feature, it often comes at the expense of a regression on an older one. The result is a vicious cycle in which testers have to log bugs, and developers have to stop other tasks to fix and revalidate them.
Consider an e-commerce team that is implementing a promotional feature ahead of Cyber Monday. They use AI to help implement a “buy one, get one 50% off” promotion, but the AI assistant lacks knowledge of the existing business rules for the product. Without that context from the test suite, customers can inadvertently stack discounts, bypass gift card restrictions, and earn unsanctioned loyalty points, amounting to considerable revenue loss. None of these behaviors were part of the requested feature, but the intent to prevent them was buried in existing tests.
While this example focuses on feature development, the same lack of behavioral context creates challenges across testing workflows:
- Code drift: By building strictly from product requirements documents (PRDs), Jira tickets, and design documents, AI lacks the detailed knowledge of requirements that determine how a product should behave. As a result, the code follows the tickets to the letter and deviates from what the tests actually expect.
- Code change haziness: At AI speed, there are extensive changes across the SDLC. While a change can look clean in review, it is impossible to determine exactly what AI tweaked and what might break three features away. This means regression slips make their way into production.
- Suites diverge: As products change faster than tests can update, suites drift. That leads to cases that miss the latest new features or enhancements. Consequently, trust in the test suite declines, exploratory tests increase, and edge cases are missed.
- Manual workflow stitching: AI can’t bridge silos it can’t see. When testing workflows are split across disconnected tools and teams, AI only has visibility into individual steps and can’t stitch together testing workflows. This leaves someone drafting the tests and someone else planning the run. Or one person executing the test and another reviewing the final result. This means more chances for failures at handoffs.
As testing is increasingly affected by AI shortcomings, more defects make their way into production environments. In one report, 15% of commits from AI coding assistants introduced at least one issue, and 22.7% of those issues survived to the latest version of the repository. Fixing these issues requires shifting testing left and giving AI the context it needs from the start.
How to Fix the AI SDLC
To shift testing left and begin fixing the broken AI SDLC, software development leaders can implement a few steps:
- Step one: Organize and label your tests. Software testers should identify which tests would be most relevant to the development process and categorize them using folders, fields, and labels. This allows tests to be more discoverable to act as a context layer efficiently, without overloading them beyond the tool’s capacity.
- Step two: Feed relevant tests to AI. By surfacing relevant tests to both the developer and the AI model, these parties can build toward the behavior defined by those tests as they write the code. Tests can add value even before development starts. Product managers can use existing tests to enrich epics and user stories with edge cases, expected behaviors, and more precise product intent.
- Step three: Use AI to identify and mitigate test gaps. To avoid tests drifting out of date, apply modern test management practices like test gap analysis. This practice requires sustained investment in test quality and uses AI to spot differences between your existing tests and other artifacts like requirements and code changes. Then, use AI to generate new tests or update existing ones.
- Step four: Connect run results to testing suites. Development teams should connect execution results back to the relevant test case and suite, as well as the product version or commit under test. This allows them to work from the most up-to-date version of product activity, while ensuring that AI understands, for subsequent tests, whether a failed execution was due to a product defect or an environment issue.
- Step five: Let AI and human-in-the-loop practices connect processes. With connected and traceable testing processes, AI can integrate fragmented testing workflows that span from assessing test impact to reviewing results. Humans can then step in to analyze AI test case drafts, expected results, and any edge cases, while letting AI run the rest of the process.
Taken together, these steps help organizations move testing from an end checkpoint to a behavioral context layer that guides AI-assisted development. This framework helps enterprises move away from static specifications to a living, evidence-based record of how the system actually behaves under real execution conditions. This makes execution evidence a source for assessing the actual impact of AI across software, and ultimately leads to fewer escaped defects and less time spent on rework.
A Better Way to Build with AI
Across the industry, the typical solution to AI coding defects is to generate new tests from natural language and run regression tests on AI code after the fact. The tests-as-context approach allows software developers to prevent AI code from breaking in the first place.
When organizations make this shift, they create a shared framework to maintain confidence, visibility, and control as AI accelerates in software development.
About the Author
Hélder Ferreira is Director of Product Management at Sembi. As a Product Director with a background in Mathematics & Computer Science, Hélder brings over a decade of experience building impactful software products in the internet and enterprise space.


Leave a Reply