A Systematic Approach for Assessing Large Language Models’ Test Case Generation Capability
Open Access
Abstract
Software testing ensures the quality and reliability of software products, but manual test case creation is labor-intensive. With the rise of Large Language Models (LLMs), there is growing interest in unit test creation with LLMs. However, effective assessment of LLM-generated test cases is limited by the lack of standardized benchmarks that comprehensively cover diverse programming scenarios. To address the assessment of an LLM’s test case generation ability and lacking a dataset for evaluation, we propose the Generated Benchmark from Control-Flow Structure and Variable Usage Composition (GBCV) approach, which systematically generates programs used for evaluating LLMs’ test generation capabilities. By leveraging basic control-flow structures and variable usage, GBCV provides a flexible framework to create a spectrum of programs ranging from simple to complex. Because GPT-4o and GPT-3.5-Turbo are publicly accessible models, to present real-world regular users’ use cases, we use GBCV to assess LLM performance on them. Our findings indicate that GPT-4o performs better on composite program structures, while all models effectively detect boundary values in simple conditions but face challenges with arithmetic computations. This study highlights the strengths and limitations of LLMs in test generation, provides a benchmark framework, and suggests directions for future improvement.Keywords
All Related Versions
This publication has 39 references indexed in Scilit:
- Investigating the readability of test codeEmpirical Software Engineering, 2024
- An Empirical Evaluation of Using Large Language Models for Automated Unit Test GenerationIEEE Transactions on Software Engineering, 2023
- On introducing automatic test case generation in practice: A success story and lessons learnedJournal of Systems and Software, 2021
- Automatic Generation of Acceptance Test Cases From Use Case Specifications: An NLP-Based ApproachIEEE Transactions on Software Engineering, 2020
- An Industrial Evaluation of Unit Test Generation: Finding Real Faults in a Financial Application2017
- An orchestrated survey of methodologies for automated software test case generationJournal of Systems and Software, 2013
- Heap cloning: Enabling dynamic symbolic execution of java programs2011
- EvoSuite2011
- Evolutionary Generation of Whole Test Suites2011
- A new measure of software complexity based on cognitive weightsCanadian Journal of Electrical and Computer Engineering, 2003