mlsanityData to 14 Oct 2026

No More Manual Tests? Evaluating and Improving ChatGPT for Unit Test Generation

arXiv 2305.04207 ↗First posted 7 May 2023cs.SEcited by 82

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

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 15; 2024: 26; 2025: 29; 2026: 12.

82 papers.

Sort:

By area:

  1. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
  2. 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
  3. 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 387
  4. 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 263
  5. 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 256
  6. 2024Large Language Model-Based Agents for Software Engineering: A Surveycited by 178
  7. 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 107
  8. 2023Fuzz4All: Universal Fuzzing with Large Language Modelscited by 88
  9. 2024Code-Aware Prompting: A study of Coverage Guided Test Generation in Regression Setting using LLMcited by 64
  10. 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
  11. 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
  12. 2025Co-Evolving LLM Coder and Unit Tester via Reinforcement Learningcited by 56
38 more
  1. 2023Emotionally Numb or Empathetic? Evaluating How LLMs Feel Using EmotionBenchcited by 54
  2. 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 53
  3. 2023CodeScope: An Execution-based Multilingual Multitask Multidimensional Benchmark for Evaluating LLMs on Code Understanding and Generationcited by 39
  4. 2024SOEN-101: Code Generation by Emulating Software Process Models Using Large Language Model Agentscited by 34
  5. 2024LMUnit: Fine-grained Evaluation with Natural Language Unit Testscited by 33
  6. 2024The Future of AI-Driven Software Engineeringcited by 23
  7. 2025HardTests: Synthesizing High-Quality Test Cases for LLM Codingcited by 23
  8. 2025Agentic Bug Reproduction for Effective Automated Program Repair at Googlecited by 22
  9. 2023Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generationcited by 21
  10. 2023KernelGPT: Enhanced Kernel Fuzzing via Large Language Modelscited by 17
  11. 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 15
  12. 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
  13. 2023Unit Test Generation using Generative AI : A Comparative Performance Analysis of Autogeneration Toolscited by 13
  14. 2025Propose, Solve, Verify: Self-Play Through Formal Verificationcited by 13
  15. 2025Metamorphic Testing of Large Language Models for Natural Language Processingcited by 12
  16. 2023The potential of LLMs for coding with low-resource and domain-specific programming languagescited by 11
  17. 2024LLMs: A Game-Changer for Software Engineers?cited by 11
  18. 2025A Contemporary Survey of Large Language Model Assisted Program Analysiscited by 11
  19. 2024RepoMasterEval: Evaluating Code Completion via Real-World Repositoriescited by 10
  20. 2024B4: Towards Optimal Assessment of Plausible Code Solutions with Plausible Testscited by 9
  21. 2024NaviQAte: Functionality-Guided Web Application Navigationcited by 9
  22. 2025PromptPex: Automatic Test Generation for Language Model Promptscited by 9
  23. 2024A System for Automated Unit Test Generation Using Large Language Models and Assessment of Generated Test Suitescited by 8
  24. 2024Beyond the Safety Bundle: Auditing the Helpful and Harmless Datasetcited by 8
  25. 2025Automating a Complete Software Test Process Using LLMs: An Automotive Case Studycited by 8
  26. 2026LLM-Based Agentic Systems for Software Engineering: Challenges and Opportunitiescited by 8
  27. 2023Domain Adaptation for Code Model-based Unit Test Case Generationcited by 7
  28. 2023Assessing Evaluation Metrics for Neural Test Oracle Generationcited by 7
  29. 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Languagecited by 7
  30. 2025Combining Large Language Models with Static Analyzers for Code Review Generationcited by 6
  31. 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generationcited by 6
  32. 2024exLong: Generating Exceptional Behavior Tests with Large Language Modelscited by 4
  33. 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropycited by 4
  34. 2025LogiCase: Effective Test Case Generation from Logical Description in Competitive Programmingcited by 4
  35. 2025SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflowscited by 4
  36. 2023Prompting Code Interpreter to Write Better Unit Tests on Quixbugs Functionscited by 3
  37. 2024Harnessing the Power of LLMs: Automating Unit Test Generation for High-Performance Computingcited by 3
  38. 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)