Large Language Models as Test Case Generators: Performance Evaluation and Enhancement
Not on the map. Why?
Abstract (arXiv)
Code generation with Large Language Models (LLMs) has been extensively studied and achieved remarkable progress. As a complementary aspect to code generation, test case generation is of crucial importance in ensuring the quality and reliability of code. However, using LLMs as test case generators has been much less explored. Current research along this line primarily focuses on enhancing code generation with assistance from test cases generated by LLMs, while the performance of LLMs in test case generation alone has not been comprehensively examined. To bridge this gap, we conduct extensive experiments to study how well LLMs can generate high-quality test cases. We find that as the problem difficulty increases, state-of-the-art LLMs struggle to generate correct test cases, largely due to their inherent limitations in computation and reasoning. To mitigate this issue, we further propose a multi-agent framework called TestChain that decouples the generation of test inputs and test outputs. Notably, TestChain uses a ReAct format conversation chain for LLMs to interact with a Python interpreter in order to provide more accurate test outputs. Our results indicate that TestChain outperforms the baseline by a large margin. Particularly, in terms of the accuracy of test cases, TestChain using GPT-4 as the backbone achieves a 13.84% improvement over the baseline on the LeetCode-hard dataset.
Key facts. Cited by 27 papers in the map (data through 7 Oct 2026). Builds on 17 of its 25 references that are in the map. First posted on arXiv 20 Apr 2024.
Builds on
17 of 25 references.
References · 17
- 2023GPT-4 Technical Reportcited by 18,132
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,201
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2021WebGPT: Browser-assisted question-answering with human feedbackcited by 1,722
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023StarCoder: may the source be with you!cited by 790
- 2022CodeT: Code Generation with Generated Testscited by 369
- 2023Mathematical Capabilities of ChatGPTcited by 263
- 2023Self-collaboration Code Generation via ChatGPTcited by 255
5 more
- 2023Evaluating the Logical Reasoning Ability of ChatGPT and GPT-4cited by 202
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
- 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
- 2022Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproductioncited by 110
- 2023Cost-Effective Hyperparameter Optimization for Large Language Model Generation Inferencecited by 40
Built on by
Citing papers per year: 2024: 4; 2025: 15; 2026: 8.
27 papers.
Sort:
By area:
- 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Futurecited by 85
- 2024CodeJudge-Eval: Can Large Language Models be Good Judges in Code Understanding?cited by 29
- 2025Don't Judge Code by Its Cover: Exploring Biases in LLM Judges for Code Evaluationcited by 18
- 2025CoCoEvo: Co-Evolution of Programs and Test Cases to Enhance Code Generationcited by 14
- 2025Rethinking Verification for LLM Code Generation: From Generation to Testingcited by 12
- 2024Measuring the Influence of Incorrect Code on Test Generationcited by 9
- 2025Scoring Verifiers: Evaluating Synthetic Verification for Code and Reasoningcited by 8
- 2025G-Sim: Generative Simulations with Large Language Models and Gradient-Free Calibrationcited by 8
- 2025Large Language Model Guided Self-Debugging Code Generationcited by 7
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Languagecited by 7
- 2025Can Language Models Falsify? Evaluating Algorithmic Reasoning with Counterexample Creationcited by 5
- 2026SEMAG: Self-Evolutionary Multi-Agent Code Generationcited by 5
15 more
- 2025Past, Present, and Future of Bug Tracking in the Generative AI Eracited by 4
- 2026Environment-Aware Code Generation: How far are We?cited by 4
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropycited by 3
- 2025PBEBench: A Multi-Step Programming by Examples Reasoning Benchmark inspired by Historical Linguisticscited by 2
- 2025QiMeng-MuPa: Mutual-Supervised Learning for Sequential-to-Parallel Code Translationcited by 2
- 2025Leveraging Generative AI for Enhancing Automated Assessment in Programming Education Contestscited by 1
- 2025Refining Critical Thinking in LLM Code Generation: A Faulty Premise-based Evaluation Frameworkcited by 1
- 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensuscited by 1
- 2026Two-Stage Reinforcement Learning for Sound and Adversarial Test Generation in Code LLMscited by 1
- 2025AutoTestForge: A Multidimensional Automated Testing Framework for Natural Language Processing Modelscited by 0
- 2025Unify and Triumph: Polyglot, Diverse, and Self-Consistent Generation of Unit Tests with LLMscited by 0
- 2026DuET: Dual Execution for Test Output Prediction with Generated Code and Pseudocodecited by 0
- 2026Enhancing Large Language Models with Retrieval Augmented Generation for Software Testing and Inspection Automationcited by 0
- 2026MineValiCoder: Reliable Code Generation with Test Case Quality Mining and Bipartite Graph-Based Mutual Validationcited by 0
- 2026Robust Code RL via Faulty-Code-Driven Test case Synthesis and Dense Reward Shapingcited by 0
- 2026Two-Stage Reinforcement Learning for Sound and Adversarial Test Generation in Code LLMs3 Sep 2026
- 2026Robust Code RL via Faulty-Code-Driven Test case Synthesis and Dense Reward Shaping25 Aug 2026
- 2026MineValiCoder: Reliable Code Generation with Test Case Quality Mining and Bipartite Graph-Based Mutual Validation24 Jul 2026
- 2026Enhancing Large Language Models with Retrieval Augmented Generation for Software Testing and Inspection Automation16 Apr 2026
- 2026DuET: Dual Execution for Test Output Prediction with Generated Code and Pseudocode13 Apr 2026
- 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensus31 Mar 2026
- 2026SEMAG: Self-Evolutionary Multi-Agent Code Generation16 Mar 2026
- 2026Environment-Aware Code Generation: How far are We?18 Jan 2026
- 2025Past, Present, and Future of Bug Tracking in the Generative AI Era9 Oct 2025
- 2025Refining Critical Thinking in LLM Code Generation: A Faulty Premise-based Evaluation Framework5 Aug 2025
- 2025Rethinking Verification for LLM Code Generation: From Generation to Testing9 Jul 2025
- 2025QiMeng-MuPa: Mutual-Supervised Learning for Sequential-to-Parallel Code Translation11 Jun 2025
15 more
- 2025G-Sim: Generative Simulations with Large Language Models and Gradient-Free Calibration10 Jun 2025
- 2025Leveraging Generative AI for Enhancing Automated Assessment in Programming Education Contests6 Jun 2025
- 2025PBEBench: A Multi-Step Programming by Examples Reasoning Benchmark inspired by Historical Linguistics29 May 2025
- 2025Don't Judge Code by Its Cover: Exploring Biases in LLM Judges for Code Evaluation22 May 2025
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Language25 Mar 2025
- 2025Unify and Triumph: Polyglot, Diverse, and Self-Consistent Generation of Unit Tests with LLMs20 Mar 2025
- 2025AutoTestForge: A Multidimensional Automated Testing Framework for Natural Language Processing Models7 Mar 2025
- 2025Can Language Models Falsify? Evaluating Algorithmic Reasoning with Counterexample Creation26 Feb 2025
- 2025Scoring Verifiers: Evaluating Synthetic Verification for Code and Reasoning19 Feb 2025
- 2025CoCoEvo: Co-Evolution of Programs and Test Cases to Enhance Code Generation15 Feb 2025
- 2025Large Language Model Guided Self-Debugging Code Generation5 Feb 2025
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropy13 Nov 2024
- 2024Measuring the Influence of Incorrect Code on Test Generation14 Sep 2024
- 2024CodeJudge-Eval: Can Large Language Models be Good Judges in Code Understanding?20 Aug 2024
- 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Future5 Aug 2024
- 2025Rethinking Verification for LLM Code Generation: From Generation to Testingcited by 12
- 2025Scoring Verifiers: Evaluating Synthetic Verification for Code and Reasoningcited by 8
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Languagecited by 7
- 2025Can Language Models Falsify? Evaluating Algorithmic Reasoning with Counterexample Creationcited by 5
- 2025PBEBench: A Multi-Step Programming by Examples Reasoning Benchmark inspired by Historical Linguisticscited by 2
- 2025Refining Critical Thinking in LLM Code Generation: A Faulty Premise-based Evaluation Frameworkcited by 1
- 2025Refining Critical Thinking in LLM Code Generation: A Faulty Premise-based Evaluation Framework5 Aug 2025
- 2025Rethinking Verification for LLM Code Generation: From Generation to Testing9 Jul 2025
- 2025PBEBench: A Multi-Step Programming by Examples Reasoning Benchmark inspired by Historical Linguistics29 May 2025
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Language25 Mar 2025
- 2025Can Language Models Falsify? Evaluating Algorithmic Reasoning with Counterexample Creation26 Feb 2025
- 2025Scoring Verifiers: Evaluating Synthetic Verification for Code and Reasoning19 Feb 2025
- 2024CodeJudge-Eval: Can Large Language Models be Good Judges in Code Understanding?cited by 29
- 2025Don't Judge Code by Its Cover: Exploring Biases in LLM Judges for Code Evaluationcited by 18
- 2025CoCoEvo: Co-Evolution of Programs and Test Cases to Enhance Code Generationcited by 14
- 2024Measuring the Influence of Incorrect Code on Test Generationcited by 9
- 2025G-Sim: Generative Simulations with Large Language Models and Gradient-Free Calibrationcited by 8
- 2025Large Language Model Guided Self-Debugging Code Generationcited by 7
- 2025Past, Present, and Future of Bug Tracking in the Generative AI Eracited by 4
- 2026Environment-Aware Code Generation: How far are We?cited by 4
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropycited by 3
- 2025QiMeng-MuPa: Mutual-Supervised Learning for Sequential-to-Parallel Code Translationcited by 2
- 2025Leveraging Generative AI for Enhancing Automated Assessment in Programming Education Contestscited by 1
- 2026Two-Stage Reinforcement Learning for Sound and Adversarial Test Generation in Code LLMscited by 1
12 most cited of 16 All 16 (JSON)
- 2026Two-Stage Reinforcement Learning for Sound and Adversarial Test Generation in Code LLMs3 Sep 2026
- 2026MineValiCoder: Reliable Code Generation with Test Case Quality Mining and Bipartite Graph-Based Mutual Validation24 Jul 2026
- 2026DuET: Dual Execution for Test Output Prediction with Generated Code and Pseudocode13 Apr 2026
- 2026Environment-Aware Code Generation: How far are We?18 Jan 2026
- 2025Past, Present, and Future of Bug Tracking in the Generative AI Era9 Oct 2025
- 2025QiMeng-MuPa: Mutual-Supervised Learning for Sequential-to-Parallel Code Translation11 Jun 2025
- 2025G-Sim: Generative Simulations with Large Language Models and Gradient-Free Calibration10 Jun 2025
- 2025Leveraging Generative AI for Enhancing Automated Assessment in Programming Education Contests6 Jun 2025
- 2025Don't Judge Code by Its Cover: Exploring Biases in LLM Judges for Code Evaluation22 May 2025
- 2025Unify and Triumph: Polyglot, Diverse, and Self-Consistent Generation of Unit Tests with LLMs20 Mar 2025
- 2025AutoTestForge: A Multidimensional Automated Testing Framework for Natural Language Processing Models7 Mar 2025
- 2025CoCoEvo: Co-Evolution of Programs and Test Cases to Enhance Code Generation15 Feb 2025
12 newest of 16 All 16 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2025Can LLMs Generate Reliable Test Case Generators? A Study on Competition-Level Programming Problems
- 2025Challenges in Testing Large Language Model Based Software: A Faceted Taxonomy
- 2024SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents
- 2025Towards Advancing Code Generation with Large Language Models: A Research Roadmap
- 2026Consistency Meets Verification: Enhancing Test Generation Quality in Large Language Models Without Ground-Truth Solutions
- 2025UTBoost: Rigorous Evaluation of Coding Agents on SWE-Bench
- 2026TDD-Agent: Test-Driven Reasoning for Code Generation
- 2026Test-Oriented Programming: rethinking coding for the GenAI era