No More Manual Tests? Evaluating and Improving ChatGPT for Unit Test Generation
Not on the map. Why?
Abstract (arXiv)
Unit testing is essential in detecting bugs in functionally-discrete program units. Manually writing high-quality unit tests is time-consuming and laborious. Although traditional techniques can generate tests with reasonable coverage, they exhibit low readability and cannot be directly adopted by developers. Recent work has shown the large potential of large language models (LLMs) in unit test generation, which can generate more human-like and meaningful test code. ChatGPT, the latest LLM incorporating instruction tuning and reinforcement learning, has performed well in various domains. However, It remains unclear how effective ChatGPT is in unit test generation. In this work, we perform the first empirical study to evaluate ChatGPT's capability of unit test generation. Specifically, we conduct a quantitative analysis and a user study to systematically investigate the quality of its generated tests regarding the correctness, sufficiency, readability, and usability. The tests generated by ChatGPT still suffer from correctness issues, including diverse compilation errors and execution failures. Still, the passing tests generated by ChatGPT resemble manually-written tests by achieving comparable coverage, readability, and even sometimes developers' preference. Our findings indicate that generating unit tests with ChatGPT could be very promising if the correctness of its generated tests could be further improved. Inspired by our findings above, we propose ChatTESTER, a novel ChatGPT-based unit test generation approach, which leverages ChatGPT itself to improve the quality of its generated tests. ChatTESTER incorporates an initial test generator and an iterative test refiner. Our evaluation demonstrates the effectiveness of ChatTESTER by generating 34.3% more compilable tests and 18.7% more tests with correct assertions than the default ChatGPT.
Key facts. Cited by 82 papers in the map (data through 14 Oct 2026). First posted on arXiv 7 May 2023.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 15; 2024: 26; 2025: 29; 2026: 12.
82 papers.
Sort:
By area:
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 387
- 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 263
- 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 256
- 2024Large Language Model-Based Agents for Software Engineering: A Surveycited by 178
- 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 107
- 2023Fuzz4All: Universal Fuzzing with Large Language Modelscited by 88
- 2024Code-Aware Prompting: A study of Coverage Guided Test Generation in Regression Setting using LLMcited by 64
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
- 2025Co-Evolving LLM Coder and Unit Tester via Reinforcement Learningcited by 56
38 more
- 2023Emotionally Numb or Empathetic? Evaluating How LLMs Feel Using EmotionBenchcited by 54
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 53
- 2023CodeScope: An Execution-based Multilingual Multitask Multidimensional Benchmark for Evaluating LLMs on Code Understanding and Generationcited by 39
- 2024SOEN-101: Code Generation by Emulating Software Process Models Using Large Language Model Agentscited by 34
- 2024LMUnit: Fine-grained Evaluation with Natural Language Unit Testscited by 33
- 2024The Future of AI-Driven Software Engineeringcited by 23
- 2025HardTests: Synthesizing High-Quality Test Cases for LLM Codingcited by 23
- 2025Agentic Bug Reproduction for Effective Automated Program Repair at Googlecited by 22
- 2023Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generationcited by 21
- 2023KernelGPT: Enhanced Kernel Fuzzing via Large Language Modelscited by 17
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 15
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2023Unit Test Generation using Generative AI : A Comparative Performance Analysis of Autogeneration Toolscited by 13
- 2025Propose, Solve, Verify: Self-Play Through Formal Verificationcited by 13
- 2025Metamorphic Testing of Large Language Models for Natural Language Processingcited by 12
- 2023The potential of LLMs for coding with low-resource and domain-specific programming languagescited by 11
- 2024LLMs: A Game-Changer for Software Engineers?cited by 11
- 2025A Contemporary Survey of Large Language Model Assisted Program Analysiscited by 11
- 2024RepoMasterEval: Evaluating Code Completion via Real-World Repositoriescited by 10
- 2024B4: Towards Optimal Assessment of Plausible Code Solutions with Plausible Testscited by 9
- 2024NaviQAte: Functionality-Guided Web Application Navigationcited by 9
- 2025PromptPex: Automatic Test Generation for Language Model Promptscited by 9
- 2024A System for Automated Unit Test Generation Using Large Language Models and Assessment of Generated Test Suitescited by 8
- 2024Beyond the Safety Bundle: Auditing the Helpful and Harmless Datasetcited by 8
- 2025Automating a Complete Software Test Process Using LLMs: An Automotive Case Studycited by 8
- 2026LLM-Based Agentic Systems for Software Engineering: Challenges and Opportunitiescited by 8
- 2023Domain Adaptation for Code Model-based Unit Test Case Generationcited by 7
- 2023Assessing Evaluation Metrics for Neural Test Oracle Generationcited by 7
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Languagecited by 7
- 2025Combining Large Language Models with Static Analyzers for Code Review Generationcited by 6
- 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generationcited by 6
- 2024exLong: Generating Exceptional Behavior Tests with Large Language Modelscited by 4
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropycited by 4
- 2025LogiCase: Effective Test Case Generation from Logical Description in Competitive Programmingcited by 4
- 2025SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflowscited by 4
- 2023Prompting Code Interpreter to Write Better Unit Tests on Quixbugs Functionscited by 3
- 2024Harnessing the Power of LLMs: Automating Unit Test Generation for High-Performance Computingcited by 3
- 2024Parameter-Efficient Fine-Tuning of Large Language Models for Unit Test Generation: An Empirical Studycited by 3
50 most cited of 82 All 82 (JSON)
- 2026VibeCheck: Assessing the Quality of LLM-Generated Unit Tests: A Multi-agent Empirical Study across Heterogeneous Repositories5 Sep 2026
- 2026Ockhamareto: Pareto-Gated Segment-Level Credit Assignment for Concise Unit-Test Generation with Reinforcement Learning25 Aug 2026
- 2026SCATE: Learning to Supervise Coding Agents for Cost-Effective Test Generation9 Jul 2026
- 2026LogicHunter: Testing LLM Agent Frameworks with an Agentic Oracle7 Jul 2026
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code6 May 2026
- 2026Co-Located Tests, Better AI Code: How Test Syntax Structure Affects Foundation Model Code Generation20 Apr 2026
- 2026Enhancing Large Language Models with Retrieval Augmented Generation for Software Testing and Inspection Automation16 Apr 2026
- 2026Enhancing LLM-Based Test Generation by Eliminating Covered Code25 Feb 2026
- 2026SPARC: Scenario Planning and Reasoning for Automated C Unit Test Generation18 Feb 2026
- 2026LLM-Based Agentic Systems for Software Engineering: Challenges and Opportunities14 Jan 2026
- 2026ShortCoder: Knowledge-Augmented Syntax Optimization for Token-Efficient Code Generation14 Jan 2026
- 2026Understanding LLM-Driven Test Oracle Generation9 Jan 2026
38 more
- 2025Propose, Solve, Verify: Self-Play Through Formal Verification20 Dec 2025
- 2025DUET: Agentic Design Understanding via Experimentation and Testing6 Dec 2025
- 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
- 2025Metamorphic Testing of Large Language Models for Natural Language Processing3 Nov 2025
- 2025HarnessLLM: Automatic Testing Harness Generation via Reinforcement Learning2 Nov 2025
- 2025Lifecycle-Aware code generation: Leveraging Software Engineering Phases in LLMs28 Oct 2025
- 2025TREAT: A Code LLMs Trustworthiness / Reliability Evaluation and Testing Framework20 Oct 2025
- 2025Clarifying Semantics of In-Context Examples for Unit Test Generation2 Oct 2025
- 2025BuildBench: Benchmarking LLM Agents on Compiling Real-World Open-Source Software27 Sep 2025
- 2025Experimental Analysis of Productive Interaction Strategy with ChatGPT: User Study on Function and Project-level Code Generation Tasks6 Aug 2025
- 2025OptiHive: Ensemble Selection for LLM-Based Optimization via Statistical Modeling4 Aug 2025
- 2025Impact of Code Context and Prompting Strategies on Automated Unit Test Generation with Modern General-Purpose Large Language Models18 Jul 2025
- 2025SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflows8 Jun 2025
- 2025Co-Evolving LLM Coder and Unit Tester via Reinforcement Learning3 Jun 2025
- 2025HardTests: Synthesizing High-Quality Test Cases for LLM Coding30 May 2025
- 2025A Tool for Generating Exceptional Behavior Tests With Large Language Models28 May 2025
- 2025Leveraging Large Language Models for Command Injection Vulnerability Analysis in Python: An Empirical Study on Popular Open-Source Projects21 May 2025
- 2025LogiCase: Effective Test Case Generation from Logical Description in Competitive Programming21 May 2025
- 2025PRIMG : Efficient LLM-driven Test Generation Using Mutant Prioritization8 May 2025
- 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generation18 Apr 2025
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Language25 Mar 2025
- 2025PromptPex: Automatic Test Generation for Language Model Prompts7 Mar 2025
- 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolution25 Feb 2025
- 2025Combining Large Language Models with Static Analyzers for Code Review Generation10 Feb 2025
- 2025Automating a Complete Software Test Process Using LLMs: An Automotive Case Study6 Feb 2025
- 2025A Contemporary Survey of Large Language Model Assisted Program Analysis5 Feb 2025
- 2025A Systematic Approach for Assessing Large Language Models' Test Case Generation Capability5 Feb 2025
- 2025Agentic Bug Reproduction for Effective Automated Program Repair at Google3 Feb 2025
- 2024Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generation18 Dec 2024
- 2024LMUnit: Fine-grained Evaluation with Natural Language Unit Tests17 Dec 2024
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropy13 Nov 2024
- 2024Beyond the Safety Bundle: Auditing the Helpful and Harmless Dataset12 Nov 2024
- 2024Parameter-Efficient Fine-Tuning of Large Language Models for Unit Test Generation: An Empirical Study4 Nov 2024
- 2024LLMs: A Game-Changer for Software Engineers?1 Nov 2024
- 2024On the Effectiveness of LLMs for Manual Test Verifications19 Sep 2024
- 2024NaviQAte: Functionality-Guided Web Application Navigation16 Sep 2024
- 2024B4: Towards Optimal Assessment of Plausible Code Solutions with Plausible Tests13 Sep 2024
50 newest of 82 All 82 (JSON)
- 2024Large Language Model-Based Agents for Software Engineering: A Surveycited by 178
- 2024SOEN-101: Code Generation by Emulating Software Process Models Using Large Language Model Agentscited by 34
- 2025Agentic Bug Reproduction for Effective Automated Program Repair at Googlecited by 22
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2026LLM-Based Agentic Systems for Software Engineering: Challenges and Opportunitiescited by 8
- 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generationcited by 6
- 2025SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflowscited by 4
- 2024Identifying Performance-Sensitive Configurations in Software Systems through Code Analysis with LLM Agentscited by 2
- 2025BuildBench: Benchmarking LLM Agents on Compiling Real-World Open-Source Softwarecited by 2
- 2026LogicHunter: Testing LLM Agent Frameworks with an Agentic Oraclecited by 2
- 2026SCATE: Learning to Supervise Coding Agents for Cost-Effective Test Generationcited by 1
- 2025DUET: Agentic Design Understanding via Experimentation and Testingcited by 0
12 most cited of 13 All 13 (JSON)
- 2026VibeCheck: Assessing the Quality of LLM-Generated Unit Tests: A Multi-agent Empirical Study across Heterogeneous Repositories5 Sep 2026
- 2026SCATE: Learning to Supervise Coding Agents for Cost-Effective Test Generation9 Jul 2026
- 2026LogicHunter: Testing LLM Agent Frameworks with an Agentic Oracle7 Jul 2026
- 2026LLM-Based Agentic Systems for Software Engineering: Challenges and Opportunities14 Jan 2026
- 2025DUET: Agentic Design Understanding via Experimentation and Testing6 Dec 2025
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025BuildBench: Benchmarking LLM Agents on Compiling Real-World Open-Source Software27 Sep 2025
- 2025SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflows8 Jun 2025
- 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generation18 Apr 2025
- 2025Agentic Bug Reproduction for Effective Automated Program Repair at Google3 Feb 2025
- 2024Large Language Model-Based Agents for Software Engineering: A Survey4 Sep 2024
- 2024Identifying Performance-Sensitive Configurations in Software Systems through Code Analysis with LLM Agents18 Jun 2024
12 newest of 13 All 13 (JSON)
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
- 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 263
- 2025HardTests: Synthesizing High-Quality Test Cases for LLM Codingcited by 23
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Languagecited by 7
- 2026Ockhamareto: Pareto-Gated Segment-Level Credit Assignment for Concise Unit-Test Generation with Reinforcement Learningcited by 1
- 2026SPARC: Scenario Planning and Reasoning for Automated C Unit Test Generationcited by 0
- 2026Ockhamareto: Pareto-Gated Segment-Level Credit Assignment for Concise Unit-Test Generation with Reinforcement Learning25 Aug 2026
- 2026SPARC: Scenario Planning and Reasoning for Automated C Unit Test Generation18 Feb 2026
- 2025HardTests: Synthesizing High-Quality Test Cases for LLM Coding30 May 2025
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Language25 Mar 2025
- 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolution25 Feb 2025
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code12 Mar 2024
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 387
- 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 256
- 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 107
- 2023Fuzz4All: Universal Fuzzing with Large Language Modelscited by 88
- 2024Code-Aware Prompting: A study of Coverage Guided Test Generation in Regression Setting using LLMcited by 64
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
- 2025Co-Evolving LLM Coder and Unit Tester via Reinforcement Learningcited by 56
- 2023Emotionally Numb or Empathetic? Evaluating How LLMs Feel Using EmotionBenchcited by 54
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 53
- 2023CodeScope: An Execution-based Multilingual Multitask Multidimensional Benchmark for Evaluating LLMs on Code Understanding and Generationcited by 39
12 most cited of 57 All 57 (JSON)
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code6 May 2026
- 2026Co-Located Tests, Better AI Code: How Test Syntax Structure Affects Foundation Model Code Generation20 Apr 2026
- 2026Enhancing LLM-Based Test Generation by Eliminating Covered Code25 Feb 2026
- 2026Understanding LLM-Driven Test Oracle Generation9 Jan 2026
- 2025LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Framework25 Nov 2025
- 2025Metamorphic Testing of Large Language Models for Natural Language Processing3 Nov 2025
- 2025Lifecycle-Aware code generation: Leveraging Software Engineering Phases in LLMs28 Oct 2025
- 2025TREAT: A Code LLMs Trustworthiness / Reliability Evaluation and Testing Framework20 Oct 2025
- 2025Clarifying Semantics of In-Context Examples for Unit Test Generation2 Oct 2025
- 2025Experimental Analysis of Productive Interaction Strategy with ChatGPT: User Study on Function and Project-level Code Generation Tasks6 Aug 2025
- 2025OptiHive: Ensemble Selection for LLM-Based Optimization via Statistical Modeling4 Aug 2025
- 2025Impact of Code Context and Prompting Strategies on Automated Unit Test Generation with Modern General-Purpose Large Language Models18 Jul 2025
12 newest of 57 All 57 (JSON)