Pith. sign in

REVIEW 17 cited by

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

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2305.04207 v3 pith:FFL425NI submitted 2023-05-07 cs.SE

classification cs.SE
keywords testschatgpttestunitgeneratedgenerationchattestercorrectness
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

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.

Discussion (0). Sign in to comment.

Forward citations

Cited by 17 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. LogicHunter: Testing LLM Agent Frameworks with an Agentic Oracle

    cs.SE 2026-07 conditional novelty 7.0 of 10

    LogicHunter combines specification-driven test generation with a ReAct-based agentic oracle to discover 40 previously unknown bugs in LangChain, LlamaIndex, and CrewAI, achieving 91.17% oracle precision.

  2. Uncovering Business Logic Bugs via Semantics-Driven Unit Test Generation

    cs.SE 2026-04 conditional novelty 7.0 of 10

    SeGa extracts business semantics from requirements to generate unit tests that detect 22-25 more real-world business logic bugs than prior LLM-based methods in industrial Go projects.

  3. SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolution

    cs.SE 2025-02 unverdicted novelty 7.0 of 10

    SWE-RL uses RL on software evolution data to train LLMs achieving 41% on SWE-bench Verified with generalization to other reasoning tasks.

  4. SCATE: Learning to Supervise Coding Agents for Cost-Effective Test Generation

    cs.SE 2026-07 conditional novelty 6.5 of 10

    A contextual-bandit supervisor learns to route coding agents among default generation, analysis-augmented generation, and stop, yielding large coverage gains over unsupervised agents and non-agentic LLM test generators.

  5. From Business Requirements to Test Assertions: Evaluating LLM-Generated Oracles on Real Bugs

    cs.SE 2026-07 conditional novelty 6.0 of 10

    LLMs generate partially generalizable test oracles from business requirements alone on 10 real bugs, aligning better with the requirement-derived gold standard than with the actual system under test.

  6. Humanizing Automatically Generated Unit Test Suites with LLM-Based Refactoring

    cs.SE 2026-06 unverdicted novelty 6.0 of 10

    TestHumanizer uses LLMs as refactoring layers on EvoSuite suites to reach 88-98% compilation rates and better readability on 350 classes from Defects4J and SF110 while preserving coverage.

  7. Humanizing Automatically Generated Unit Test Suites with LLM-Based Refactoring

    cs.SE 2026-06 unverdicted novelty 6.0 of 10

    TestHumanizer uses LLMs as controlled refactoring layers on EvoSuite suites to boost readability and maintainability, achieving 88-98% compilation rates and developer preference gains on 350 classes from Defects4J and SF110.

  8. Uncovering Business Logic Bugs via Semantics-Driven Unit Test Generation

    cs.SE 2026-04 conditional novelty 6.0 of 10

    SeGa detects 29 of 60 real business-logic bugs by generating tests from requirement-document scenarios, 22-25 more than four LLM-based baselines.

  9. Co-Located Tests, Better AI Code: How Test Syntax Structure Affects Foundation Model Code Generation

    cs.SE 2026-04 unverdicted novelty 6.0 of 10

    Co-locating tests with implementation code yields substantially higher preservation and correctness in foundation-model-generated programs than separated test syntax.

  10. MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic Testing

    cs.SE 2024-08 unverdicted novelty 6.0 of 10

    MR-Adopt deduces input transformations from hard-coded MR test cases using LLMs, data-flow refinement, and output-relation selection to enable reuse with new source inputs.

  11. LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code

    cs.SE 2024-03 unverdicted novelty 6.0 of 10

    LiveCodeBench collects 400 recent contest problems to create a contamination-free benchmark evaluating LLMs on code generation and related capabilities like self-repair and execution.

  12. PR-Aware Automated Unit Test Generation: Challenges and Opportunities

    cs.SE 2026-05 unverdicted novelty 5.0 of 10

    EvoSuite produced at least one fail-to-pass test for 36% of PRs versus 13% for GPT-4o, but both tools generated no meaningful change-capturing tests for 64% of the PRs evaluated.

  13. Seed&Steer: Guiding Large Language Models with Compilable Prefix and Branch Signals for Unit Test Generation

    cs.SE 2025-07 conditional novelty 5.0 of 10

    Combining EvoSuite invocation examples with branch-intent prompts lets LLMs generate Java unit tests that compile more often and cover more branches.

  14. Impact of Code Context and Prompting Strategies on Automated Unit Test Generation with Modern General-Purpose Large Language Models

    cs.SE 2025-07 conditional novelty 5.0 of 10

    On a custom Python shopping-cart benchmark, docstrings substantially improve LLM-generated unit tests, full implementations add little, and chain-of-thought prompting yields the highest branch and mutation scores.

  15. Resource-Efficient Automatic Software Vulnerability Assessment via Knowledge Distillation and Particle Swarm Optimization

    cs.LG 2025-07 conditional novelty 4.0 of 10

    A PSO-guided knowledge distillation framework compresses a CodeBERT vulnerability assessor to 0.6% of its original size while retaining 89.3% of its accuracy.

  16. Enhancing Large Language Models with Retrieval Augmented Generation for Software Testing and Inspection Automation

    cs.SE 2026-04 unverdicted novelty 3.0 of 10

    RAG-enhanced LLMs show generally positive effects on automated test generation and code inspection by supplying supplementary context that reduces hallucinations.

  17. LLM-Based Agentic Systems for Software Engineering: Challenges and Opportunities

    cs.SE 2026-01 unverdicted novelty 2.0 of 10

    A survey of LLM-based multi-agent systems across the software development life cycle, plus a research agenda for orchestration, human coordination, cost, and data.

Pith tools