Work

Design och utvärdering av en AI-agent baserad på hämtningsförstärkt generering för dynamiskt urval av tester i stora kodbaser

Year: 2026
Type: dissertation
Abstract: The recent advancements of Large Language Models (LLMs) have led to their widespread adoption in software engineering. These models have shown noteworthy proficiency in tasks such as code generation and bug detection due to their ability to understand code structure and capture natural language (NL) context. Building upon these capabilities, Artificial Intelligence (AI) agents leverage LLMs as core reasoning modules, enhancing them with information retrieval and iterative reasoning to autonomously execute complex, multi-stage software engineering workflows. However, empirical research on employing AI agents to manage these intricate processes within the software development life cycle (SDLC), specifically to reduce total lead times, remains nascent. In large organisations, the verification process represents one of the critical factors that dictate lead times. Efficient verification requires rapidly validating core user-facing features through carefully selected, minimised, and prioritised test scopes. Manually maintaining test scopes in large repositories demands constant upkeep. Additionally, these scopes frequently become outdated, degrading feature coverage, which refers to the proportion of user-facing functionality verified during testing in review and staging pipelines. Conversely, executing full test suites for every codebase modification introduces significant delays in the feedback cycle. Test scope optimisation is especially challenging in interface-driven testing frameworks, where explicit traceability between test cases and the underlying source code is missing. To address this challenge, this thesis introduces the Dynamic Test Selection (DTS) AI agent, an artefact designed to mitigate the verification bottleneck and feature coverage decay associated with manually maintained test scopes. By eliminating the burden of manual maintenance, the agent is designed to dynamically preserve high feature coverage within large repositories through the creation of directory-specific test scopes. Ultimately, the research goal of this thesis is to evaluate the utility of using such an AI agent to reduce the total lead time. Adopting Design Science Research (DSR), the study developed a two-stage architecture comprising a data processing pipeline and a structured, multi-stage agent workflow utilising Retrieval-Augmented Generation (RAG). The agent’s performance was evaluated using a mixed-methods approach, quantifying its ability to autonomously generate directory-specific test scopes. The study was conducted in a real-world setting at Ericsson Finland in a very large repository. The DTS AI agent was evaluated by generating test scopes for the repository’s main frontend and backend directories. The empirical results demonstrate that the AI-generated test scopes surpass legacy methodologies, achieving an approximate 60 percentage point increase in feature coverage compared to their legacy counterparts across the targeted directories. The AI-generated test scopes reached a peak feature coverage of 95.24% for the frontend directory and 80.00% for the backend directory, while maintaining the minimalism required for efficient Continuous Integration/Continuous Delivery (CI/CD) pipelines. The study identified performance variances, evidenced by F1-scores ranging from 95.82% to 75.39% for the selected directories. While the variances were attributed to the semantic alignment of software components, the agent exhibited bounded stochasticity and high operational reliability. The qualitative findings emphasised the necessity of a human-in-the-loop within AI-based workflows in critical CI/CD environments, as expert reviews refined the agent’s output by removing flaky or obsolete test cases that the agent could not detect. From an economic perspective, the agent proved operationally viable with negligible token costs and acceptable execution latencies given the low task-frequency of test scope modification. Although the generalisability of the findings is constrained by specific codebase architectures and the inherent stochasticity and prompt sensitivity of LLMs, this study establishes a foundation for future research. Future research should focus on refining retrieval accuracy by investigating methods to bridge semantic gaps in abstract code, generalising agents across diverse codebases, and optimising human-agent feedback loops. In conclusion, this research establishes that deploying an AI agent for dynamic test selection represents a viable approach to alleviating manual maintenance burdens and reducing the lead time from commit to delivery in modern software engineering environments.
Institution: Aalto University
Language: English
Subfield: Software
Open Access status: green
OpenAlex ID: W7204015957
Cites: 85
Cited by:
Related to: 10