Challenges in Testing Large Language Model Based Software: A Faceted Taxonomy
Top Cited Papers
Open Access
- 3 April 2026
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (9) , 1-24
Abstract
Large Language Models (LLMs) and Multi-Agent LLMs (MALLMs) introduce non-determinism, unlike traditional or machine learning software, where models typically produce deterministic outputs for given inputs. LLM-based software requires new approaches to verifying correctness that account for variability within individual test cases, not just across different inputs. This paper presents a taxonomy for LLM test case design, informed by research literature and our experience. Each facet is exemplified, and we conduct an LLM-assisted analysis of six open-source testing frameworks, perform a sensitivity study of an agent-based system across different model configurations, and provide working examples contrasting atomic and aggregated test cases. We identify key variation points that impact test correctness and highlight open challenges that the research, industry, and open-source communities must address as LLMs become integral to software systems. Our taxonomy defines four facets of LLM test case design, addressing ambiguity in both inputs and outputs while establishing best practices. It distinguishes variability in goals, the system under test, and inputs, and introduces two key oracle types: atomic and aggregated. Our findings reveal that current tools treat test executions as isolated events, lack explicit aggregation mechanisms, and inadequately capture variability across model versions, configurations, and repeated runs. This highlights the need for viewing correctness as a distribution of outcomes rather than a binary property, requiring closer collaboration between academia and practitioners to establish mature, variability-aware testing methodologies.Keywords
All Related Versions
Funding Information
- Vetenskapsrådet (Grant No. 2020-05272)
This publication has 20 references indexed in Scilit:
- Evaluating Diverse Large Language Models for Automatic and General Bug ReproductionIEEE Transactions on Software Engineering, 2024
- ChatGPT can yield valuable responses in the context of orthopaedic trauma surgeryJournal of Experimental Orthopaedics, 2024
- A survey on large language model based autonomous agentsFrontiers of Computer Science, 2024
- Generating and detecting true ambiguity: a forgotten danger in DNN supervision testingEmpirical Software Engineering, 2023
- Towards Autonomous Testing Agents via Conversational Large Language Models2023
- Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction2023
- Testing machine learning based systems: a systematic mappingEmpirical Software Engineering, 2020
- On testing machine learning programsJournal of Systems and Software, 2020
- Taxonomies in software engineering: A Systematic mapping study and a revised taxonomy development methodInformation and Software Technology, 2017
- Specification patterns for probabilistic quality properties2008