From prism-devtools
Use to trace requirements through implementation. Maps acceptance criteria to code and tests.
npx claudepluginhub resolve-io/.prismThis skill uses the workspace's default tool permissions.
<!-- Powered by PRISMâ„¢ Core -->
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Provides patterns for autonomous Claude Code loops: sequential pipelines, agentic REPLs, PR cycles, de-sloppify cleanups, and RFC-driven multi-agent DAGs. For continuous dev workflows without intervention.
Applies NestJS patterns for modules, controllers, providers, DTO validation, guards, interceptors, config, and production TypeScript backends with project structure and bootstrap examples.
Map story requirements to E2E integration test cases for comprehensive end-to-end traceability and workflow validation.
Create a requirements traceability matrix that ensures every acceptance criterion has corresponding E2E integration test coverage. This task prioritizes integration tests as the source of truth for requirement validation, ensuring complete workflow traceability from user input to system response.
FOCUS: E2E integration tests are the PRIMARY mechanism for requirements traceability. Unit tests supplement but integration tests validate complete requirement fulfillment.
IMPORTANT: Given-When-Then is used here for documenting the mapping between requirements and tests, NOT for writing the actual test code. Tests should follow your project's testing standards (no BDD syntax in test code).
Identify all testable requirements from:
For each requirement, document E2E integration tests that validate complete workflows. Use Given-When-Then to describe what the test validates (not how it's written):
requirement: 'AC1: User can authenticate and access tenant-specific resources'
test_mappings:
# PRIMARY: E2E Integration Test (Source of Truth)
- test_file: 'Integration.Tests/Endpoints/AuthEndpointTests.cs'
test_case: 'RegisterComponent_ShouldReturn_Ok'
endpoint: 'POST /api/Auth/registerComponent/{tenantId}'
given: 'Valid tenant with master authentication token'
when: 'Component registration request submitted'
then: 'Returns OK with encrypted RemoteAccessToken for tenant isolation'
coverage: e2e_integration
auth_pattern: 'Bearer token with tenant context'
multi_tenant: true
# SUPPLEMENTAL: Validation scenarios
- test_file: 'Integration.Tests/Endpoints/AuthEndpointTests.cs'
test_case: 'RegisterComponent_ShouldValidateRequest'
test_attribute: '[Theory] with [InlineData] scenarios'
given: 'Invalid tenant ID or missing parameters'
when: 'Component registration attempted'
then: 'Returns appropriate error messages and status codes'
coverage: e2e_validation
scenarios_tested: ['invalid_tenant', 'validation_errors']
requirement: 'AC2: Multi-tenant data isolation enforced'
test_mappings:
# PRIMARY: Complete tenant lifecycle validation
- test_file: 'Integration.Tests/Endpoints/TenantEndpointTests.cs'
test_case: 'CreateAndDeleteNewTenant_ShouldReturn_Ok'
endpoint: 'POST /api/Tenant/createNewTenant, DELETE /api/Tenant/deleteTenant'
given: 'Master authentication and tenant creation request'
when: 'Complete tenant lifecycle executed (create, validate, delete)'
then: 'Tenant created with isolated database, license validated, clean deletion'
coverage: e2e_integration
workflow_validation: 'Complete tenant management workflow'
database_validation: 'Tenant-specific database connection verified'
license_validation: 'Tenant license status compliance checked'
Evaluate coverage for each requirement with emphasis on complete workflow validation:
Coverage Levels (Priority Order):
e2e_integration: Complete end-to-end workflow tested with full system integration (HIGHEST PRIORITY)e2e_validation: Edge cases and validation scenarios covered in integration testsintegration_with_unit: Integration tests backed by supporting unit testsintegration_only: Covered in integration tests but lacks unit test supportunit_only: Only unit tests exist - INSUFFICIENT for requirement validationnone: No test coverage found - CRITICAL GAPE2E Integration Test Patterns:
Document gaps with focus on missing end-to-end workflow validation:
e2e_coverage_gaps:
- requirement: 'AC3: Secret key lifecycle management'
gap: 'No complete workflow test from creation through update to deletion'
severity: high
current_coverage: 'unit_only'
missing_e2e_test:
type: e2e_integration
suggested_file: 'Integration.Tests/Endpoints/SecretKeysEndpointTests.cs'
workflow: 'CreateSecretKey -> UpdateSecretKey -> GetSecretKeyById -> DeleteSecretKey'
authentication: 'JWT Bearer token validation throughout lifecycle'
database_validation: 'Verify persistence and state transitions'
- requirement: 'AC4: Multi-tenant data isolation under concurrent access'
gap: 'No concurrent multi-tenant access validation'
severity: critical
current_coverage: 'integration_only'
missing_e2e_test:
type: e2e_integration
suggested_file: 'Integration.Tests/Infrastructure/Services/MultiTenantConcurrencyTests.cs'
workflow: 'Simultaneous tenant operations with isolation verification'
auth_pattern: 'Multiple tenant tokens in parallel requests'
database_validation: 'Verify no cross-tenant data leakage'
- requirement: 'AC5: Host registration with remote access validation'
gap: 'Missing end-to-end host lifecycle with actual remote connectivity'
severity: medium
current_coverage: 'e2e_validation'
missing_e2e_test:
type: e2e_integration
enhancement: 'Extend HostEndpointTests to include connectivity validation'
workflow: 'RegisterRemoteHost -> ValidateConnection -> DeregisterHost'
Generate for pasting into gate file under trace:
trace:
totals:
requirements: X
e2e_integration: Y # PRIMARY: Complete workflow validation
e2e_validation: Z # Validation scenarios covered
integration_with_unit: A # Integration + unit test coverage
integration_only: B # Integration tests without unit support
unit_only: C # INSUFFICIENT: Unit tests only
none: W # CRITICAL: No coverage
e2e_priority: 'Integration tests are source of truth for requirement validation'
planning_ref: 'qa.qaLocation/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md'
critical_gaps:
- ac: 'AC4'
gap: 'Missing concurrent multi-tenant validation'
severity: 'critical'
test_type: 'e2e_integration'
workflow_coverage:
- endpoint_to_test_mapping: 'verified'
- authentication_flows: 'validated'
- multi_tenant_isolation: 'tested'
- database_integration: 'verified'
notes: 'See qa.qaLocation/assessments/{epic}.{story}-trace-{YYYYMMDD}.md'
Save to: qa.qaLocation/assessments/{epic}.{story}-trace-{YYYYMMDD}.md
Create an E2E integration-focused traceability report with:
# E2E Integration Requirements Traceability Matrix
## Story: {epic}.{story} - {title}
### E2E Integration Coverage Summary
- Total Requirements: X
- **E2E Integration Validated**: Y (Z%) - PRIMARY COVERAGE
- **E2E Validation Scenarios**: A (B%) - Edge case coverage
- **Integration with Unit Support**: C (D%) - Comprehensive coverage
- **Integration Only**: E (F%) - Adequate but missing unit support
- **Unit Only**: G (H%) - INSUFFICIENT for requirement validation
- **Not Covered**: I (J%) - CRITICAL GAPS
### E2E Integration Test Mappings
#### AC1: {Acceptance Criterion 1}
**Coverage: E2E_INTEGRATION** ✅
E2E Integration Tests (Source of Truth):
- **Endpoint Test**: `Integration.Tests/Endpoints/AuthEndpointTests.cs::RegisterComponent_ShouldReturn_Ok`
- **Endpoint**: `POST /api/Auth/registerComponent/{tenantId}`
- **Given**: Valid tenant with master authentication token
- **When**: Component registration API called with tenant context
- **Then**: Returns HTTP 200 with encrypted RemoteAccessToken, validates tenant isolation
- **Authentication**: Bearer token with master privileges
- **Multi-tenant**: Validates tenant-specific token generation
- **Database**: Verifies tenant context in database operations
- **Validation Test**: `Integration.Tests/Endpoints/AuthEndpointTests.cs::RegisterComponent_ShouldValidateRequest`
- **Test Pattern**: [Theory] with [InlineData] for multiple scenarios
- **Given**: Invalid tenant IDs and malformed requests
- **When**: Registration attempted with invalid data
- **Then**: Returns appropriate HTTP error codes and descriptive error messages
- **Scenarios**: Invalid tenant, missing parameters, validation failures
#### AC2: {Acceptance Criterion 2}
**Coverage: E2E_INTEGRATION** ✅
E2E Integration Tests:
- **Complete Workflow**: `Integration.Tests/Endpoints/TenantEndpointTests.cs::CreateAndDeleteNewTenant_ShouldReturn_Ok`
- **Endpoints**: `POST /api/Tenant/createNewTenant`, `DELETE /api/Tenant/deleteTenant`
- **Given**: Master authentication and tenant creation parameters
- **When**: Complete tenant lifecycle executed (create → validate → delete)
- **Then**: Tenant created with isolated database, license verified, clean deletion confirmed
- **Database Integration**: Validates tenant-specific database connection
- **License Validation**: Confirms tenant license compliance
- **Multi-tenant**: Ensures proper tenant isolation throughout lifecycle
[Continue for all ACs...]
### Critical E2E Integration Gaps
1. **Multi-Tenant Concurrency Requirements**
- **Gap**: No concurrent multi-tenant access validation in integration tests
- **Risk**: Critical - Data isolation could fail under concurrent load
- **Current Coverage**: Integration tests exist but lack concurrency validation
- **Required E2E Test**: `Integration.Tests/Infrastructure/Services/MultiTenantConcurrencyTests.cs`
- **Workflow**: Simultaneous tenant operations with cross-tenant isolation verification
- **Authentication**: Multiple tenant tokens in parallel requests
2. **Complete Workflow Validation**
- **Gap**: Secret key lifecycle not fully tested end-to-end
- **Risk**: High - Partial workflow failures not caught
- **Current Coverage**: Individual endpoint tests exist but not linked workflows
- **Required E2E Test**: Extend `Integration.Tests/Endpoints/SecretKeysEndpointTests.cs`
- **Workflow**: Create → Update → Retrieve → Delete with authentication throughout
3. **Cross-Service Integration**
- **Gap**: Service-to-service communication not validated in integration tests
- **Risk**: Medium - Integration points could fail silently
- **Required E2E Test**: Service interaction workflows with database and external services
### E2E Integration Test Design Recommendations
Based on E2E gaps identified, prioritize:
1. **Complete Workflow Coverage**: Test entire user journeys, not just individual endpoints
2. **Multi-Tenant Validation**: Every test should validate tenant isolation where applicable
3. **Authentication Flow Integration**: Include authentication context in all relevant tests
4. **Database Transaction Validation**: Verify data persistence and consistency
5. **Error Scenario Integration**: Test complete error handling workflows
6. **Performance Integration**: Basic performance validation within integration tests
### Risk Assessment (E2E Integration Focus)
- **Critical Risk**: Requirements with no E2E integration coverage (unit_only or none)
- **High Risk**: Requirements with integration tests but missing complete workflow validation
- **Medium Risk**: Requirements with E2E integration but missing edge case validation
- **Low Risk**: Requirements with comprehensive E2E integration plus supporting unit tests
Endpoint-to-Test Mapping:
Integration.Tests/Endpoints/{FeatureArea}EndpointTests.cs{Operation}_{ExpectedResult} (e.g., CreateTenant_ShouldReturn_Ok)Authentication Flow Integration:
Complete Workflow Testing:
Database Integration Validation:
Use Given-When-Then to document complete E2E workflow validation:
Given: The complete system context and authentication setup
When: The complete workflow or API interaction
Then: Complete system response and state validation
Note: This documents E2E integration validation, not test code implementation.
Prioritize E2E integration coverage based on:
Map requirements with E2E integration as primary validation:
Good E2E integration traceability shows:
Critical issues to watch for:
E2E integration traceability feeds into quality gates with strict standards:
Print this line for review task to quote:
E2E Integration Trace Matrix: qa.qaLocation/assessments/{epic}.{story}-trace-{YYYYMMDD}.md