Docs
Sign in
Browse the docs

The SDLC pipeline

STS: test plan

Test cases mapped to requirements and the ISO/IEC/IEEE 29119-3 test plan around them.

14 min read8 sections

The STS step writes the test plan. The agent authors test cases for every requirement, each linked to the requirements it verifies and the design components that implement them. The bridge validates the links and computes coverage, and the agent then writes the test-plan narrative around the result, following ISO/IEC/IEEE 29119-3 (the successor of IEEE 829). The test cases flow on into the Tasks tickets, the Traceability matrix and the Compliance check, and approving the STS unlocks the Delivery Plan.

What you get

A Markdown document titled Software Test Specification:

OrderSectionWritten by
1Title block: project, client, version, dateBridge
21. Introduction: purpose, test scope, conformance, definitions, referencesAgent
32. Test Items: what is and is not tested, citing requirement and component idsAgent
43. Test Approach: test levels, risk-based approach, regression and smoke tests, automation with a process flowchart, non-functional testing, migration and rollback checksAgent
54. Entry and Exit Criteria, suspension and resumption criteria, sign-offAgent
65. Test Environment: hardware, software, network, test data, set-up, parity with production, third-party sandboxesAgent
76. Coverage: coverage by level and by type, a pie chart of test cases by type, and the uncovered requirements with a plan for eachAgent
87. Schedule and Resources: a test-phase Gantt chart and a role tableAgent
98. Defect Management: reporting, severity classification, lifecycle, metricsAgent
109. Risks: three to six test risks grounded in your inputAgent
1110. DeliverablesAgent
12Test Case Catalogue: every test case with its id, description, type, level, priority, requirements and expected resultBridge
13Version HistoryBridge

The bridge requires the headings Introduction, Test Approach, Test Environment, Entry, Exit and Coverage. It sets no minimum number of diagrams: the skill asks for a flowchart, a pie chart and a Gantt chart, but the bridge only flags a diagram that does not start with a diagram type. The catalogue is written from the validated test cases, so every test case id is in the document by construction. The catalogue shows the case's level (when the agent gave one) but not its component links; those are in the data.

Before you run it

  • The API Contract must be approved. Until it is, /sts is locked with "Approve API Contract to unlock this". If the API Contract has not been written at all, the lock reads "Run API Contract first". The slash menu words the same locks as "Approve the API Contract first" and "Run /api first". A project whose STS was written before the API Contract step existed counts its API Contract as approved.
  • The project state must hold the SDS, a non-empty requirement list and a non-empty list of design components. Otherwise the run stops at once with a message ending "run /sds first" or "run /srs first".
  • Settle the requirements and design first. The agent writes one case per requirement, so a requirement that is missing or vague in the SRS becomes a missing or vague test.
  • Put what you know about the test environment in a note when you start the run: sandbox accounts, tools you must use, release dates you cannot move. The agent writes a date only when the input gives one, and otherwise says so.

How it works

Two skills run in sequence: sdlc-test-author for the test cases, then sdlc-sts-narrative-writer for the document. Each has its own correction loop of one attempt by default (ALARA_CORRECTION_MAX_ATTEMPTS, 1 to 5), so a failed check keeps the draft and you decide whether to fix it. Both also receive the approved SRS, SDS and API Contract as source documents, exactly as people reviewed and edited them. Where those differ from the structured data, the skills follow the documents.

Sequence
  1. loop: One attempt by default
  2. Bridge to Project agent: sdlc-test-author with requirements, components and source documents
  3. Project agent to Bridge: testCases[]
  4. Bridge to Bridge: Validate cases and cross-references
  5. Bridge to Bridge: Compute requirement coverage
  6. loop: One attempt by default
  7. Bridge to Project agent: sdlc-sts-narrative-writer with cases and coverage
  8. Project agent to Bridge: markdown
  9. Bridge to Bridge: Check headings and diagrams
  10. Bridge to Bridge: Save test cases and links to state
  11. Bridge to Bridge: Add catalogue, write sts-vN.md

1. Test cases

The test author receives every requirement (with priority, acceptance criteria and its links so far), every design component, the project and client names, your notes, and the source documents. It returns testCases[]. The skill's rules:

  • Every requirement gets at least one test case, and each Given/When/Then acceptance criterion becomes at least one case.
  • Each case has one test type (unit, integration, system, uat, performance or security), chosen as the lowest level that fully validates the requirement. Performance and scalability requirements get performance tests; security and compliance requirements get security tests.
  • Priority follows the requirement: a "must" requirement's cases are critical or high, "should" high or medium, "could" medium or low.
  • A "must" requirement that validates input, enforces a rule, controls access or calls an external system gets a negative case as well as a positive one.
  • Steps are ordered, concrete actions. The expected result is a binary pass or fail drawn from the acceptance criteria, and states the resulting state.
  • Every case starts as "not-run", with no actual result, date or tester.

