Test Cases Generation

Test Case Generation Slice

This feature uses AI to automatically generate QA test cases based on defined system requirements. It operates completely decoupled from the database, performing pure business logic driven by Wolverine messages.

Architectural Components

1. TestCaseGenerationHandler

The entry point for the test case feature worker.

  • It consumes a TestCaseGenerationRequested event.
  • It pulls the TestCaseGenerationPayload from the S3 Claim-Check Store, which contains the parent requirements and source contexts.
  • It applies the project’s LLM presets to the IAIService.
  • It delegates the core prompt generation and result mapping to the TestCaseGenerationCore.
  • Finally, it persists the result to S3 and returns a TestCaseGenerationCompleted message.

2. TestCaseGenerationCore

The pure logic core that constructs test case scenarios.

  • Traceability Integration: Maps system requirements to corresponding test scenarios, guaranteeing coverage.
  • Prompt Rendering: Formats inputs into a clear structure so the AI can define Pre-conditions, Steps, and Expected Results.
  • State Transformation: Packages the generated test scenarios into Block Creates and Updates to be persisted by the API.

Generation Sequence

The following diagram illustrates how the Test Cases feature processes a request from the API.

sequenceDiagram
    participant API as API Apply/Prepare
    participant Broker as RabbitMQ
    participant S3 as Claim-Check Store
    participant Handler as TestCaseGenerationHandler
    participant Core as TestCaseGenerationCore
    participant AI as IAIService

    API->>S3: PutAsync(TestCaseGenerationPayload)
    API->>Broker: Publish TestCaseGenerationRequested
    Broker->>Handler: Consume Message
    Handler->>S3: GetAsync(PayloadKey)
    Handler->>Core: GenerateAsync(Payload, IAIService)
    
    Core->>AI: GenerateAsync(TestCase Prompts, Requirements)
    AI-->>Core: Structured Test Scenarios
    Core->>Core: Format into Block Updates
    
    Core-->>Handler: TestCaseGenerationResult
    Handler->>S3: PutAsync(TestCaseGenerationResult)
    Handler->>Broker: Publish TestCaseGenerationCompleted
    Broker->>API: Deliver Completed Event

Business Intent

The goal of the Test Cases Generation feature is to bridge the gap between requirements engineering and quality assurance. By feeding structured requirements into the AI alongside source code context, it generates strict, repeatable test procedures. This ensures high test coverage, automatically generates test IDs, and enforces traceability (Requirement ID Test Case ID) essential for rigorous compliance standards like DO-178C or ISO 26262.

0 items under this folder.