Automatic Generation of Test Cases based on Bug Reports: a Feasibility Study with Large Language Models
Not on the map. Why?
Abstract (arXiv)
Software testing is a core discipline in software engineering where a large array of research results has been produced, notably in the area of automatic test generation. Because existing approaches produce test cases that either can be qualified as simple (e.g. unit tests) or that require precise specifications, most testing procedures still rely on test cases written by humans to form test suites. Such test suites, however, are incomplete: they only cover parts of the project or they are produced after the bug is fixed. Yet, several research challenges, such as automatic program repair, and practitioner processes, build on the assumption that available test suites are sufficient. There is thus a need to break existing barriers in automatic test case generation. While prior work largely focused on random unit testing inputs, we propose to consider generating test cases that realistically represent complex user execution scenarios, which reveal buggy behaviour. Such scenarios are informally described in bug reports, which should therefore be considered as natural inputs for specifying bug-triggering test cases. In this work, we investigate the feasibility of performing this generation by leveraging large language models (LLMs) and using bug reports as inputs. Our experiments include the use of ChatGPT, as an online service, as well as CodeGPT, a code-related pre-trained LLM that was fine-tuned for our task. Overall, we experimentally show that bug reports associated to up to 50% of Defects4J bugs can prompt ChatGPT to generate an executable test case. We show that even new bug reports can indeed be used as input for generating executable test cases. Finally, we report experimental results which confirm that LLM-generated test cases are immediately useful in software engineering tasks such as fault localization as well as patch validation in automated program repair.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). First posted on arXiv 10 Oct 2023.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 1; 2025: 5; 2026: 2.
8 papers.
- 2025Otter: Generating Tests from Issues to Validate SWE Patchescited by 24
- 2025Generative AI for Self-Adaptive Systems: State of the Art and Research Roadmapcited by 5
- 2026AnyPoC: Universal Proof-of-Concept Test Generation for Scalable LLM-Based Bug Detectioncited by 4
- 2026SWE-Doctor: Guiding Software Engineering Agents with Runtime Diagnosis from Multi-Faceted Bug Reproduction Testscited by 4
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropycited by 3
- 2025STAF: Leveraging LLMs for Automated Attack Tree-Based Security Test Generationcited by 2
- 2025A Systematic Approach for Assessing Large Language Models' Test Case Generation Capabilitycited by 1
- 2025A Blueprint for AI-Driven Software Quality: Integrating LLMs with Established Standardscited by 1
- 2026SWE-Doctor: Guiding Software Engineering Agents with Runtime Diagnosis from Multi-Faceted Bug Reproduction Tests1 Jul 2026
- 2026AnyPoC: Universal Proof-of-Concept Test Generation for Scalable LLM-Based Bug Detection13 Apr 2026
- 2025Generative AI for Self-Adaptive Systems: State of the Art and Research Roadmap4 Dec 2025
- 2025STAF: Leveraging LLMs for Automated Attack Tree-Based Security Test Generation24 Sep 2025
- 2025A Blueprint for AI-Driven Software Quality: Integrating LLMs with Established Standards19 May 2025
- 2025Otter: Generating Tests from Issues to Validate SWE Patches7 Feb 2025
- 2025A Systematic Approach for Assessing Large Language Models' Test Case Generation Capability5 Feb 2025
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropy13 Nov 2024