How the API Contract is used. The skill tells the author to write integration and API cases against the contract: name the operation (method, path and operationId) a case calls in its steps, use the contract's status codes and error codes in the expected results, and never test an endpoint the contract does not define. The author receives the contract as an approved source document. The bridge strips its own sections from source documents, so the author sees the six sections the agent wrote (the Endpoints table, the Error Model and the rest) and not the full OpenAPI JSON block. When no API Contract is in the input, which happens only for a project that predates the step, the skill derives interfaces from the design components.

The validator rejects a case when any of these is wrong: the TC-NNN id format, a missing required field (testCaseId, linkedRequirements, testType, description, steps, expectedResult, status), an unknown key, a value outside an allowed list, testData that is not a string, or a link to a requirement or component that does not exist. The loop sends the author its own reply back with each problem located, up to three attempts. An empty list is corrected the same way.

2. Coverage

The bridge then computes coverage without the agent: total and covered requirements, the ids of uncovered ones, the coverage percentage, how many requirements have 0, 1, 2 or 3+ tests, and coverage by requirement type. A requirement counts as covered when at least one case links to it. The narrative writer receives these figures as they are, so the Coverage section can report the real numbers and name the real gaps.

The bridge does not reject a plan with uncovered requirements. It reports them. The skill asks the author to cover every requirement, but only you and the coverage figures will notice if it did not.

3. The narrative

The narrative writer receives the requirements, components, test cases and coverage summary, and returns the document as Markdown. It uses only the test levels present in the cases, never invents named people for the schedule, and says plainly where the input is silent.

This loop retries on every problem it finds: an unreadable reply, an empty document, a missing required heading, a diagram that does not start with a diagram type, an unclosed code fence, or a document that is too large. It keeps the best reply so far. Only an empty document stops the run. If a document problem is left after the last attempt, the draft is saved anyway and the problem is listed for you as an unresolved check.

The bridge does not check the narrative's numbers against the coverage figures, or its TC- and REQ- ids against the plan.

The project state is written only after the narrative is accepted, so a run that fails at the narrative leaves the state as it was. On success each test case is linked both ways: the case lists its requirements and components, and each requirement lists its test cases.

The run panel shows: Checking project state, Authoring test cases, Validating test cases, Computing requirement coverage, Writing the narrative, Persisting to project state, Writing the Markdown document. The completion message reads "STS vN generated with X test cases covering Y/Z requirements (P%)", then the number of unresolved checks if the narrative kept any, then "ready for review".

Ids this step owns

IdMeaning
TC-NNNA test case. Zero-padded, one sequence for the whole plan starting at TC-001, at most TC-999. Ids are permanent once assigned, never reused or renumbered.

Each test case links to one or more requirement ids (REQ-FUNC-NNN, REQ-NFUNC-NNN or REQ-CON-NNN) and, where relevant, design component ids (DC-NNN). When you open a new version of the project, the author revises the existing cases and keeps their ids; anything new takes the next number.

An illustrative case, as the author returns it (optional fields left out):

{
  "testCaseId": "TC-031",
  "linkedRequirements": ["REQ-FUNC-012"],
  "linkedComponents": ["DC-002"],
  "testType": "security",
  "priority": "critical",
  "description": "Verify that an expired token is refused when listing invoices",
  "preconditions": ["A test user exists with the invoices permission"],
  "steps": ["Call listInvoices (GET /invoices) with an expired bearer token"],
  "testData": "",
  "expectedResult": "The response is 401 and no invoice data is returned",
  "status": "not-run"
}

Where the test cases go

The links are written to the project state, and later steps read them from there.

Flow
  • Test case TC-NNN to Requirement REQ-..., linkedRequirements
  • Test case TC-NNN to Design component DC-NNN, linkedComponents
  • Requirement REQ-... to Requirement links in state, testCaseIds written back
  • Requirement links in state to Traceability matrix
  • Requirement links in state to Tasks: ticket test case refs
  • Test case TC-NNN to Coverage summary
