Company
Adyen
Title
Augmented Unit Test Generation Using LLMs
Industry
Finance
Year
2024
Summary (short)
Adyen, a global payments platform company, explored the integration of large language models to enhance their code quality practices by automating and augmenting unit test generation. The company investigated how LLMs could assist developers in creating comprehensive test coverage more efficiently, addressing the challenge of maintaining high code quality standards while managing the time investment required for writing thorough unit tests. Through this venture, Adyen aimed to leverage AI capabilities to generate contextually appropriate test cases that could complement human-written tests, potentially accelerating development cycles while maintaining or improving test coverage and code reliability.
## Overview and Context Adyen, a global payments platform operating in the financial technology sector, embarked on an exploratory initiative to integrate large language models into their software development lifecycle, specifically focusing on augmented unit test generation. This case study, authored by Rok Popov Ledinski, a Software Engineer at Adyen and published in March 2024, represents an early-stage venture into applying generative AI capabilities to enhance code quality practices within a production-grade payments infrastructure environment. The fundamental challenge that Adyen sought to address through this initiative stems from a universal tension in software engineering: maintaining high code quality and comprehensive test coverage while managing the significant time investment required to write thorough unit tests. For a payments company like Adyen, where reliability, security, and correctness are paramount given the financial nature of their services, unit testing is not merely a best practice but a critical operational requirement. However, the manual effort required to create exhaustive test suites can become a bottleneck in development velocity, particularly as codebases grow in complexity and scale. ## The LLMOps Use Case: Test Generation as a Developer Assistance Tool Adyen's approach to this problem involved investigating how large language models could serve as intelligent assistants in the test generation process. Rather than attempting to fully automate test creation or replace human judgment entirely, the company appears to have pursued an "augmented" approach—hence the title's emphasis on "augmented" unit test generation. This framing suggests a collaborative model where LLMs complement developer expertise rather than substitute for it. The production context for this LLMOps implementation is particularly interesting because it sits at the intersection of developer tooling and code quality assurance. Unit test generation represents a specific, well-bounded problem space with clear inputs (source code, function signatures, existing patterns) and outputs (test cases), making it a relatively tractable application for LLM technology compared to more open-ended generative tasks. ## Technical Implementation Considerations While the provided source text is limited in its technical details (appearing to be primarily navigational content from Adyen's website rather than the full article), we can infer several important LLMOps considerations that would be relevant to this type of implementation: **Model Selection and Integration**: Implementing LLM-based test generation would require careful consideration of which model architecture to use. Options would include leveraging existing code-specialized models (such as Codex, Code Llama, or similar models trained on code repositories), fine-tuning general-purpose LLMs on Adyen's specific codebase patterns, or using prompt engineering with off-the-shelf models. Each approach carries different tradeoffs in terms of accuracy, customization potential, operational complexity, and cost. **Context Window Management**: Effective test generation requires providing the LLM with sufficient context about the code being tested, including the function or method signature, its implementation details, related dependencies, existing test patterns within the codebase, and potentially even documentation or comments. Managing this context within typical LLM token limits while ensuring relevant information is included would be a critical technical challenge. This might involve implementing retrieval mechanisms to identify the most relevant context or developing strategies for context compression. **Prompt Engineering Strategy**: The quality of generated tests would heavily depend on the prompts used to instruct the LLM. Effective prompt design would need to specify the desired testing framework, coding style conventions, coverage expectations (edge cases, error conditions, happy paths), assertion patterns, and any domain-specific requirements relevant to payment processing logic. Adyen's engineers would need to develop and iteratively refine these prompts based on the quality of generated outputs. **Quality Assurance and Validation**: A critical LLMOps consideration for this use case is how to validate the quality of generated tests. Unlike some generative AI applications where output quality can be subjectively assessed, unit tests have measurable quality criteria: Do they compile? Do they run successfully? Do they actually test the intended behavior? Do they catch real bugs? Would they fail if the implementation were incorrect? Adyen would need to implement automated validation pipelines to assess these dimensions, potentially including static analysis of generated test code, execution verification, mutation testing to ensure tests actually detect faults, and human review processes for samples of generated tests. ## Integration into Development Workflows For this LLMOps initiative to deliver value in production, it must integrate smoothly into Adyen's existing development workflows. This raises several operational questions: **Developer Experience Design**: How would developers interact with the LLM-powered test generation capability? Options might include IDE plugins that suggest tests as code is written, command-line tools invoked during development, automated PR augmentation that generates tests for new code, or interactive refinement interfaces where developers can iteratively improve generated tests. The user experience design would significantly impact adoption and effectiveness. **Feedback Loops and Continuous Improvement**: An important LLMOps consideration is establishing mechanisms for the system to improve over time. This could involve collecting feedback from developers on generated test quality (explicit ratings, acceptance/rejection signals), monitoring which generated tests are modified versus kept as-is, tracking whether generated tests catch bugs in production, and using this data to refine prompts or fine-tune models. **Code Review Integration**: In a quality-conscious organization like Adyen, generated tests would presumably still undergo code review. This raises interesting questions about review processes: Should reviewers know which tests were AI-generated versus human-written? What review standards should apply? How can reviewers efficiently assess the adequacy of generated test coverage? ## Domain-Specific Challenges in Payments Adyen's position as a payments platform introduces domain-specific complexities that make this LLMOps application particularly challenging: **Financial Correctness Requirements**: Payment processing logic involves precise financial calculations, currency conversions, transaction state management, and regulatory compliance requirements. Tests for such code must be exhaustive and exact. An LLM might struggle to generate tests that adequately cover subtle financial edge cases (rounding behaviors, currency precision, transaction atomicity) without substantial domain knowledge encoded in prompts or training data. **Security and Sensitive Data Handling**: Payments code often handles sensitive data (card numbers, personal information, authentication credentials). Generated tests must properly mock or anonymize such data and avoid introducing security vulnerabilities. This requires the LLM to understand security best practices and apply them consistently in generated test code. **Complex State Management**: Payment systems maintain complex transactional state across distributed systems. Effective unit tests need to properly set up initial state, execute operations, and verify resulting state transitions. Generating such tests requires understanding the system's state model and typical state transition scenarios. ## Evaluation and Metrics For Adyen to assess the success of this LLMOps initiative, they would need to establish appropriate metrics: **Coverage Metrics**: Does LLM-assisted test generation improve code coverage (line coverage, branch coverage, path coverage)? Are previously untested code paths now covered? **Developer Productivity**: Does test generation reduce the time developers spend writing tests? Does it allow them to focus on more complex or valuable testing scenarios? **Test Quality Metrics**: Do generated tests catch real bugs? What is the mutation score of generated versus human-written tests? How often do generated tests produce false positives or false negatives? **Adoption and Usage**: Are developers actually using the tool? What is the acceptance rate of generated tests? How much modification do generated tests require before being accepted? ## Balanced Assessment and Critical Considerations While Adyen's exploration of LLM-powered test generation is innovative and potentially valuable, several considerations warrant a balanced perspective: **Claims Verification**: The limited source text provided does not include specific results, metrics, or outcomes from Adyen's implementation. Without concrete data on test quality improvements, coverage increases, or developer time savings, it's important to view this as an exploratory initiative rather than a proven solution. The article title describes it as a "venture," suggesting experimental investigation rather than full production deployment. **Test Quality Concerns**: LLMs, despite their capabilities, can generate plausible-looking code that doesn't actually test what it appears to test. Generated tests might pass trivially, might not exercise edge cases, or might make incorrect assumptions about expected behavior. The risk of developers gaining false confidence from extensive but inadequate test suites is a genuine concern. **Maintenance Burden**: Generated tests still require maintenance as code evolves. If the generated tests are of inconsistent quality or don't follow consistent patterns, they might actually increase maintenance burden rather than reduce it. **Context Understanding Limitations**: LLMs lack true understanding of business logic and domain requirements. While they can pattern-match on syntactic structures and common testing patterns, they may miss critical business rules or domain-specific edge cases that a domain-expert developer would naturally consider. **Dependency on External Services**: If this implementation relies on external LLM APIs (such as OpenAI's offerings), it introduces dependencies on third-party services, potential latency in development workflows, data privacy considerations (sending code to external services), and ongoing cost considerations for API usage at scale. ## Infrastructure and Deployment Considerations From an LLMOps infrastructure perspective, Adyen would need to address several operational concerns: **Deployment Architecture**: Whether to use hosted API services, deploy models on-premise, or adopt a hybrid approach. For a security-conscious payments company, on-premise deployment might be preferred to avoid sending proprietary code to external services, but this would require infrastructure for model hosting, inference serving, and maintenance. **Latency Requirements**: Developer tools need to be responsive to maintain good user experience. If test generation takes too long, developers won't use it. This requires optimization of inference latency, possibly through model quantization, caching of common patterns, or asynchronous generation with notification mechanisms. **Scalability**: As the tool is adopted across Adyen's engineering organization, the infrastructure must scale to support concurrent usage by many developers. This requires appropriate provisioning of compute resources, load balancing, and potentially rate limiting or usage quotas. **Monitoring and Observability**: Production LLMOps requires monitoring of model performance, inference latency, error rates, token usage and costs, and quality metrics over time. Adyen would need to implement telemetry and dashboards to understand system behavior and identify degradation. ## Broader Implications for LLMOps Practices Adyen's initiative represents a category of LLMOps applications focused on developer productivity and code quality. This category has several characteristics worth noting: **Internal Tooling Focus**: The primary users are internal developers, which simplifies some deployment concerns (controlled user base, internal training and support possible) but still requires high quality given the impact on engineering productivity. **Measurable Impact**: Developer tooling applications often have clearer success metrics than customer-facing generative AI applications, making ROI assessment more straightforward. **Iterative Refinement Opportunity**: Internal tools can be deployed in phases, refined based on user feedback, and improved over time without the reputational risks of customer-facing failures. **Code as a Well-Structured Domain**: Code generation and analysis benefit from the highly structured nature of programming languages, making them more tractable for LLMs than completely open-ended generation tasks. ## Conclusion Adyen's exploration of LLM-powered unit test generation represents a thoughtful application of generative AI to a real operational challenge in software engineering. By framing the initiative as "augmented" rather than "automated" test generation, Adyen signals an appropriate understanding of LLM capabilities and limitations—recognizing that these tools are best positioned to assist human developers rather than replace human judgment in quality-critical tasks. The payments domain context makes this case study particularly interesting, as it demonstrates the application of LLMOps in a highly regulated, security-sensitive environment where correctness is paramount. The success of such an initiative would depend heavily on careful implementation of validation mechanisms, thoughtful integration into existing workflows, and realistic expectations about what LLMs can and cannot do in the testing domain. However, the limited detail in the available source material means we must view this primarily as an early-stage exploration rather than a mature production deployment with validated results. The true measure of this initiative's success would be found in metrics around test quality improvement, developer adoption, bug detection rates, and overall impact on code quality—data that would be revealed in the full article but is not present in the provided navigational content. For other organizations considering similar LLMOps initiatives, Adyen's venture offers valuable lessons about applying AI to developer tooling: start with well-bounded problems, design for human-AI collaboration rather than full automation, implement rigorous quality validation, and maintain realistic expectations about the technology's current capabilities while remaining open to its potential.

Start deploying reproducible AI workflows today

Enterprise-grade MLOps platform trusted by thousands of companies in production.