TestBench: Evaluating Class-Level Test Case Generation Capability of Large Language Models
Not on the map. Why?
Abstract (arXiv)
Software testing is a crucial phase in the software life cycle, helping identify potential risks and reduce maintenance costs. With the advancement of Large Language Models (LLMs), researchers have proposed an increasing number of LLM-based software testing techniques, particularly in the area of test case generation. Despite the growing interest, limited efforts have been made to thoroughly evaluate the actual capabilities of LLMs in this task. In this paper, we introduce TestBench, a benchmark for class-level LLM-based test case generation. We construct a dataset of 108 Java programs from 9 real-world, large-scale projects on GitHub, each representing a different thematic domain. We then design three distinct types of prompts based on context descriptions, including self-contained context, full context, and simple context. Besides, we propose a fine-grained evaluation framework that considers five aspects of test cases: syntactic correctness, compilation correctness, test correctness, code coverage rate, and defect detection rate. Furthermore, we propose a heuristic algorithm to repair erroneous test cases generated by LLMs. We evaluate CodeLlama-13b, GPT-3.5, and GPT-4 on the TestBench, and our experimental results indicate that larger models demonstrate a greater ability to effectively utilize contextual information, thus generating higher-quality test cases. Smaller models may struggle with the noise introduced by the extensive information contained within the full context. However, when using the simplified version, namely the simple context, which is derived from the full context via abstract syntax tree analysis, the performance of these models improves significantly. Our analysis highlights the current progress and pinpoints future directions to further enhance the effectiveness of models by handling contextual information for test case generation.
Key facts. Cited by 15 papers in the map (data through 7 Oct 2026). First posted on arXiv 26 Sep 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 8; 2026: 7.
15 papers.
Sort:
By area:
- 2025HardTests: Synthesizing High-Quality Test Cases for LLM Codingcited by 22
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
- 2026DevOps-Gym: Benchmarking AI Agents in Software DevOps Cyclecited by 9
- 2025Scoring Verifiers: Evaluating Synthetic Verification for Code and Reasoningcited by 8
- 2025Benchmarking LLMs for Unit Test Generation from Real-World Functionscited by 8
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Qualitycited by 3
- 2025Improving Retrieval-Augmented Deep Assertion Generation via Joint Trainingcited by 2
- 2026RM -RF: Reward Model for Run-Free Unit Test Evaluationcited by 2
- 2025LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Frameworkcited by 1
- 2025SAGE:Specification-Aware Grammar Extraction for Automated Test Case Generation with LLMscited by 0
- 2026TAM-Eval: Evaluating LLMs for Automated Unit Test Maintenancecited by 0
- 2026ATTest: Agent-Driven Tensor Testing for Deep Learning Library Modulescited by 0
3 more
- 2026PPO guided Agentic Pipeline for Adaptive Prompt Selection and Test Case Generationcited by 0
- 2026FeedbackLLM: Metadata driven Multi-Agentic Language Agnostic Test Case Generator with Evolving prompt and Coverage Feedbackcited by 0
- 2026Can LLMs Fix It Without Code? Toward Automated Verification of No-Code Bug Fixescited by 0
- 2026Can LLMs Fix It Without Code? Toward Automated Verification of No-Code Bug Fixes8 Oct 2026
- 2026FeedbackLLM: Metadata driven Multi-Agentic Language Agnostic Test Case Generator with Evolving prompt and Coverage Feedback2 May 2026
- 2026PPO guided Agentic Pipeline for Adaptive Prompt Selection and Test Case Generation1 May 2026
- 2026ATTest: Agent-Driven Tensor Testing for Deep Learning Library Modules15 Feb 2026
- 2026DevOps-Gym: Benchmarking AI Agents in Software DevOps Cycle27 Jan 2026
- 2026TAM-Eval: Evaluating LLMs for Automated Unit Test Maintenance26 Jan 2026
- 2026RM -RF: Reward Model for Run-Free Unit Test Evaluation19 Jan 2026
- 2025LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Framework25 Nov 2025
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025Benchmarking LLMs for Unit Test Generation from Real-World Functions1 Aug 2025
- 2025SAGE:Specification-Aware Grammar Extraction for Automated Test Case Generation with LLMs4 Jun 2025
- 2025HardTests: Synthesizing High-Quality Test Cases for LLM Coding30 May 2025
3 more
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Quality7 Mar 2025
- 2025Scoring Verifiers: Evaluating Synthetic Verification for Code and Reasoning19 Feb 2025
- 2025Improving Retrieval-Augmented Deep Assertion Generation via Joint Training15 Feb 2025
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
- 2026ATTest: Agent-Driven Tensor Testing for Deep Learning Library Modulescited by 0
- 2026PPO guided Agentic Pipeline for Adaptive Prompt Selection and Test Case Generationcited by 0
- 2026FeedbackLLM: Metadata driven Multi-Agentic Language Agnostic Test Case Generator with Evolving prompt and Coverage Feedbackcited by 0
- 2026FeedbackLLM: Metadata driven Multi-Agentic Language Agnostic Test Case Generator with Evolving prompt and Coverage Feedback2 May 2026
- 2026PPO guided Agentic Pipeline for Adaptive Prompt Selection and Test Case Generation1 May 2026
- 2026ATTest: Agent-Driven Tensor Testing for Deep Learning Library Modules15 Feb 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2026DevOps-Gym: Benchmarking AI Agents in Software DevOps Cyclecited by 9
- 2025Benchmarking LLMs for Unit Test Generation from Real-World Functionscited by 8
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Qualitycited by 3
- 2026RM -RF: Reward Model for Run-Free Unit Test Evaluationcited by 2
- 2025LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Frameworkcited by 1
- 2025SAGE:Specification-Aware Grammar Extraction for Automated Test Case Generation with LLMscited by 0
- 2026TAM-Eval: Evaluating LLMs for Automated Unit Test Maintenancecited by 0
- 2026Can LLMs Fix It Without Code? Toward Automated Verification of No-Code Bug Fixescited by 0
- 2026Can LLMs Fix It Without Code? Toward Automated Verification of No-Code Bug Fixes8 Oct 2026
- 2026DevOps-Gym: Benchmarking AI Agents in Software DevOps Cycle27 Jan 2026
- 2026TAM-Eval: Evaluating LLMs for Automated Unit Test Maintenance26 Jan 2026
- 2026RM -RF: Reward Model for Run-Free Unit Test Evaluation19 Jan 2026
- 2025LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Framework25 Nov 2025
- 2025Benchmarking LLMs for Unit Test Generation from Real-World Functions1 Aug 2025
- 2025SAGE:Specification-Aware Grammar Extraction for Automated Test Case Generation with LLMs4 Jun 2025
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Quality7 Mar 2025