How testing works in AI-DLC
In AI-DLC the agent writes the tests as well as the code. This guide follows testing through the AWS workflows stage by stage: who sets the level, where the tests run, and what each verdict means.
The short answer: the AI writes the tests, and a person decides how much testing
AI-DLC, the AI-Driven Development Life Cycle, is AWS's method for building software with an AI agent in the lead and a person approving each stage. In the open-source workflows that run the method, testing is not one stage. It happens at six points, from a choice about how much to test through to load tests on the deployed application.
Three things are worth knowing before the detail.
- The agent writes the tests. Test files are required steps in each unit's code plan, and a later stage verifies and extends them.
- A person sets the level and decides on failures. The scope of the work sets a default, and a person can change it. When a failure cannot be fixed inside the stage, the workflow stops and asks.
- Tests run in the workspace first. A check that needs a deployed environment is marked Unverified and waits for a later stage, where the plan has one.
If AI-DLC is new to you, read What is AI-DLC? first. The terms used here are defined in the AI-DLC glossary.
The six points where testing happens
Decide how much to test
The scope picks a test strategy. A person can change it.
Any gateAgree how to test
Each unit's plan records the method, the volume and a floor. This is the Testing Contract.
Stage 3.5Write tests with the code
Test files are required steps in the plan. The agent writes them.
Stage 3.5Build and test it all
The Build and Test stage runs once, after every unit. It ends in a verdict for every target.
Stage 3.6Run the pipeline checks
Pipeline quality gates, then an automated check that code and tests line up.
Stage 3.7Test the live system
Smoke tests, health checks and load tests on the deployed application.
Stages 4.3, 4.6
Stage numbers are from the AI-DLC workflows stage reference, checked 4 December 2026. The dashed step runs only when the scope includes the Operation phase.
1. The test strategy sets how much testing is done
The workflows keep two settings apart. Depth sets how detailed each stage's documents are. Test strategy sets how many tests are generated and of which types. You can ask for short documents and thorough testing, or the reverse.
The three test strategy levels
| Level | How many tests | Which types | Scopes that default to it |
|---|---|---|---|
| Minimal | About one test for each requirement, plus one happy-path test for each component. Roughly 5 to 15 in total. | The guide calls this the Nyquist model. The Construction reference adds that a bug or security regression may bring one integration or end-to-end test. | express, workshop |
| Standard | 5 to 8 for each component. | Unit and integration. End-to-end, performance and security tests only where the non-functional requirements call for them. | classic |
| Comprehensive | 10 to 15 for each component. | All types. | enterprise |
A person can change the level with the --test-strategy option, part-way through the workflow, or at an approval gate.
The levels are set as a number of tests. That makes them easy to choose and easy to check. It is a different measure from whether the tests cover the business rules that matter most, which is still a judgment for the person approving.
2. The Testing Contract records how each unit will be tested, before any code
Code Generation runs once for each unit. Its plan carries a Testing Contract, a block that records how that unit will be tested.
- The method. One of five profiles: TDD, BDD, ATDD, test-after, or a custom mix.
- The volume. Taken from the test strategy.
- A floor. A coverage or CI floor, targeted regression, or none.
Test files are required steps in the plan. On a new project the plan sets up a working test command before the first test step. On existing code it checks the existing command first.
Three controls sit around the plan.
- The verification command. The command that proves a unit works has to be authorized by a person. Only a reply of Approve authorizes it.
- The proof. The record of each check keeps the command's exit status, the size and SHA-256 digest of its output, and the last part of the output.
- The Guard Policy. Under
strict, editing the plan or the Testing Contract after approval sends it back for approval again. Underrelaxedoroff, work continues with the new content and the original evidence is kept. The enterprise scope defaults to strict.
One rule runs through the whole phase. A target, including its threshold setting, is never lowered to make a step pass.
3. Build and Test runs the tests once every unit is coded
This stage runs once, after every unit has been coded, across the whole solution. The quality agent leads it and the DevSecOps agent supports. In order, the stage:
- Reads the testing requirements and lists every measurable target.
- Writes the build instructions.
- Writes test instructions for the types the strategy calls for.
- Writes a build and test summary.
- Runs the builds and the tests.
- Runs a final coverage check across all the units.
- Prepares completion and presents the approval gate.
The reference says the stage verifies and extends tests. It does not create them from scratch, because test files must already be in the code plan. The commands run through the shell against the code in the workspace.
Unit tests come from each unit's own instructions. This stage adds integration tests at Standard and above, and performance and security tests at Comprehensive where matching non-functional requirements exist. Contract, end-to-end and accessibility tests are added when the project calls for them.
The final coverage check confirms that every functional requirement, non-functional requirement and acceptance criterion has a traceability entry pointing to a file that exists. IDs with no entry are shown as findings at the approval gate.
The stage writes build-instructions.md, build-and-test-summary.md, test-results.md and cross-unit-traceability.md, plus an instruction file for each test type in play.
4. Every target gets a verdict: Met, Not Met or Unverified
Every measurable target goes into one table, the Target Verification Matrix, and each gets a verdict.
What each verdict means
| Verdict | What it means | What it does to the stage |
|---|---|---|
| Pending | Where every applicable target starts. | None may be left when the stage finishes. |
| Met | The actual result reaches the expected one, with evidence. | Success needs this on every applicable target, and every command passing. |
| Not Met | The result falls short of the target. | Starts the failure steps below. |
| Unverified | The check needs a deployed or production-like environment, so the workspace cannot run it. | Assigned to a named later stage where the plan has one. It stays Unverified and cannot make this stage succeed. |
| N/A | No measurable target applies, or the plan makes the target inapplicable. | Allowed only in those two cases. |
Two rules govern the matrix. A threshold is never relaxed, lowered or switched off to get a pass, and the gap is reported instead. And the stage succeeds only when every command passes and every applicable target is Met.
5. When a test fails, the workflow tries a fix and then asks a person
A failed command, or an applicable target that is Not Met or Unverified, starts four steps in order.
- Fix in place. Up to two attempts, limited to test configuration, build scripts, environment setup and the checks themselves.
- Classify. The agent works out whether the cause is in the generated code or tests, or in an earlier choice of approach. It estimates the effort, cost and risk of a fix.
- Loop back unattended. Only when Construction is set to run autonomously, a fix has been estimated, and fewer than three loop-backs are already logged.
- Stop and ask. The person is offered three choices: retry with the fix, shown with its estimated impact, accept the failure, or abort. With no fix available, the choices are accept or abort.
A repaired plan needs a fresh approval. Choosing to retry does not approve it.
Accepting a failure is one of the choices on offer. Decide in advance who on your team is allowed to make it, and for which kinds of target.
6. Automated checks close out the build phase
The CI Pipeline stage is conditional. It runs when a pipeline has to be created or changed significantly, and it writes ci-config.md and quality-gates.md.
Construction then ends with an automated phase check. It confirms that architecture, code and tests line up, that all code traces to the design, and that test coverage addresses the acceptance criteria.
7. After deployment, the running application can be tested
Two Operation stages test the running application.
- Deployment Execution. Runs smoke tests and health checks once the release has gone through the pipeline, and writes
smoke-test-results.mdandhealth-check-report.md. - Performance Validation and Load Testing. The quality agent designs and runs load tests against the deployed application and compares the results with the non-functional targets set in Construction, in
nfr-validation-matrix.md. The reference says this stage is skipped for proofs of concept and for applications where performance is not critical.
Every stage in the Operation phase is conditional, and the mvp, poc and classic scopes skip the phase. The scopes guide describes classic as the implicit default. In a run without Operation, a target marked Unverified in Build and Test has no later stage to check it, and it stays Unverified.
Teams can add more testing with a plugin
The workflows can be extended with plugins, which add stages, scopes, agents and rules without editing the core. AWS's chapter on writing a plugin uses a testing plugin called test-pro as its worked example, at version 0.1.0.
Its description covers unit and branch coverage, functional, integration, regression and edge-case tests, and positive and negative API tests. It adds an integration stage in Construction, a full-suite stage in Operation for the enterprise scope, a validation scope, and a metrics agent that supports the quality agent.
The chapter presents test-pro as a pattern to copy. It does not say the plugin ships with the core install.
Three questions stay with the people approving
The workflows are specific about how tests are counted, run and recorded. Three questions stay with the people approving.
1. What are the tests based on?
The code and its tests come out of the same plan, written by the same workflow, and Build and Test extends the tests that Code Generation wrote. A test written from the code confirms what the code does. A test written from the requirement confirms what was asked for. A traceability entry shows that a test file exists for a requirement. Ask which kind of test it points to.
2. What happens to everything marked Unverified?
Checks that need the deployed application wait for the Operation phase, and several scopes do not run it. Before you approve Build and Test, list the Unverified targets and name who will check each one, and where.
3. Who can read the evidence?
The outputs are Markdown files in the repository, written for the team doing the work. If a business owner, an auditor or a control function has to accept the release, ask what they will be shown.
The approval gate checklist has the questions to ask at the Build and Test gate.
Where Spec2TestAI fits: tests from the requirement, run on the live application
Spec2TestAI is our product. It is independent of AWS and of AI-DLC, and it is not an AI-DLC integration. It works on the same three questions from outside the coding workflow.
- Tests from the requirement. Test Creation & Data generates tests and synthetic test data from the requirement.
- Against the live application. Spec2RunAI runs those tests in plain English against the live application.
- Evidence for the people who sign. Every run ends in a Run Evidence Report, written for the people who did not watch the run.
How these sit across the whole lifecycle is on Quality for the AI SDLC.
Common questions
Does AI-DLC write the tests?
Yes. In the AI-DLC workflows, test files are required steps in each unit's code generation plan, and the agent writes them during Code Generation. The Build and Test stage then verifies and extends those tests. It does not create them from scratch.
Does AI-DLC support TDD?
The Testing Contract in each unit's plan names one of five profiles: TDD, BDD, ATDD, test-after, or a custom mix.
How many tests does AI-DLC generate?
It depends on the test strategy. Minimal is roughly 5 to 15 tests in total. Standard is 5 to 8 for each component, and Comprehensive is 10 to 15 for each component. The scope sets a default and a person can change it.
What is the Target Verification Matrix?
A table written in the Build and Test stage. It lists every measurable target with its expected result, actual result, evidence and a verdict: Met, Not Met or Unverified. Targets start as Pending, and none may be left Pending when the stage finishes.
What does Unverified mean in AI-DLC?
Unverified marks a check that needs a deployed or production-like environment, which the workspace cannot provide. It is assigned to a later stage where the plan has one. It cannot make the Build and Test stage succeed.
Does AI-DLC test the deployed application?
It can. In the Operation phase, Deployment Execution runs smoke tests and health checks, and Performance Validation runs load tests against the deployed application. Every Operation stage is conditional, and the mvp, poc and classic scopes skip the phase.
What this guide does not tell you
This page reports what AWS's documentation says the workflows do. It is not a test report on the workflows, and we give no view here on how well the generated tests perform.
The documentation is not fully consistent with itself. The scopes guide and the Construction reference describe the Standard level's test types slightly differently, and we have followed each page where we cite it.
The workflows change quickly. This page describes the 2.11 series as we checked it on 4 December 2026.
Sources
- AWS Labs, AI-DLC workflows stage reference, “Construction”, checked 4 December 2026. The Testing Contract and its profiles; the verification command and proofs; the Guard Policy; Build and Test, its steps and outputs; the Target Verification Matrix; the failure steps; the CI Pipeline stage and the Construction phase check.
- AWS Labs, AI-DLC workflows guide, “Scopes and Depth”, checked 4 December 2026. Depth; the three test strategy levels and their defaults; changing the level; classic as the default scope.
- AWS Labs, AI-DLC workflows stage reference, “Operation”, checked 4 December 2026. Smoke tests and health checks; load testing against the deployed application; conditional stages and the scopes that skip the phase.
- AWS Labs, AI-DLC workflows, “Authoring a plugin”, checked 4 December 2026. What a plugin can add; the test-pro example.
- AWS Labs, AI-DLC workflows guide, “Phases and Stages”, checked 4 December 2026. Approval gates and the verification gates between phases.
More on AI-DLC
- What is AI-DLC?. The method, its phases and gates, and what they leave to the approver.
- What is the AI SDLC?. AI in every phase of the software life cycle: the names sorted, and what a person still decides.
- AI SDLC vs AI-DLC. One is a general term and the other is AWS's named method. The two side by side.
- Defect prevention in AI-DLC. Where an unclear requirement costs time in the workflows, and how to stop it at the first gate.
- Defect prevention for AI-DLC: seven things to require. Seven criteria to hold any tool to, and what each kind of tool says it checks.
- AI-DLC glossary. The method's terms in plain English, each defined from AWS's own pages.
- AI-DLC vs spec-driven development vs Agile. What each one is, who checks the requirement in each, and how they fit together.
- The AI-DLC approval gate checklist. Thirty questions to ask before you approve, grouped by phase.
- AI-DLC readiness check. Ten questions, scored in your browser, on whether your approvers have what they need.
- AI SDLC ROI calculator. What avoidable rework costs in one backlog, and what prevention returns, on your own numbers.
- AI-DLC tools and services compared (2026). Who sells what around the method, from each vendor's own page.
- Quality for the AI SDLC. Where quality sits across an AI-driven lifecycle.
Get your backlog scored
Send one backlog. We score it on 32 measures, find the conflicts across the stories, and list the questions nobody has answered yet. Fixed fee.
See the Quality Risk Audit