Delivering Integration Scenarios
Scenarios as executable specifications
Here is the part that is new. In the AI SDLC, agents generate code, tests and infrastructure from a statement of intent, and the right-hand side of the H verifies what they produce. The question every organisation adopting this now faces is: what is the unit of intent, and what is the unit of verification? Prompts written per task are too small; they lose the value thread and produce locally correct, globally incoherent systems. Strategic goals are too big. The answer is the artefact we already have.
A scenario with acceptance criteria is an executable specification. It is the unit of an outcome-based prompt and the unit of verification, and it was already the unit of release scope.
Three things make scenarios the right size:
- They end in value, so the agent is pointed at an outcome, not an output. “Make the reorder button work” produces a button. “A returning customer re-buys a past order in under a minute” produces a thread that works.
- They carry their criteria, functional and non-functional, as tests. So verification is not an afterthought designed after the code exists; it is the same text, read the other way.
- They thread several products. An agent working from a scenario has to make the products work together, which is where generated code most often fails and where verification most often has to happen.
The outcome-based prompting page describes the prompt shape in full: intent, constraints, context. The scenario supplies the intent and most of the constraints. The team supplies the context: the codebase, the mechanisms, the decision records, the things the business knows that the code does not.
A worked example
Scenario: Reorder from history. A returning customer opens their order history, picks a past order, and re-buys it. Lines that are out of stock are flagged rather than silently dropped. Their saved payment method is used without re-entering card details. They get a confirmation and can track the delivery. Products involved: web shop, payments service, warehouse system, notifications. Stories: S12 View order history, S35 Repeat an order, S6 Apply saved payment method, S24 Confirm and track delivery.
Acceptance criteria (the flipside):
- A past order becomes a basket in one action, with its original quantities.
- Out-of-stock lines are shown as unavailable in the basket and the customer can proceed without them; nothing is removed silently.
- The saved payment method is used; no card details are typed. Payment failure returns the customer to the basket with the reason.
- End to end, from opening history to confirmation, the 95th percentile is under 60 seconds at 200 concurrent users.
- The whole path can be completed with keyboard only and passes WCAG 2.2 AA on each screen.
- No personal data from the thread appears in application logs.
The prompt it yields. Intent: the scenario text, verbatim, and the value statement. Constraints: the six criteria, verbatim, with the instruction that each must be covered by an automated check that the agent writes and that fails before the change and passes after it; the architectural constraints (the payments mechanism to use, the warehouse interface version, the existing notification contract); the Definition of Done for “product tested”. Context: the four repositories, the relevant decision records, the existing tests for S12, and the data model for orders. Scope: the four stories, in whatever order makes the thread work, and nothing else.
The checks that prove it. Criteria 1 to 3 become end-to-end scenario tests across the four products, run in the integration environment on every change. Criterion 4 becomes a load test in the pipeline against the end-to-end path, a fitness function. Criterion 5 becomes an automated accessibility scan on each screen plus a scripted keyboard walkthrough. Criterion 6 becomes a log-scanning check that runs in the integration environment after the scenario test. The scenario is done at “integration tested” when all six pass in the integrated environment, and “business accepted” when the Product Customer has walked the thread.
Notice what the people did. They wrote the scenario and the criteria, with a customer. They chose the constraints. They will accept the result. The agent wrote the code, the tests and the pipeline changes. When a check fails, the fix is to the scenario (the criterion was wrong) or to the code (the generation was wrong), never to the check.
What this changes in practice
- Write the flipside first. The criteria used to be the part teams skipped. They are now the part that does the most work, because they are both the prompt’s constraints and the verification. A scenario without criteria is not ready to be built, by anyone.
- Criteria must be checkable by a machine or by a named person. “Easy to use” is a wish. “Keyboard-only path completes in under two minutes for a first-time user in a moderated test” is a criterion with a person attached.
- Generate stories from scenarios, not the other way around. An agent can draft the stories a scenario implies, per product, for the teams to correct. That is a better use of an agent than drafting stories from nothing.
- Keep scenarios short. Agents do better with a crisp thread and a precise set of criteria than with a long document. So do people.
- One scenario per agent run is a sensible default. It is the size at which the result can be verified end to end and accepted by a person. Smaller runs lose the thread; larger ones cannot be checked.
- The scenario remains the unit of release scope and acceptance. Nothing about the AI SDLC changes that. It just means the same artefact now also drives the build.
Related
- What an Integration Scenario looks like: the card and its flipside of criteria
- Outcome-based prompting: the prompt shape the scenario supplies
- Verification is the bottleneck: the other side of the executable specification