π§ͺ Test Blueprint¶
π What Is a Test Blueprint?¶
A Test Blueprint is a structured, agent-generated specification that defines what, how, and when to test inside the ConnectSoft AI Software Factory.
It is a machine-readable and human-readable artifact that orchestrates all testing activities across:
- β Unit, integration, and end-to-end tests
- π Behavior-driven tests (BDD)
- π Security, mutation, and chaos tests
- π Coverage tracking, regression loops, and observability feedback
Think of it as a software-quality manifest β enabling testing to be generated, diffed, validated, traced, and monitored with full automation.
π§ Created and Maintained By Agents¶
| Agent | Role |
|---|---|
π§ Test Generator Agent |
Produces test code scaffolds based on blueprint inputs |
π§ͺ Test Case Generator Agent |
Creates .feature, .cs, and .yaml test scenarios |
π§ͺ QA Engineer Agent |
Validates coverage, test assertions, and role-level correctness |
π§ Test Coverage Validator Agent |
Ensures blueprint has sufficient test metrics and outputs |
π§ͺ Test Automation Engineer Agent |
Maps blueprint outputs to CI/CD pipelines and rerun strategies |
π§© Test Blueprint Output Forms¶
| Format | Purpose |
|---|---|
.md |
Human-readable documentation of the blueprint |
.yaml |
Machine-readable test execution manifest |
.cs |
Auto-generated MSTest/SpecFlow scaffolds |
.feature |
BDD specs for scenario-driven validation |
.json |
(Optional) AI agent input/output payloads |
π Where It Fits in the Factory¶
flowchart TD
ProductBlueprint --> TestBlueprint
MicroserviceBlueprint --> TestBlueprint
TestBlueprint --> TestGeneratorAgent
TestBlueprint --> QAEngineerAgent
TestBlueprint --> CI_Pipeline
TestBlueprint --> ObservabilityDashboards
π Continuous and Regenerative¶
- Re-generated with every major feature or module change
- Validated continuously via drift detection and coverage tracking
- Linked to
traceId,testRunId,agentId, andfeatureIdin observability layer
π Example Path¶
blueprints/tests/referral-service/test-blueprint.md
blueprints/tests/referral-service/test-blueprint.yaml
π‘ Summary¶
| Property | Value |
|---|---|
| π Generated by | Test Case / Test Generator Agents |
| π§ Inputs | Product Blueprint, Microservice Blueprint, Features |
| π Outputs | .md, .yaml, .cs, .feature files |
| π Consumed by | QA, Observability, CI/CD, Bug Resolver |
| 𧬠Traceable by | traceId, testScenarioId, blueprintId |
The Test Blueprint is how software testing becomes codified, intelligent, and automated β not just an afterthought.
π― Purpose and Position in the Factory¶
The Test Blueprint plays a foundational role in ConnectSoftβs AI Software Factory, turning quality assurance into an autonomous, traceable, and regenerable process.
It ensures testing is not a post-development activity, but rather a first-class, blueprint-driven layerβtriggered directly from product and microservice intents.
π― Core Purposes¶
| Purpose | Description |
|---|---|
| β Define test scope | Clarify what types of tests are expected, for which features/modules |
| π§ͺ Drive test generation | Provide inputs to agents generating .cs, .feature, .yaml files |
| π Enable traceability | Link every test case to features, modules, trace IDs |
| π Automate feedback | Integrate with CI, QA agents, bug loops, dashboards |
| π Embed test rules | Include expected coverage, edge cases, failure tolerance |
| π¦ Support packaging and environments | Configure test run conditions (e.g., edition, persona, dependency stubs) |
π§ Strategic Placement in the Factory¶
Test Blueprints are generated as part of the Quality and Validation Layer:
flowchart TD
ProductBlueprint --> TestBlueprint
MicroserviceBlueprint --> TestBlueprint
ModuleBlueprint --> TestBlueprint
TestBlueprint --> TestGeneratorAgent
TestBlueprint --> TestCaseGeneratorAgent
TestBlueprint --> QAEngineerAgent
TestBlueprint --> CI/CD_Pipeline
π οΈ Factory Usage Flow¶
- π§ Generated from upstream artifacts (features, services, modules)
- π Parsed by Test Generator Agents
- π§ͺ Test stubs and BDD specs created
- β Validation by QA agents + coverage validators
- π Executed in CI pipelines
- π Results stored in test observability graph
- π Regenerated on change
π Metrics It Enables¶
| Metric | Description |
|---|---|
| Test coverage score | % of blueprint features/scenarios tested |
| Feature test depth | Count of scenarios per feature |
| Drift detection alert count | # of untested or stale scenarios |
| QA satisfaction level | Manual approval of generated tests |
π Key Interactions¶
| Blueprint | Role in Test Blueprint |
|---|---|
Product Blueprint |
Supplies user scenarios, roles, personas |
Microservice Blueprint |
Defines exported methods, events, APIs |
Module Blueprint |
Declares reusable logic or testable units |
Pipeline Blueprint |
Integrates test blueprint into CI test matrix |
π― The Test Blueprint is how quality becomes a programmable, inspectable layer β not an afterthought.
π§ͺ Test Types Covered¶
The Test Blueprint formally enumerates the testing strategies to be applied across the platform β from unit validations to full regression suites. Each type is described with its purpose, target scope, generator agent, and observability model.
𧬠Supported Test Types¶
| Type | Description | Generator Agent |
|---|---|---|
| Unit Tests | Validate isolated methods or class behaviors | Test Generator Agent |
| Integration Tests | Validate interaction between components, adapters, or services | Test Automation Engineer Agent |
| End-to-End Tests | Validate full workflow across services, UI, DB, etc. | QA Engineer Agent, Test Orchestrator |
| Scenario Tests | Role-based use case validation from Product Blueprint | Test Case Generator Agent |
| Contract Tests | Ensure DTOs, API shapes, and event schemas match expectations | Test Coverage Validator Agent |
| Behavior-Driven Tests (BDD) | Human-readable Given-When-Then scenarios | Test Case Generator Agent |
| Load/Performance Tests | Assess scalability and response under load | Load/Performance Agent (optional) |
| Security & Mutation Tests | Simulate attacks, fuzz inputs, assert failure safely | Security Agent, Chaos Agent |
| Drift Tests | Ensure regenerated output hasn't broken coverage or structure | Diff Agent, QA Engineer Agent |
π§ Test Type Declaration Example¶
testTypes:
- type: "unit"
target: "ReferralBuilder"
required: true
- type: "bdd"
targetFeature: "ReferralEmailFlow"
roles: ["ClinicAdmin", "PetOwner"]
source: "product-blueprint"
- type: "integration"
components: ["ReferralBuilder", "SendgridAdapter"]
mocks: ["FakeEmailSender"]
π§© Mapping to Inputs¶
| Input Source | Drives These Test Types |
|---|---|
Product Blueprint |
Scenario Tests, BDD |
Microservice Blueprint |
Unit, Contract, Integration |
Module Blueprint |
Unit, Mutation, Composable Function Testing |
Pipeline Blueprint |
Execution sequencing and matrix setup |
π§ Agent Capabilities by Type¶
| Agent | Test Types Generated |
|---|---|
Test Generator Agent |
Unit, Contract, Integration |
Test Case Generator Agent |
BDD, Scenario |
QA Engineer Agent |
Manual approval & feedback |
Test Automation Agent |
Load/Perf, Orchestration |
π§ͺ Test types are not static labels β they are live, regenerable contracts describing the factoryβs current quality strategy.
π₯ Agent Roles and Blueprint Ownership¶
The Test Blueprint is not authored manually β it is generated, validated, evolved, and executed by a cluster of specialized QA and testing agents in the Factory. Each agent contributes specific capabilities across different phases: definition, generation, execution, and feedback.
π§ Core Agent Participants¶
| Agent | Role in Test Blueprint Lifecycle |
|---|---|
π§ Test Generator Agent |
Generates test classes (.cs) and stubs based on microservice/module APIs |
π§ͺ Test Case Generator Agent |
Creates .feature files and YAML test specs from product blueprint |
π§ͺ QA Engineer Agent |
Reviews test coverage, failure sensitivity, negative paths |
π§ Test Coverage Validator Agent |
Calculates actual vs expected coverage %, flags gaps |
π§ͺ Test Automation Engineer Agent |
Integrates test blueprint into CI/CD pipelines |
π Bug Resolver Agent |
Uses test results to auto-file and prioritize bugs |
π Observability Agent |
Collects traces, logs, and result metrics tied to blueprint/test ID |
π Lifecycle & Collaboration Flow¶
flowchart TD
ProductBlueprint --> TestCaseGeneratorAgent
TestCaseGeneratorAgent --> TestBlueprint
TestBlueprint --> TestGeneratorAgent
TestBlueprint --> QAAgent
TestBlueprint --> CoverageValidatorAgent
TestBlueprint --> TestAutomationEngineerAgent
TestBlueprint --> CI
CI --> BugResolverAgent
π¦ Blueprint Ownership & Metadata¶
Each Test Blueprint includes metadata that defines its agent provenance and traceability:
metadata:
generatedBy: "Test Generator Agent v3.1"
validatedBy: "QA Engineer Agent"
traceId: "test-blueprint-7f83"
associatedBlueprints:
- productBlueprint: "feature-email-flow"
- serviceBlueprint: "referral-service"
π Agent-Specific Contributions¶
| Agent | Input | Output |
|---|---|---|
Test Generator Agent |
Service blueprint exports | .cs tests |
Test Case Generator Agent |
Product roles & scenarios | .feature, .yaml |
QA Engineer Agent |
Generated tests | Feedback, tags |
Coverage Validator Agent |
Executed test set | Gaps, drift, reports |
Automation Engineer Agent |
Test blueprint + pipeline spec | CI hooks |
π₯ Testing is not just a manual QA task β itβs an agentic workflow with traceable ownership and automated enforcement.
π§± Structure of the Blueprint File¶
A Test Blueprint is composed of multiple layered files, each serving a unique purpose across test planning, execution, coverage, and traceability. These files are structured, consistent, and memory-traceable β enabling regeneration, diffing, and validation across factory runs.
π Folder Structure Example¶
blueprints/tests/referral-service/
βββ test-blueprint.md
βββ test-blueprint.yaml
βββ tests/
β βββ ReferralServiceTests.cs
β βββ ReferralFeatureTests.feature
β βββ test-execution-matrix.yaml
βββ metadata/
βββ coverage-report.json
βββ blueprint-trace.json
π§© File Purposes¶
| File | Format | Purpose |
|---|---|---|
test-blueprint.md |
Markdown | Human-readable spec for Studio and doc publishing |
test-blueprint.yaml |
YAML | Machine-readable version used by CI agents |
*.feature |
Gherkin | Role-based Given-When-Then scenarios |
*.cs |
C# | Auto-generated test class stubs with MSTest or xUnit |
test-execution-matrix.yaml |
YAML | Describes edition/role/environment combinations to run |
coverage-report.json |
JSON | Metrics on line, branch, and scenario coverage |
blueprint-trace.json |
JSON | Trace linkage to upstream blueprints and generated artifacts |
π§ Semantically Indexed Sections¶
All structured sections in .md and .yaml are indexed into:
- π Vector memory graph (semantic links)
- 𧬠Blueprint registry (hash versioned)
- π CI/CD test history (testRunId, scenarioId)
π§ Sample YAML Block¶
tests:
- id: "referral-email-success"
type: "bdd"
scenario: "Clinic admin sends referral email"
feature: "EmailFlow"
roles: ["ClinicAdmin"]
input: "Valid referral JSON"
expected: "Email sent successfully, status updated"
coverageTags: ["happyPath", "roleBased", "critical"]
π¦ Included Artifacts Per Run¶
Each test blueprint generates:
- β Specification
- π§ͺ Test cases
- βοΈ Test execution metadata
- π§ Trace + observability tags
These are versioned, diffable, and rendered in Studio with full explanation layers.
π§± The Test Blueprint is not one file β it is a modular package of test intent, logic, and traceability for automated quality engineering.
π§ Traceability Model¶
Testing in the ConnectSoft AI Software Factory is not just about validation β it's about visibility, lineage, and accountability. The Test Blueprint embeds rich traceability metadata, ensuring every test is anchored to its upstream context, execution environment, and generated artifact history.
π Traceability Anchors¶
Each test declared in the blueprint is linked across the Factory memory graph using a consistent metadata structure:
| Anchor Type | Description |
|---|---|
traceId |
Unique blueprint run trace |
testScenarioId |
Globally unique ID for scenario (based on role + feature) |
featureId |
ID of the source product feature |
agentId |
Which agent generated or modified the test |
testRunId |
Run/session identifier during CI or Studio test execution |
upstreamBlueprints |
List of product/service/module blueprints used |
π YAML Example with Full Trace Metadata¶
tests:
- id: "clinic-admin-referral-email"
traceId: "test-4a21"
testScenarioId: "scenario-ClinicAdmin-EmailFlow"
featureId: "feature-email-referral"
generatedBy: "Test Case Generator Agent v3.2"
relatedBlueprints:
- product: "product-referrals-v2"
- microservice: "referral-service-v1.4"
π§ Memory Graph Ingestion¶
Every test entity is pushed into the AI memory layer using vector and relational indexing:
| Layer | Purpose |
|---|---|
| π Document embeddings | Enables semantically similar search |
| 𧬠Test Scenario DB | Fast lookup of feature-role pairs |
| π Observability layer | Tracks pass/fail, drift, coverage |
| π§ Context injection | Used by agents to avoid duplicate logic or gaps |
π¦ Cross-System Trace Flow¶
flowchart LR
Feature["π§ Product Feature"]
Service["ποΈ Microservice"]
Blueprint["π Test Blueprint"]
Agent["π§ Generator Agent"]
Test["π§ͺ Test Execution"]
Dash["π Dashboard + Alerts"]
Feature --> Blueprint
Service --> Blueprint
Blueprint --> Agent
Agent --> Test
Test --> Dash
Dash --> Blueprint
π Drift and Regression Tracking¶
When a product or microservice blueprint changes:
- The Test Coverage Validator checks for orphaned or outdated scenarios
- Drifted test cases are flagged and suggested for regeneration
- Agents validate whether regression coverage remains stable
π§ Traceability ensures every test has a purpose, a parent, and a persistent identity β vital for autonomy and observability.
π Sample Output Tree¶
To support automation, traceability, CI/CD integration, and observability, the Test Blueprint produces a structured folder output β with versioned test artifacts, metadata, generated specs, and execution manifests.
This structure ensures each test suite is:
- π Regenerable (via agents)
- π§ Traceable (via IDs and blueprint links)
- π¦ Package-ready (for CI pipelines and Studio)
- π¬ Explainable (human-readable documentation)
ποΈ Example Directory Layout¶
blueprints/
βββ tests/
βββ referral-service/
βββ test-blueprint.md
βββ test-blueprint.yaml
βββ test-execution-matrix.yaml
βββ coverage-report.json
βββ metadata/
β βββ blueprint-trace.json
βββ unit/
β βββ ReferralBuilderTests.cs
βββ integration/
β βββ ReferralEmailIntegrationTests.cs
βββ bdd/
β βββ EmailFlow.feature
β βββ ReferralFailure.feature
βββ scenario/
β βββ ClinicAdmin-ReferralSent.yaml
β βββ PetOwner-ReferralView.yaml
βββ common/
βββ TestConstants.cs
π Folder Breakdown¶
| Folder | Contents |
|---|---|
unit/ |
C# tests for individual components or services (*.cs) |
integration/ |
Multi-component tests using real or fake dependencies |
bdd/ |
Gherkin .feature files for role-based validation |
scenario/ |
YAML specs outlining test logic and expected behavior |
metadata/ |
Traceability, agent provenance, and source blueprint links |
common/ |
Shared mocks, fixtures, test helpers, and test constants |
π File Naming Conventions¶
| File Type | Convention Example | |
|---|---|---|
| Unit test | ComponentNameTests.cs |
|
| BDD scenario | FeatureName.feature |
|
| Scenario YAML | Role-Scenario.yaml |
|
| Execution Matrix | test-execution-matrix.yaml |
|
| Blueprint Spec | `test-blueprint.{md | yaml}` |
π Test Blueprint Entry Point¶
The blueprint always starts from:
These are used by:
- π§ Agents for planning and regeneration
- π§ͺ QA teams for review
- βοΈ CI/CD pipelines for test selection and matrix expansion
- π Studio for explanation and trace navigation
π A well-structured test output tree is the bridge between blueprints, pipelines, and dashboards.
π Factory Test Orchestration Flow¶
In the AI Software Factory, tests are not simply executed β they are planned, generated, validated, and orchestrated through autonomous agents and trace-driven pipelines.
The Test Blueprint acts as the central contract orchestrating this multi-agent, multi-phase workflow.
π End-to-End Test Lifecycle¶
flowchart TD
ProductBlueprint --> TestCaseGenerator["π§ Test Case Generator Agent"]
MicroserviceBlueprint --> TestGenerator["π§ Test Generator Agent"]
TestCaseGenerator --> TestBlueprint
TestGenerator --> TestBlueprint
TestBlueprint --> Validator["π§ Test Coverage Validator"]
TestBlueprint --> QA["π§ͺ QA Engineer Agent"]
TestBlueprint --> Pipeline["βοΈ CI/CD Pipeline"]
Pipeline --> Runner["π§ͺ Test Execution"]
Runner --> Results["π Test Report & Coverage"]
Results --> Observability["π Dashboards & Alerts"]
Results --> BugResolver["π οΈ Bug Resolver Agent"]
π Key Orchestration Phases¶
| Phase | Description |
|---|---|
| Generation | Blueprint created from product and microservice signals |
| Scaffold & Spec | .cs, .feature, .yaml files generated and committed |
| Validation | QA and coverage agents validate test completeness and critical path coverage |
| Execution | Tests run in CI/CD pipeline using test-execution-matrix.yaml |
| Observation | Metrics pushed to observability dashboard (pass/fail, coverage, drift) |
| Correction Loop | Bug Resolver Agent triggers blueprint update if regressions or gaps found |
π§ Agentic Coordination Highlights¶
- No tests are hand-written β all are generated, diffed, or approved by agents.
- Test plans evolve automatically as features, modules, or services change.
- Drift and coverage gaps are continuously scanned and flagged via trace.
- Role-based testing ensures user intent is validated, not just code branches.
π¦ CI/CD Integration Snapshots¶
testPipeline:
runMatrix:
- edition: "core"
roles: ["ClinicAdmin", "PetOwner"]
environments: ["Staging", "Production"]
- edition: "enterprise"
roles: ["BackOfficeUser"]
environments: ["QA"]
blueprintPath: "blueprints/tests/referral-service/test-blueprint.yaml"
π In the Factory, testing is not "run once" β itβs an autonomous workflow, self-healing, memory-linked, and monitored end-to-end.
π§ͺ Role-Based and Persona-Driven Testing¶
In the AI Software Factory, test blueprints are deeply tied to user roles and personas defined in the product blueprint. This ensures that generated tests validate not only functionality, but also intent, permissions, and user expectations.
π€ What Is a Role-Based Test?¶
A role-based test is a test scenario that explicitly encodes:
- The persona performing the action (e.g.,
ClinicAdmin,PetOwner) - The goal the user is trying to achieve
- The expected behavior from the system in that context
These scenarios are critical to validating user experience, authorization logic, and journey coverage.
π§ Blueprint-Driven Persona Injection¶
The Test Case Generator Agent automatically creates BDD and scenario test cases for every declared persona-feature pair in the Product Blueprint.
personaTests:
- role: "ClinicAdmin"
feature: "ReferralEmailFlow"
scenario: "Sends referral email to specialist"
expectedOutcome: "Email successfully delivered"
- role: "PetOwner"
feature: "ReferralTracking"
scenario: "Views status of referral"
expectedOutcome: "Status shown as 'awaiting appointment'"
π§ͺ Generated Artifact Example¶
Feature: Referral Email Flow
Scenario: ClinicAdmin sends referral email
Given I am logged in as a ClinicAdmin
When I create a referral with valid details
Then the specialist should receive an email with referral information
And the referral status should be marked as "Email Sent"
π₯ Persona-Based Test Categories¶
| Persona | Coverage Area |
|---|---|
ClinicAdmin |
Referral management, email initiation |
BackOfficeUser |
Audit logs, configurations, admin portals |
PetOwner |
Referral tracking, appointment status view |
VetSpecialist |
Response to referrals, feedback flow |
π Role-Specific Assertions¶
Tests automatically include:
- β Access checks (does the role have permission?)
- π§Ύ Audit trail verification
- π Correct workflow triggers (email sent, status updated, etc.)
π§ Memory-Indexed Traceability¶
Each role-based test is stored with:
personaIdfeatureIdscenarioIdtestCoverageTag: e.g.,roleBased,authZ,criticalPath
These enable regeneration, analytics, and gap detection.
π₯ Persona-aware testing ensures the platform validates not just logic β but user intent, experience, and journey success.
π Regeneration, Drift Detection, and Blueprint Diffing¶
The AI Software Factory treats testing as a continuously evolving, regenerable asset. As blueprints change (features, services, modules), tests must adapt. The Test Blueprint is designed to detect drift, auto-regenerate outdated scenarios, and enable safe comparison between test generations.
π Regeneration Triggers¶
A Test Blueprint can be regenerated by agents when:
- π§ Product, Service, or Module Blueprints change
- βοΈ A new feature or persona is introduced
- π§ͺ A test fails consistently or exhibits flaky behavior
- π§© QA feedback requests test enhancement
- π¦ Deployment reveals a previously untested flow
π Drift Detection by Agents¶
The Test Coverage Validator Agent continuously compares the current test blueprint against:
- The latest product and microservice blueprints
- Previously passed test results and logs
- Trace IDs of features or modules recently updated
If mismatches or untested flows are found, they are flagged as:
| Drift Type | Example Detected Gap |
|---|---|
missingScenario |
Feature has no test coverage for new persona |
changedSignature |
API parameter added, but test still uses old payload |
staleAssertion |
Test passes but no longer reflects real user outcome |
invalidAuthZ |
Role lost access, test still assumes permission |
π§ Diffing Model¶
All Test Blueprints are versioned and stored as diffable, semantic artifacts.
Diff structure includes:
{
"addedTests": ["scenario-PetOwner-ReferralView"],
"removedTests": ["scenario-BackOffice-AuditFlow"],
"changedTests": {
"scenario-ClinicAdmin-ReferralEmail": {
"expectedOutcome": ["Email sent", "Email sent + audit log written"]
}
}
}
π οΈ Auto-Healing Capabilities¶
Upon drift detection:
- π§ Agents regenerate affected test files
- β If not auto-fixable, they notify QA Engineer Agent
- π Dashboard updates reflect gaps or recovered coverage
𧬠Version-Aware Observability¶
Tests are always run against the latest generated version of the blueprint. Past versions remain available for regression snapshots and debugging historical bugs.
π Regeneration and drift detection ensure the Factory never falls out of sync between whatβs built and whatβs tested.
βοΈ Testing in CI/CD and Environment Matrix¶
Test Blueprints are tightly integrated into the Factoryβs CI/CD pipelines, ensuring automated execution across environments, editions, and user roles.
This orchestration is governed by the test-execution-matrix.yaml, a central contract for test coverage planning and parallelization.
π οΈ Test Matrix Example¶
testExecutionMatrix:
editions:
- name: "core"
roles: ["ClinicAdmin", "PetOwner"]
environments: ["Staging", "Production"]
- name: "enterprise"
roles: ["BackOfficeUser"]
environments: ["QA"]
exclude:
- role: "BackOfficeUser"
environment: "Production"
This matrix ensures that:
- Tests are only executed where they make sense
- QA load is optimized across environments
- Edge case coverage is balanced by role and edition
π Pipeline Integration Flow¶
flowchart TD
CI["Azure DevOps Pipeline"]
Blueprint["test-blueprint.yaml"]
Matrix["test-execution-matrix.yaml"]
Executor["Test Executor Agent"]
Report["Coverage + Failure Report"]
Dashboard["Observability Dashboard"]
CI --> Blueprint
CI --> Matrix
Matrix --> Executor
Executor --> Report
Report --> Dashboard
π¦ Pipeline Output Artifacts¶
| Artifact | Format | Description |
|---|---|---|
test-results.json |
JSON | Pass/fail per test case |
coverage-summary.xml |
XML | Line, branch, and scenario coverage |
test-run-report.md |
Markdown | Human-readable Studio report |
test-failures.csv |
CSV | Quick triage list for bug resolver agent |
test-flaky-log.json |
JSON | Tracked over time to flag instability |
π Matrix Expansion in Practice¶
For each matrix cell (edition + role + env), the executor spawns parallel test jobs:
| Edition | Role | Environment | Tests Run |
|---|---|---|---|
core |
ClinicAdmin | Staging | Scenario + BDD + Unit |
core |
PetOwner | Production | Scenario + Integration |
enterprise |
BackOfficeUser | QA | Scenario + E2E + Audit Flows |
π§ Test Execution Tags¶
Tests are tagged by:
editionroleenvtestTypetestIdtraceId
This tagging model allows fine-grained dashboard filtering, alert scoping, and cross-run comparisons.
βοΈ CI/CD is not an afterthought β it is natively orchestrated by the Test Blueprint and its matrix to ensure full traceable coverage.
π Observability, Coverage Metrics, and Failure Analytics¶
Testing in the Factory is not just about execution β it's about visibility, explanation, and continuous improvement. The Test Blueprint defines hooks for telemetry, coverage analysis, and failure diagnostics, enabling deep traceable insights for QA, developers, and orchestrators.
π§ͺ Observability Hooks¶
Each test run emits structured observability data via:
- π
traceId,scenarioId,testRunId - β Pass/fail result
- π§ Root cause or stack trace (if failed)
- β±οΈ Execution duration
- π Flaky count (per history window)
π¦ Sample Telemetry Output (JSON)¶
{
"testRunId": "run-20250609-1327",
"testId": "ClinicAdmin-ReferralEmail",
"result": "Failed",
"traceId": "test-blueprint-7f83",
"coverage": {
"lines": 89,
"branches": 63,
"scenarios": 5
},
"flakyCount": 2,
"executionTimeMs": 432,
"errorSummary": "EmailService not responding"
}
π Coverage Categories¶
| Metric | Description |
|---|---|
| Line coverage | % of code lines touched |
| Branch coverage | % of if/else branches exercised |
| Scenario coverage | % of product scenarios validated |
| Persona coverage | % of roles covered in tests |
| Edition coverage | % of features tested across editions |
Coverage reports are available per:
- π§± Module
- ποΈ Microservice
- π₯ Role
- π¦ Edition
- β±οΈ Time window
β οΈ Failure Diagnostics & Drift Detection¶
When a test fails:
- Root cause is traced using logs, traces, and metrics
- Blueprint trace is checked for changes upstream
- Bug Resolver Agent may auto-file issues or request blueprint regeneration
π Dashboards and Alerts¶
Observability is visualized via:
- π΄ Failed test graphs per blueprint, edition, or feature
- π‘ Flaky test heatmaps
- π’ Coverage scorecards per service/module
- π Regression trend charts over time
- π§ Semantic maps of scenario-to-feature-to-code coverage
π Every test is an insight. Observability transforms them from pass/fail events into strategic quality signals.
π οΈ Bug Resolution, Feedback Loop, and Retest Flow¶
The AI Software Factory transforms test failures into structured feedback β not just for humans, but for the agents that authored the code. This is enabled by the tight loop between test blueprint failures and automated issue handling, managed via specialized QA and Bug Resolution Agents.
π§ Agents Involved in the Loop¶
| Agent | Role |
|---|---|
Test Generator Agent |
Regenerates missing or broken test artifacts |
Bug Resolver Agent |
Triages failed tests, maps them to upstream sources |
Bug Investigator Agent |
Analyzes logs, traces, telemetry for RCA |
QA Engineer Agent |
Validates resolutions and retriggers test blueprint flows |
π Resolution Workflow¶
flowchart TD
Failure["β Test Failure Detected"]
Logs["π§Ύ Log/Trace Collection"]
RCA["π Bug Investigator Agent"]
Blueprint["π Test Blueprint"]
Fix["π οΈ Code/Config Fix"]
Retest["π Retest Triggered"]
Pass["β
Test Passes"]
Failure --> Logs
Logs --> RCA
RCA --> Blueprint
Blueprint --> Fix
Fix --> Retest
Retest --> Pass
π Bug Metadata Attached to Failures¶
failureDetails:
testId: "ClinicAdmin-ReferralEmail"
errorType: "UnhandledException"
rootCause: "NullReferenceException in EmailService"
linkedFeature: "email-referral"
bugTraceId: "bug-7382"
suggestedFix: "Guard clause for null dependency"
autoFixAvailable: true
π Blueprint Update Flow¶
When the root cause is confirmed:
- β The blueprint is auto-patched (e.g., assertion or scenario update)
- π¬ A Studio message is logged with a change summary
- π§ Test Generator Agent regenerates impacted artifacts
- π Test is queued again in
test-execution-matrix.yaml
π€ Feedback Channels¶
Failures and resolutions are logged to:
- π§Ύ QA Dashboards (for human review)
- π§ Memory graph (for future avoidance)
- π CI/CD logs (for trace audit)
π οΈ Bug resolution is not a dead-end β itβs a living feedback loop built into the blueprint itself, accelerating quality from incident to improvement.
π Security, Permissions, and Test Access Control¶
Tests in the Factory arenβt just about functional correctness β they are also security-aware, role-validated, and bound to edition-level permissions. The Test Blueprint encodes all security assumptions and enforces access-aware test generation and execution.
π Key Security Aspects in the Test Blueprint¶
| Aspect | Purpose |
|---|---|
| Role-based test scope | Prevents tests from executing actions users shouldn't have access to |
| AuthZ assertion tests | Validates that unauthorized roles are denied operations |
| Secure data mocking | Ensures PII and secrets are masked in test inputs/outputs |
| Token-based access | Authenticates test API calls using role-specific JWTs |
| Edition-level visibility | Tests only appear in editions allowed to expose the feature |
π§ Security-Aware Test Case Generator Behavior¶
The Test Generator Agent will:
- Skip generation for roles without access (as defined in the product blueprint)
- Add negative tests to validate forbidden access attempts
- Inject authentication headers into generated API or integration tests
- Emit security audit metadata per test case for traceability
π Negative Test Case Example¶
- id: "PetOwner-CannotDeleteReferral"
role: "PetOwner"
scenario: "Tries to delete a referral"
expectedStatusCode: 403
expectedOutcome: "Access denied"
π§ͺ Auth & Claims Injection (Integration Test)¶
var token = await GetTokenAsync(role: "PetOwner");
var client = CreateHttpClientWithToken(token);
var response = await client.DeleteAsync("/api/referrals/1234");
Assert.Equal(HttpStatusCode.Forbidden, response.StatusCode);
π Security Test Coverage Reporting¶
The Test Coverage Validator Agent tracks:
- β Roles with positive + negative coverage
- π‘οΈ Features lacking access control assertions
- π Authorization gaps (e.g. feature test exists but authZ is skipped)
π§ Memory-Indexed Security Tags¶
Each test is indexed with:
securityTag: e.g.,authz,role-scope,negative-flowroleId,featureId,traceIdaccessCheckResult:allowed,denied,unauthenticated
π The Test Blueprint ensures security validation is automated, traceable, and role-aware β never an afterthought.
π§ͺ BDD Integration: Gherkin, Feature Files, and Agent Handoff¶
The Factory uses Behavior-Driven Development (BDD) patterns to enhance traceability, clarity, and collaboration across agents.
Each Test Blueprint can include or generate .feature files, authored or enhanced by the Test Case Generator Agent, and optionally reviewed by the QA Engineer Agent.
π― Why BDD in the Factory?¶
- β
Human-readable syntax (
GivenβWhenβThen) - π Mirrors persona-based flows in the product blueprint
- π§© Maps directly to traceable features and scenarios
- π Integrates seamlessly with
.NETtesting viaSpecFloworxBehave
π Sample Gherkin .feature File¶
Feature: Referral Status Tracking
Scenario: PetOwner views referral status
Given I am logged in as a PetOwner
And I have a referral with status "awaiting appointment"
When I open the referral status screen
Then I should see "awaiting appointment"
π§ Generated by Agent¶
| Step | Agent Responsible |
|---|---|
| Identify scenario from blueprint | Test Case Generator Agent |
| Draft feature file | Test Case Generator Agent |
| Validate persona/role mapping | QA Engineer Agent (optional) |
| Generate bindings/tests | Test Generator Agent |
π§© Feature-to-Test Binding Flow¶
flowchart TD
Blueprint["π§ Test Blueprint"]
FeatureFile["π Gherkin Feature File"]
StepDefs["π§© Step Definitions"]
Tests["π§ͺ Executable BDD Tests"]
Blueprint --> FeatureFile
FeatureFile --> StepDefs
StepDefs --> Tests
Bindings are generated in .cs files or reused from shared libraries such as:
π Regeneration Support¶
If the Product Blueprint or Module Blueprint changes:
- π The
Test Case Generator Agentupdates the.featurefile - β
The
Test Generator Agentre-binds or adjusts code-behind files - π§ All changes traced to the original user scenario and blueprint signal
π Trace Tags for BDD Files¶
Each feature file includes frontmatter or comments like:
# traceId: test-blueprint-referral-status
# role: PetOwner
# edition: core
# generatedBy: Test Case Generator Agent
π§ͺ BDD enables cross-functional alignment β agents and humans can inspect, approve, or regenerate test cases with clarity and purpose.
π Reuse, Shared Fixtures, and Cross-Module Scenario Composition¶
Test Blueprints promote reuse-first principles, reducing duplication and maximizing maintainability across modules, services, and products. Agents leverage shared fixtures, scenario fragments, and composition rules to build rich, modular, and DRY test suites.
π Why Reuse Matters¶
- π§© Shared login/setup logic across tests
- π Reusable "Given" conditions (e.g., user state, data seeding)
- π¦ Centralized assertions and domain behaviors
- π Fewer regenerated files when upstream changes occur
- π§ Better trace lineage across multiple services
π§± Shared Fixture Architecture¶
| Type | Purpose | Examples |
|---|---|---|
TestFixtureBase.cs |
Base test setup for a module or domain | Seed users, init API clients, reset state |
SharedScenarioSteps.cs |
Reusable Gherkin steps across personas | Given I am logged in as X |
DomainAssertions.cs |
Centralized helper methods for expected outcomes | AssertReferralStatus("awaiting appointment") |
MockedDependencies.cs |
Cross-module mocks and stubs | MockEmailSender, FakeQueue |
π Blueprint-Linked Shared Libraries¶
Each test blueprint can declare its fixture dependencies:
sharedFixtures:
- tests/common/fixtures/TestFixtureBase.cs
- tests/common/bindings/SharedScenarioSteps.cs
- tests/common/assertions/DomainAssertions.cs
Agents use these declarations to:
- Reference shared test logic
- Avoid redundant code generation
- Safely patch broken dependencies across blueprints
π Scenario Composition Across Modules¶
For cross-domain flows (e.g., Referral + Notification + AuditLog), the Test Case Generator Agent can compose:
- Scenario chain based on multiple module blueprints
- Step definitions that bridge multiple services
- Composite trace ID for multi-module traceability
Scenario: ClinicAdmin sends referral and confirms delivery
Given I create a referral
Then an email is sent to the specialist
And an audit log entry is created
π Regeneration-aware Reuse¶
If a shared fixture changes:
- Affected tests are re-linked, not fully regenerated
- Blueprint metadata tracks fixture version and impact scope
- Agents can perform targeted regeneration with trace-based scoping
π Reuse is not manual β itβs blueprint-aware, memory-indexed, and orchestrated across services.
π§ Traceability: Feature β Test β Failure β Fix¶
Traceability is at the heart of the Test Blueprint. Every test is semantically linked to its originating feature, and every failure is traceable back to its source blueprint. This enables deterministic debugging, targeted regeneration, and auditable coverage.
π End-to-End Trace Chain¶
Each generated test embeds a trace chain like:
trace:
featureId: "feature-referral-email"
scenarioId: "ClinicAdmin-SendsReferralEmail"
productTraceId: "product-blueprint-vetspire"
testBlueprintId: "test-blueprint-vetspire-v1"
generatedBy: "TestCaseGeneratorAgent"
lastVerifiedBy: "QATestValidatorAgent"
π When a Test Fails⦶
A trace-aware pipeline or agent can answer:
- π§ What feature did this come from?
- π§± What modules are impacted?
- π§ͺ Has this scenario been updated since test creation?
- π οΈ Is the failure due to a code change, a test gap, or an environment drift?
π Linked Blueprints¶
Each test points to:
- π Product Blueprint (features, roles)
- π§± Microservice or Module Blueprint (API, handlers, events)
- π Test Blueprint (version, generator agent)
- π§Ύ Logs and run metadata (via trace IDs)
π§ Cross-Agent Debugging¶
Example use-case:
Test
ClinicAdmin-SendsReferralEmailfails β Trace ID found in test logs β Agent fetches matching Product Blueprint β Identifies handler implementation inReferralServiceβ Resolves recent change introduced byCodeCommitterAgentβ Auto-suggests fix viaBugResolverAgent
π Version-aware Memory Tags¶
Each trace entry includes:
| Field | Description |
|---|---|
version |
Test + blueprint version at time of run |
originTraceId |
Generated from what product trace root |
affectedEntityId |
Domain model or handler name (if linked) |
failureFingerprint |
Stack trace or exception code (optional) |
π§ Traceability transforms testing from passive execution to active architectural intelligence.
π¦ Test Asset Output Formats and Storage Locations¶
Tests in the Factory are not ephemeral. Each run, blueprint, and result is materialized as structured output and stored in both short-term and long-term memory. The Test Blueprint defines exactly what gets emitted, where it lives, and how itβs indexed.
π Output Types¶
| Artifact Type | Format | Description |
|---|---|---|
| Test Blueprint | .yaml/.json |
Canonical source of test strategy |
| Executable Tests | .cs/.feature |
Test logic in C# or Gherkin |
| Test Results | .json |
Per-run result snapshots |
| Coverage Reports | .xml/.json |
Line, branch, scenario, role coverage |
| Failure Logs | .log/.json |
Stack traces, telemetry links, RCA context |
| Dashboard Views | .md/.html |
Rendered summaries for humans (Studio reports) |
π File Storage Layout¶
Each test blueprint has a folder:
tests/{service-name|module-name}/
βββ test-blueprint.yaml
βββ test-blueprint.json
βββ scenarios/
β βββ referral-status.feature
β βββ referral-email.feature
βββ bindings/
β βββ ReferralSteps.cs
βββ fixtures/
β βββ TestFixtureBase.cs
βββ results/
β βββ test-run-20250609.json
βββ coverage/
β βββ coverage-summary.xml
β βββ scenario-matrix.json
βββ failures/
β βββ referral-email-failure-20250609.log
π§ Memory and Index Storage¶
| Storage Layer | Use Case |
|---|---|
| Blob Storage | Store large artifacts, logs, and fixtures |
| Azure Tables or Cosmos | Index run metadata, trace links |
| Vector DB | Embed test cases for semantic retrieval |
| Azure DevOps Artifacts | Pipeline outputs (results, dashboards) |
| Studio (Markdown) | Human-readable documentation view |
π Artifact Trace Metadata¶
All test-related assets embed trace fields like:
traceId: test-blueprint-referral-email
linkedBlueprint: microservice-blueprint-referral
scenarioId: ClinicAdminSendsReferral
generatedBy: TestCaseGeneratorAgent
runId: test-execution-20250609-001
This allows:
- π Regeneration targeting
- π Coverage diffing
- π§ RCA linking
- π§ Long-term knowledge injection
π¦ Tests are not βruntime-onlyβ artifacts β they are first-class, versioned, inspectable, and reusable blueprints.
π Studio Markdown Rendering and QA Presentation View¶
Every Test Blueprint includes a Markdown-based rendering designed for QA engineers, test managers, and product stakeholders. This Studio-friendly view enables rich documentation, commentary, and visualizations β aligning agents with human QA review.
π Markdown Output: Purpose¶
- π Acts as a readable contract for each test suite
- β Lists all planned, active, and pending test cases
- π Shows regeneration tags and memory trace links
- ποΈ Supports side-by-side view with feature specs and coverage dashboards
π Markdown File Naming¶
π§ͺ Example Markdown Structure¶
# π§ͺ Test Blueprint: Referral Module
## π― Scope
This blueprint covers all referral lifecycle scenarios for the `ClinicAdmin`, `BackOfficeUser`, and `PetOwner` personas.
---
## π Scenarios
### β
ClinicAdmin sends a referral
- Given: I am logged in as a ClinicAdmin
- When: I send a referral with valid patient details
- Then: A confirmation email is sent to the recipient
π Last run: 2025-06-09 β β
Passed
π traceId: `referral-email-CA01`
π€ Role: ClinicAdmin | βοΈ Feature: ReferralEmail | π§ Source: Feature ID #email-scenario-1
---
### β PetOwner attempts to cancel referral
- When unauthorized: Expect HTTP 403
- β Currently failing β under review by BugResolverAgent
- π failureId: `referral-cancel-FR403`
---
## π Coverage Metrics
| Metric | % Covered |
|-------------------|-----------|
| Scenarios | 92% |
| Roles | 100% |
| Editions | 75% |
---
## π οΈ Fixtures and Bindings
- `TestFixtureBase.cs`
- `ReferralSteps.cs`
---
## π¦ Version Info
- `test-blueprint-referral-v1`
- Last Updated: 2025-06-09
- Generated by: `Test Generator Agent`
π§ Presentation Features in Studio¶
| Feature | Description |
|---|---|
| π Filter by role/module | See only relevant test subsets |
| β³ History timeline | View test performance over time |
| β οΈ Failure hotspots | Highlight flakiness or missing scenarios |
| π§ Agent feedback prompts | Ask an agent to regenerate, skip, or rebind |
| π Export to report | Generate .pdf or .docx summary for audits |
π Markdown is the QA-facing lens into the Test Blueprint β combining automation traceability with human clarity.
π§ Prompt Templates and Agent Instructions¶
Test Blueprints define structured prompt templates used by test-related agents to consistently generate and validate test artifacts. These templates ensure that test generation is aligned with the system's goals, feature semantics, and technical constraints.
π― Purpose of Prompt Templates¶
- Guide
Test Generator AgentandTest Case Generator Agentwith scenario-rich input - Ensure tests reflect user journeys, system boundaries, and security roles
- Support reproducible generation across environments and versions
π§ Prompt Template Example (Test Case Generation)¶
{
"role": "ClinicAdmin",
"featureId": "referral-email",
"description": "Ensure referral confirmation emails are sent",
"given": "A ClinicAdmin has created a valid referral",
"when": "The referral is submitted",
"then": "A confirmation email is sent to the recipient",
"expectedStatusCode": 200,
"traceTags": ["test-blueprint", "email", "clinicadmin"]
}
π¦ Prompt Types in the Factory¶
| Template Name | Used By | Description |
|---|---|---|
generate-test-scenario |
Test Case Generator Agent |
Produces Gherkin or YAML test scenarios |
generate-step-bindings |
Test Generator Agent |
Produces executable C# methods from Gherkin steps |
analyze-test-failure |
Bug Resolver Agent |
Diagnoses failure and recommends fixes or diffs |
extend-coverage-for-role |
QA Engineer Agent |
Fills gaps in role/scenario coverage matrix |
π Dynamic Prompt Enrichment¶
Agents enrich templates at runtime with:
- π― Feature-level signals from Product Blueprint
- π§± Microservice or Module metadata (handlers, APIs, queues)
- π€ Role capabilities and edition constraints
- π Historical failure fingerprint for context
π§ Memory-Aware Prompting¶
Agents reference:
- Previously generated tests (via vector similarity)
- Related scenarios for similar roles or editions
- Known flaky test patterns to avoid duplication
π§ Generated Prompt Trace¶
Each prompt and result pair is stored with:
promptId: test-case-generator-20250609-001
agent: Test Case Generator Agent
sourceScenarioId: email-notification-vetspire
generatedOn: 2025-06-09
resultType: gherkin-feature
version: v1
π§ Prompt templates are not static scripts β they are adaptive, enriched, and memory-indexed instructions that make test generation intelligent and self-correcting.
π Continuous Test Regeneration and Change Detection¶
The Test Blueprint supports automated, trace-aware regeneration when upstream inputs change β ensuring tests never fall behind the evolving product, module, or architecture.
π What Triggers Regeneration?¶
| Change Source | Example | Regeneration Scope |
|---|---|---|
| Product Blueprint | New feature or updated scenario | Add/update tests |
| Microservice/Module Blueprint | Modified endpoint, handler, contract | Adjust bindings/tests |
| Role/Edition Shift | Access revoked or added | Add/remove authorization tests |
| Regression or Flaky Pattern | Agent detects instability | Patch or rebind test |
π Regeneration Flow¶
flowchart TD
Update["π Detected Change"]
Blueprint["π§ Test Blueprint"]
Agent["Test Generator Agent"]
Tests["π§ͺ Regenerated Test Artifacts"]
Update --> Blueprint --> Agent --> Tests
π§ Smart Diffing Before Rewrite¶
Test agents compare:
- Trace fingerprints
- Feature descriptions
- Step-level deltas
- Execution metadata
Only regenerate delta sections, unless full rehydration is required.
π Test Blueprint Version Tags¶
Each regenerated test set is versioned:
version: v3
reason: "Product blueprint updated - referral-email"
originVersion: v2
changes:
- scenarioUpdated: ClinicAdmin sends referral
- newScenarioAdded: PetOwner receives referral summary
πΎ Output of Regeneration¶
- Updated
.featureor.csfiles - Markdown diff in Studio (before/after)
- Optional CI re-run flag
- Auto-comment in QA dashboard trace panel
π§© Coordinated Multi-Agent Regeneration¶
| Agent | Action |
|---|---|
Test Case Generator |
Rewrites scenario(s) |
Test Generator Agent |
Rebuilds bindings |
Test Coverage Validator |
Reassesses coverage deltas |
QA Engineer Agent |
Optional approval for diff-sensitive areas |
π Test regeneration is reactive, surgical, and trace-first β ensuring drift never occurs between system evolution and its tests.
π Test Coverage Matrix and Role-Edition Validation¶
The Test Blueprint defines and validates a coverage matrix that maps roles, editions, and scenarios to ensure complete testing of access, behavior, and visibility across the platform.
π§© Dimensions of Coverage¶
| Dimension | Description |
|---|---|
| β Roles | Personas (e.g., ClinicAdmin, PetOwner) |
| π Editions | Platform tiers (e.g., Core, Premium, Mobile) |
| π― Features | Functional use cases from the Product Blueprint |
| π§ͺ Scenarios | Test cases derived from role Γ feature pairs |
π Coverage Matrix Example¶
| Feature | ClinicAdmin | PetOwner | BackOffice | Core Edition | Premium Edition |
|---|---|---|---|---|---|
| View Referral | β | β | β | β | β |
| Cancel Referral | β | β | β | β | β |
| Receive Email Notification | β | β | β | β | β |
| Audit Logging | β | N/A | β | β | β |
π§ Who Builds and Verifies It?¶
| Agent | Responsibility |
|---|---|
Test Case Generator |
Generates matrix entries from Product Blueprint |
Test Coverage Validator |
Verifies matrix is complete and flag gaps |
QA Engineer Agent |
Reviews matrix and suggests missing edge cases |
π Missing Coverage Examples¶
- β
PetOwnerlacks tests for a visible but restricted feature - β
Mobileedition has no test coverage for download scenarios - β A shared scenario is only tested under
Core, notPremium
π§ Matrix Metadata Format¶
feature: referral-email
role: PetOwner
edition: Core
scenarioId: PO-EmailReceipt
coverageStatus: tested
lastVerified: 2025-06-09
sourceTraceId: test-blueprint-vetspire-referral-email
π Studio View (QA Dashboard)¶
- β Completed tests per feature/role/edition
- β οΈ Gaps highlighted with regeneration suggestion buttons
- π Edition-specific coverage heatmap
π Matrix-Based Test Prioritization¶
The Factory can:
- Rank high-risk untested scenarios
- Flag inconsistent coverage between editions
- Trigger regeneration or QA review automatically
π The coverage matrix is not static β it's active, versioned, validated, and foundational to QA observability.
π External Test Execution and CI/CD Integration¶
The Test Blueprint defines how generated tests are executed in external environments such as pipelines, containers, or cloud-native test runners. It integrates with CI/CD systems to automate execution, validation, and reporting.
ποΈ Execution Targets¶
| Target Environment | Description |
|---|---|
| Azure DevOps Pipelines | Default CI runner with stage-based jobs |
| GitHub Actions | Used in OSS or federated blueprints |
| Docker Compose Test Harness | Local integration and smoke test validation |
| Kubernetes Test Pods | E2E tests with real runtime infrastructure |
| Cloud Test Orchestrator | Event-based or role-driven execution flows |
βοΈ CI/CD Workflow Steps¶
Typical steps generated from the blueprint:
- task: InstallTestDeps
- task: CompileTests
- task: RunUnitTests
- task: RunBDDScenarios
- task: GenerateCoverageReport
- task: UploadTestResults
- task: AnalyzeFailures
π Generated Test Artifacts for CI¶
| Artifact | Location |
|---|---|
*.trx, *.json |
/artifacts/tests/results/ |
coverage.xml |
/artifacts/tests/coverage/ |
gherkin/*.feature |
/tests/scenarios/ |
bindings/*.cs |
/tests/bindings/ |
logs/*.log |
/tests/failures/ |
π CI Extensions and Triggers¶
| Trigger | Behavior |
|---|---|
| Commit to Product Blueprint | Partial test regeneration + CI trigger |
| Push to Microservice Code | Run tests tied to that module |
| Nightly Regeneration Job | Full revalidation of test blueprints |
| Edition or Role Drift Detected | Targeted scenario diff and test job |
π Test Dashboard Integration¶
Tests report back to QA dashboards with:
- β Passed/Failed/Skipped stats
- π Coverage trends
- π Failure diffs
- π Trigger buttons to regenerate tests
π§ Agent-Aware Execution Flow¶
Each test run emits trace metadata:
runId: testrun-20250609-001
triggeredBy: azure-pipelines
sourceBlueprint: test-blueprint-referral
agentVerifier: QATestValidatorAgent
resultStoredAt: /artifacts/tests/results/testrun-20250609-001.json
π The blueprint ensures that tests are not just written, but continuously executed, observed, and evolved.
π οΈ Cross-Agent Collaboration and Observability Hooks¶
The Test Blueprint is not an isolated artifact β it is deeply integrated with other agents in the Factory through event-driven collaboration, shared memory, and observability signals. Agents use these hooks to coordinate coverage, validate quality, detect regressions, and generate documentation or patches.
π€ Agent Collaborators¶
| Agent | Role in Test Lifecycle |
|---|---|
Test Generator Agent |
Converts scenarios into runnable test code |
Test Case Generator Agent |
Derives BDD-style scenarios from product blueprint |
Test Coverage Validator |
Analyzes gaps in role-feature-edition coverage matrix |
QA Engineer Agent |
Reviews and verifies blueprint-based outputs |
Bug Resolver Agent |
Diagnoses test failures and proposes corrective PRs |
Microservice Generator Agent |
Triggers test regeneration when service contracts change |
CI Pipeline Agent |
Connects test output with CI jobs and validation steps |
Observability Agent |
Adds logging, spans, and telemetry to test traces |
π‘ Event Hooks¶
Test Blueprints are wired to emit and listen to events on the platform event bus:
| Event | Emitted By | Consumed By |
|---|---|---|
TestBlueprintUpdated |
Test Generator Agent |
CI Pipeline Agent, QA Agent |
TestScenarioFailed |
CI job | Bug Resolver Agent |
CoverageGapsDetected |
Test Coverage Validator |
QA Engineer Agent, Test Generator |
BlueprintVersionDiffed |
QA Engineer Agent |
Test Generator Agent |
π§ Observability Tags in Test Runs¶
Every test and test blueprint includes:
traceId: test-referral-notification
agentId: TestCaseGeneratorAgent
runId: testrun-2025-06-09-001
correlationId: product-blueprint-vetspire-referral
confidenceScore: 0.94
isFlaky: false
firstFailureSeen: 2025-06-09
linkedIssueId: bug-4597
π Examples of Cross-Agent Behavior¶
- A flaky test is detected β
Observability Agentmarks it βBug Resolver Agenttags scenario βTest Generator Agentregenerates with isolation patch. - A new edition is introduced β
Edition Model Agentemits change βQA Engineer Agenttriggers coverage review β new tests generated automatically. - A feature is refactored β
Microservice Generator Agentdiff-checks handler signatures β linked tests are flagged for prompt regeneration.
π οΈ Test Blueprints donβt just describe tests β they link people, agents, telemetry, and change in a traceable, collaborative, and autonomous loop.
β Final Summary and Structural Recap¶
The Test Blueprint serves as the foundational artifact for autonomous, traceable, regenerable, and CI-integrated testing in the ConnectSoft AI Software Factory. It encodes qualityβnot as a post-process, but as a first-class, generative asset.
π§ What It Represents¶
- A living contract between Product, Engineering, QA, and AI Agents
- A source of truth for what, how, and why we test β and for whom
- A trace-linked entity with versioning, observability, and regeneration logic
- A semantic blueprint that spans code, BDD, pipelines, dashboards, and knowledge memory
π Core Sections in a Test Blueprint¶
| Section | Purpose |
|---|---|
| π Scope & Intent | Defines features, roles, editions, and coverage goals |
| π§ͺ Scenario Definitions | BDD-style descriptions of testable flows |
| π Bindings & Fixtures | Connect scenarios to executable test logic |
| π Coverage Matrix | Tracks testing across personas, editions, and modules |
| π Regeneration Strategy | Hooks into change detection and blueprint diffs |
| βοΈ CI/CD Execution Paths | Connects test logic to pipelines and run metadata |
| π§ Prompt Templates | Instructional templates for generation agents |
| π Traceability & Observability | Links tests to blueprints, failures, fixes, logs, and memory |
| π¦ Output Formats & Storage | Manages test artifact lifecycle and rendering for Studio |
π§ Agent Involvement Overview¶
| Agent | Key Role(s) |
|---|---|
Test Case Generator Agent |
BDD generation from features |
Test Generator Agent |
Creates C# or SpecFlow bindings |
QA Engineer Agent |
Validates blueprint quality and readiness |
Bug Resolver Agent |
Diagnoses failures and links bugs |
Test Coverage Validator |
Matrix analysis and gap detection |
Microservice Generator Agent |
Triggers test regeneration on contract change |
CI Pipeline Agent |
Integrates tests into automated delivery workflows |
π§ Traceable Memory Shape¶
| Memory Type | Contents |
|---|---|
| Vector Memory | Embedded scenarios, prompts, step templates |
| Blob Storage | Results, coverage, logs, failure traces |
| Index Tables | Scenario metadata, trace IDs, change history |
| Studio View | Markdown render for humans; integrates into QA workflow |
π Versioning & Regeneration Philosophy¶
- Every blueprint and its components are immutable and versioned
- Agents can diff, regenerate, or skip based on trace delta
- Every artifact ties back to a source of intention β never just test-by-accident
π Final Thoughts¶
The Test Blueprint isnβt about just running tests. Itβs about ensuring the Factory continuously knows what should work, for whom, under what constraints β and how to prove it.