StepWhat it takes from the STS
TasksEach ticket gets the test cases linked to the requirements its implementation unit serves. The ticket lists their ids, and the task author is given each case's description, steps and expected result and may not invent more. The build steps and their verify checks are grounded in them.
TraceabilityThe test column of the matrix. A requirement with a design component but no test case is a "test" gap of severity high.
ComplianceThe written STS document is part of the evidence the assessment reads, with the SDS, TAD, API Contract and Threat Model.
Delivery PlanApproving the STS unlocks it. The plan reads the approved STS as a source document.

Reviewing it

The STS is a chain step. It finishes as Awaiting your review, and approving it unlocks the Delivery Plan and the Project Brief (/brief). Tasks and Compliance need only that the STS exists, so they are available as soon as it is written. The Proposal waits for the Delivery Plan, not for the STS.

A good result has these marks:

  • Coverage is 100%, or every uncovered requirement has a stated reason and a plan.
  • Every "must" requirement has critical or high cases, and the ones that take input, enforce rules, control access or call other systems have a negative case.
  • Every expected result is something a tester can mark pass or fail: exact values, status codes, state changes, with tolerances. Phrases like "works correctly" or "as expected" are a defect in the plan.
  • Performance and security cases carry the number or the refusal from the requirement, such as the load and the threshold, or the 403 for a role without the permission.
  • Entry, exit and suspension criteria are measurable, and the schedule uses roles, not invented names.
  • Risks and environment reflect your project rather than boilerplate.

Then check what the bridge cannot:

  • Every operation in the API Contract has at least one case that names it, with its documented error responses, and no case calls an operation the contract lacks.
  • The status codes and error codes in expected results match the contract's Error Model.
  • Test types are sensible: a performance requirement is tested by a performance case, not a unit test.
  • If the product signs people in through Poly-X, the plan covers an expired or revoked token (401), a missing permission or a mismatched organization (403), and Poly-X being unreachable (503).
  • The counts in the narrative match the Coverage figures and the catalogue.

You can edit the draft while it is under review. The Test Case Catalogue and Version History stay as the bridge wrote them. Test-case status stays "not-run" on approval: it describes execution, not review.

Request changes sends both agents the draft and your change list. The test author returns only the cases it adds, changes or removes, and the narrative writer returns only the sections it changes. The bridge lays those on the previous draft, so what you did not mention stays as it was, and the coverage figures are recomputed from the full set of cases. A draft kept from before this behaviour existed is written again from scratch, and so is a draft you edited by hand: saving an edit discards the stored reply the patch is applied to, and your edit is not kept. Ask for changes first, edit last.

When it fails

What you seeWhyWhat to do
/sts locked: "Approve API Contract to unlock this"The API Contract is written but not approved.Approve the API Contract.
/sts locked: "Run API Contract first"The API Contract has not been written.Run /api.
The run stops at the start with a message ending "run /sds first" or "run /srs first"The state has no SDS, no requirements or no design components.Run the step it names.
"The agent did not return a usable reply."On every attempt the reply could not be read, or it was a refusal.Run it again. If it keeps happening, run Check agent in Project Settings › Agent.
"The agent's reply still fails N check(s) the next step depends on, after M attempt(s)."The test cases were empty, or were still failing validation (a bad TC- id, a missing field, an unknown key, testData not a string, a link to a requirement or component that does not exist), or the narrative was empty. The details list each check.Run it again, or add a note naming the check. The author's best reply is saved at .sdlc/tmp/test-author-last-response.json.
A draft with unresolved checks listed above ApproveThe narrative kept a missing heading, a bad diagram type or an unclosed fence when the draft was written.Read them, then Approve or Request changes naming the section.

Under the hood

  • The driver is bridge/src/services/stsPipeline.service.ts; the headings are in bridge/src/lib/documentSpecs.ts and the loop in bridge/src/lib/correctionLoop.ts. The case checks are bridge/sdlc-engine/scripts/sdlc/validate-test-cases.js against bridge/sdlc-engine/schemas/test-case.schema.json.
  • Written to the project state: testCases (replaced on every run), each requirement's traceForward.testCaseIds, and testCoverageSummary.
  • The document is .sdlc/artifacts/sts-vN.md, registered as artifacts.sts. The draft and the cases it was built from are kept under .sdlc/tmp/ while under review.
  • The gate sits in bridge/sdlc-engine/lib/sdlc/gate-rules.js: sts requires an approved api, plan and brief require an approved sts, and tasks and compliance require only that sts exists. The correction loop is described in Document checks and versioning.