Multi-Agent AI System for Automated Test Case Generation in Payment Systems

amazon_amet_payments · Finance · 2026 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Payment-system QA and test-case generation

Amazon AMET Payments needed to automate comprehensive test-case generation for payment features across diverse countries and regulatory environments without losing the specificity, risk awareness, and institutional knowledge of experienced QA engineers.

Constraints:

Architecture

SAARAM is a multi-agent QA lifecycle app built with Amazon Bedrock, Claude Sonnet, and Strands Agents. The final workflow routes multiple input types through a file-type decision agent, parallel data-extraction subagents, a visualizer that creates multiple Mermaid diagrams, a data condenser that preserves acceptance criteria and edge cases while reducing context, and a test generator pipeline that produces, reformats, deduplicates, and organizes structured test suites. Pydantic schemas validate LLM outputs, while Strands workflow orchestration handles dependencies, parallel execution, retries, state persistence, and audit logging.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  Inputs["Documentation and Design Inputs"] --> Router["File Type Decision Agent"]
  Router --> Extractor["Data Extractor Agent"]
  Router --> Visualizer["Visualizer Agent"]
  Extractor --> Visualizer
  Extractor --> Condenser["Data Condenser Agent"]
  Visualizer --> Condenser
  Condenser --> Generator["Test Generator Agent"]
  Bedrock["Amazon Bedrock Claude Sonnet"] --> Extractor
  Bedrock --> Visualizer
  Bedrock --> Condenser
  Bedrock --> Generator
  Workflow["Strands Agents Workflow"] --> Router
  Workflow --> Extractor
  Workflow --> Visualizer
  Workflow --> Condenser
  Workflow --> Generator
  Generator --> Validation["Structured Output Validation"]
  Validation --> Output["Test Management Output"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Documentation and Design Inputs Business requirements, UI mocks, Figma designs, code repositories, and other product artifacts used to generate payment test cases. File Type Decision Agent
File Type Decision Agent Gateway and router that categorizes input types and sends them to the right downstream processing path. Documentation and Design Inputs, Data Extractor Agent, Visualizer Agent
Data Extractor Agent Parallel extraction layer with six domain-specific subagents for nuanced requirements and data extraction. File Type Decision Agent, Visualizer Agent, Data Condenser Agent, Amazon Bedrock Claude Sonnet
Visualizer Agent Transforms extracted information into multiple Mermaid diagram types for requirements, flows, data relationships, and feature hierarchies. File Type Decision Agent, Data Extractor Agent, Data Condenser Agent, Amazon Bedrock Claude Sonnet
Data Condenser Agent Synthesizes extracted text and diagrams into condensed addendums that preserve acceptance criteria, rules, segments, and edge cases. Data Extractor Agent, Visualizer Agent, Test Generator Agent, Amazon Bedrock Claude Sonnet
Test Generator Agent Pipeline of subagents for journey analysis, scenario identification, data-flow mapping, test-case development, and final suite organization. Data Condenser Agent, Structured Output Validation, Amazon Bedrock Claude Sonnet
Amazon Bedrock Claude Sonnet Managed foundation-model layer providing Claude Sonnet reasoning to agents through Bedrock. Data Extractor Agent, Visualizer Agent, Data Condenser Agent, Test Generator Agent
Strands Agents Workflow Workflow orchestration substrate providing task dependencies, parallel execution, retries, state persistence, and audit logging. File Type Decision Agent, Data Extractor Agent, Visualizer Agent, Data Condenser Agent, Test Generator Agent
Structured Output Validation Pydantic schema validation layer for type-safe, consistently formatted test-case outputs. Test Generator Agent, Test Management Output
Test Management Output Validated, deduplicated, organized test cases aligned with Amazon's internal standards and existing test-management systems. Structured Output Validation

Data flow

Business requirements, documentation files, Figma designs, and code repositories enter a file-type decision agent that routes inputs to downstream agents. A data extractor uses six specialized subagents to pull domain-specific requirements, a visualizer creates six Mermaid views, and a data condenser merges text and diagrams into context-preserving addendums. The test generator then uses journey analysis, scenario identification, data-flow mapping, test-case generation, and test-suite organization subagents to produce deduplicated test suites. Claude Sonnet runs through Amazon Bedrock and Strands Agents, with Pydantic structured-output validation before results enter existing test-management workflows.

4 supporting quotes
“Processing documentation files, Figma designs, and code repositories, it categorizes and directs data to appropriate downstream agents.”article, stated
“The Data Extractor agent employs six specialized subagents, each focused on specific extraction domains. This parallel processing approach facilitates thorough coverage”article, stated
“The agent extracts critical elements from the full text context—acceptance criteria, business rules, customer segments, and edge cases—creating structured summaries”article, stated
“With the test cases generated across three critical perspectives, the Test Cases Generator evaluates them, reformatting according to internal guidelines for consistency.”article, stated

Why this architecture

Amazon moved from a single-agent prompt to a workflow of specialized agents because experienced testers do not read requirements holistically; they move through phases such as acceptance criteria extraction, journey analysis, scenario identification, data-flow mapping, and prioritization. Strands workflow orchestration gave the team explicit dependencies and parallelism, which was better suited to consistent test generation than dynamic supervisor routing. Structured Pydantic outputs kept LLM results usable in production test-management systems.

4 supporting quotes
“Instead of asking, “How should AI think about testing?”, we asked, “How do experienced humans think about testing?” to focus on following a specific step-by-step process”article, stated
“We discovered that experienced testers don’t process documents holistically—they work through specialized mental phases.”article, stated
“workflows provide “agents on rails”—a structured path facilitating consistent, reproducible results.”article, stated
“By enforcing schemas through Pydantic validation, we make sure that responses conform to predefined structures, enabling seamless integration with existing test management systems.”article, stated

Models used: Claude Sonnet by Anthropic on Amazon Bedrock · Strands Agents SDK workflows

Scale

Alternatives considered (roads not taken)

Single AI agent fed with entire business requirement documents

Rejected because: It generated generic outputs, hit context-length limits, lacked specialized processing phases, and hallucinated irrelevant scenarios.

“feeding entire BRDs to a single AI agent for test case generation. This method frequently produced generic outputs like “verify payment works correctly””article, stated
“Context length restrictions prevented processing large documents effectively, but the lack of specialized processing phases meant the AI couldn’t understand testing priorities”article, stated

Custom-built looping, serial, parallel, orchestration, and workflow logic

Rejected because: Building the orchestration substrate manually demanded considerable effort, so the team migrated to Strands Agents SDK.

“We had to create our own looping, serial, or parallel execution. We also created our own orchestration and workflow graphs, which demanded considerable manual effort.”article, stated
“we migrated to Strands Agents SDK. This provided the multi-agent orchestration capabilities essential for coordinating complex, interdependent tasks”article, stated

Supervisor-agent style dynamic routing for test generation

Rejected because: For a consistency-sensitive testing workflow, explicit workflow and graph patterns were more reproducible than dynamic routing.

“Although supervisor agents make dynamic routing decisions that can introduce variability, workflows provide “agents on rails”—a structured path facilitating consistent, reproducible results.”article, stated

Broad first-iteration agent set limited to Word documents and basic journey/segment parsing

Rejected because: The first design had context isolation, irrelevant data generation, narrow parsing, single-source input, and rigid architecture limitations.

"we identified five crucial limitations in our initial approach:

“Single-source input constraint – The workflow could only process Word documents, creating a significant bottleneck.”article, stated

Patterns

multi-agent-orchestration (architecture)

SAARAM decomposes QA analysis and test generation into specialized agents and subagents for routing, extraction, visualization, condensation, and test-suite generation.

“The architecture employs a sophisticated multi-agent workflow. To achieve this, we went through 3 different iterations and continue to improve”article, stated
“Each agent focuses on a specific aspect of the testing process, such as how human experts mentally compartmentalize different analysis phases.”article, stated

context-engineering (architecture)

A dedicated Data Condenser agent preserves acceptance criteria, business rules, customer segments, and edge cases while reducing token load for downstream agents.

“The agent extracts critical elements from the full text context—acceptance criteria, business rules, customer segments, and edge cases—creating structured summaries”article, stated
“This synthesis makes sure that when information moves to test generation, it arrives complete, structured, and optimized for processing.”article, stated

structured-output-validation (quality)

Pydantic schemas validate generated test-case objects before they propagate into test-management workflows.

“Pydantic automatically validates LLM responses against defined schemas to facilitate type correctness and required field presence.”article, stated
“When responses don’t match the expected structure, validation errors provide clear feedback about what needs correction”article, stated

durable-execution (operations)

The Strands workflow uses explicit dependencies, retries, state persistence, and audit logging for long-running test-generation workflows.

“Automatic retry mechanisms handled transient failures gracefully, state persistence enabled pause and resume capabilities for long-running workflows”article, stated
“comprehensive audit logging supported both debugging and performance optimization efforts.”article, stated

human-in-the-loop-gate (safety)

SAARAM reduces generation effort but still leaves QA engineers validating outputs, making the system an augmentation of expert testing rather than an unattended replacement.

“These QA tools aren’t intended to replace human testers, they amplify their expertise through intelligent automation.”article, stated
“Resource optimization: QA effort decreased from 1.0 full-time employee (FTE) to 0.2 FTE for validation”article, stated

eval-driven-development (quality)

The team built the workflow iteratively, tested each decomposed step with Amazon Q Developer CLI, and uses standards adherence and edge-case coverage as quality signals.

“We built and tested each step using Amazon Q Developer for CLI to make sure basic ideas were sound”article, stated
“Consistency: 100% adherence to test case standards and formats”article, stated

rag-retrieval (architecture)

A planned Bedrock Knowledge Bases integration would retrieve comparable historical test cases to ground future generation.

“integrating Amazon Bedrock Knowledge Bases with a curated repository of historical test cases would provide SAARAM with concrete, real-world examples”article, stated

Tradeoffs

Mirror human QA cognition instead of asking a single model to infer the testing process.

Chose Specialized sequential agents based on expert tester phases over A single BRD-to-test-case agent.

Rationale: The human-centric decomposition produced more specific, risk-aware, actionable test cases than holistic document prompting.

“Instead of asking, “How should AI think about testing?”, we asked, “How do experienced humans think about testing?””article, stated
“We discovered that experienced testers don’t process documents holistically—they work through specialized mental phases.”article, stated

Use Strands workflow orchestration rather than homegrown workflow logic.

Chose Strands Agents SDK workflow orchestration over Custom looping, serial, parallel, orchestration, and workflow graphs.

Rationale: The SDK supplied multi-agent coordination, clear execution paths, better performance, and less development effort.

“We had to create our own looping, serial, or parallel execution. We also created our own orchestration and workflow graphs, which demanded considerable manual effort.”article, stated
“This provided the multi-agent orchestration capabilities essential for coordinating complex, interdependent tasks while maintaining clear execution paths”article, stated

Prefer workflow/graph patterns over supervisor-style dynamic routing for test generation.

Chose Explicit workflow dependencies and parallel execution over Supervisor agents making dynamic routing decisions.

Rationale: Test generation needs reproducibility and consistency more than maximum runtime flexibility.

“For test generation where consistency is paramount, the workflow pattern with its explicit task dependencies and parallel execution capabilities delivered the optimal balance”article, stated

Keep human validation while automating generation.

Chose Human-amplifying QA automation with 0.2 FTE validation effort over Replacing QA testers with unattended generation.

Rationale: The system codifies expert patterns and reduces repetitive work while preserving human accountability for high-stakes payment QA.

“These QA tools aren’t intended to replace human testers, they amplify their expertise through intelligent automation.”article, stated
“Resource optimization: QA effort decreased from 1.0 full-time employee (FTE) to 0.2 FTE for validation”article, stated

Gotchas (what bit them)

Single-agent document prompting produced generic, unusable test cases.

Root cause: The model compressed complex payment business logic without the phased reasoning process used by experienced testers.

Resolution: The team studied QA cognition and decomposed testing into specialized sequential thinking actions and agents.

“This method frequently produced generic outputs like “verify payment works correctly” instead of the specific, actionable test cases our QA team requires.”article, stated
“The root cause was clear: AI attempted to compress complex business logic without the iterative thinking process that experienced testers employ”article, stated

Segregated first-iteration agents created hallucinations and irrelevant data.

Root cause: Agents independently collected data and built visual representations with limited context sharing.

Resolution: Iteration 2 introduced modular routing, context-aware extraction, visualization, and a condenser that preserves key context for downstream generation.

“individual agents independently collected data and created visual representations. This isolation led to limited contextual understanding, resulting in reduced accuracy and increased hallucinations”article, stated

The first workflow could not ingest the full range of artifacts used in modern QA work.

Root cause: It was constrained to Word documents and narrow parsing for customer segments, journey mapping, and basic requirements.

Resolution: The second workflow accepts documentation files, Figma designs, code repositories, product requirements, UX specifications, acceptance criteria, and workstream extraction.

“Single-source input constraint – The workflow could only process Word documents, creating a significant bottleneck.”article, stated
“it processes product requirements, UX specifications, acceptance criteria, and workstream extraction while accepting inputs from Figma designs, code repositories, and multiple document types.”article, stated

Unstructured LLM text could not be trusted as production test-management data.

Root cause: LLMs can produce human-like prose while failing to consistently follow required data formats.

Resolution: The system uses Pydantic models and validation errors to enforce typed, required fields and prevent malformed data propagation.

“although LLMs excel at producing humanlike text, they can struggle with consistently formatted outputs needed for production systems.”article, stated
“When responses don’t match the expected structure, validation errors provide clear feedback about what needs correction, helping prevent malformed data from propagating”article, stated

SAARAM still lacks examples of what high-quality test cases look like in practice.

Root cause: The current generation pipeline does not yet retrieve comparable historical test cases as examples before generating new ones.

Resolution: The team plans to add Bedrock Knowledge Bases backed by curated historical test cases.

“one critical gap remains: the system hasn’t yet been provided with examples of what high-quality test cases actually look like in practice.”article, stated
“SAARAM would first query the knowledge base for comparable test cases—whether for similar payment methods, customer segments, or transaction flows”article, stated

Evaluation

Amazon reports before/after operational metrics for generation time, QA effort, edge-case coverage, and standards adherence, plus reliability controls such as Pydantic validation, retries, state persistence, and audit logging.

Metrics: Test case generation reduced from one week to hours. · QA effort reduced from 1.0 FTE to 0.2 FTE for validation. · 40% more edge cases identified compared to manual process. · 100% adherence to test case standards and formats.

4 supporting quotes
“Test case generation time: Potential reduced from 1 week to hours”article, stated
“Resource optimization: QA effort decreased from 1.0 full-time employee (FTE) to 0.2 FTE for validation”article, stated
“Coverage improvement: 40% more edge cases identified compared to manual process”article, stated
“Consistency: 100% adherence to test case standards and formats”article, stated

Outcomes

The system supports Amazon AMET Payments across five countries, about 10 million monthly customers, and an average of five new features per month.

“we serve approximately 10 million customers monthly across five countries in the Middle East and North Africa region”article, stated
“By reducing test case creation from 1 week to hours while improving quality and coverage, we’ve enabled faster feature deployment”article, stated
“built a scalable solution now positioned for expansion across the AMET QA team and later across other QA teams in International Emerging Stores and Payments (IESP) Org.”article, stated