pith. sign in

arxiv: 2406.18181 · v2 · pith:LGQ7COX5new · submitted 2024-06-26 · 💻 cs.SE

On the Evaluation of Large Language Models in Unit Test Generation

classification 💻 cs.SE
keywords llmsunitgenerationopen-sourcetestpromptingcapabilitiesevaluation
0
0 comments X
read the original abstract

Unit testing is an essential activity in software development for verifying the correctness of software components. However, manually writing unit tests is challenging and time-consuming. The emergence of Large Language Models (LLMs) offers a new direction for automating unit test generation. Existing research primarily focuses on closed-source LLMs (e.g., ChatGPT and CodeX) with fixed prompting strategies, leaving the capabilities of advanced open-source LLMs with various prompting settings unexplored. Particularly, open-source LLMs offer advantages in data privacy protection and have demonstrated superior performance in some tasks. Moreover, effective prompting is crucial for maximizing LLMs' capabilities. In this paper, we conduct the first empirical study to fill this gap, based on 17 Java projects, five widely-used open-source LLMs with different structures and parameter sizes, and comprehensive evaluation metrics. Our findings highlight the significant influence of various prompt factors, show the performance of open-source LLMs compared to the commercial GPT-4 and the traditional Evosuite, and identify limitations in LLM-based unit test generation. We then derive a series of implications from our study to guide future research and practical use of LLM-based unit test generation.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 8 Pith papers

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

  1. Beyond the Library: An Agentic Framework for Autoformalizing Research Mathematics

    cs.AI 2026-06 conditional novelty 7.0

    Agentic LLM framework autoformalizes 32 Putnam problems and main theorems plus proofs from five STOC papers into Lean 4, with two proofs using only kernel axioms.

  2. Beyond the Library: An Agentic Framework for Autoformalizing Research Mathematics

    cs.AI 2026-06 accept novelty 7.0

    An orchestrator-driven agentic pipeline using general coding LLMs autoformalizes 32 PutnamBench problems and the main theorems plus proofs from five STOC papers into Lean 4, with two proofs using only the kernel.

  3. Large Language Models for Multi-Lingual Equivalent Mutant Detection: An Extended Empirical Study

    cs.SE 2026-07 unverdicted novelty 6.0

    LLM-based methods achieve higher F1-scores than traditional approaches for equivalent mutant detection in Java and C, with fine-tuned code embeddings performing best and showing cross-lingual generalization.

  4. Library-Aware Doubles and Iterative Repair for Large Language Model-Generated Unit Tests in OpenSIL Firmware

    cs.SE 2026-06 unverdicted novelty 6.0

    LLM workflow with library-aware doubles and iterative compile-repair produces compilable unit tests for 73 of 76 OpenSIL functions and reaches 98.8% line coverage on a guided subset.

  5. Similar Pattern Annotation via Retrieval Knowledge for LLM-Based Test Code Fault Localization

    cs.SE 2026-05 unverdicted novelty 6.0

    SPARK improves LLM-based test code fault localization by retrieving similar past faults and selectively annotating suspicious lines in new failing tests.

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

    cs.SE 2026-05 unverdicted novelty 5.0

    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.

  7. Augmenting unit test suites from integration tests

    cs.SE 2026-04 unverdicted novelty 5.0

    A static-plus-dynamic analysis technique extracts isolated unit tests from integration tests to improve test suite structure in Node.js projects.

  8. AdaDec: A Uncertainty-Guided Lookahead Decoding Framework for LLM-Based Code Generation

    cs.SE 2025-06 unverdicted novelty 5.0

    AdaDec improves Pass@1 accuracy of LLM code generation by up to 20.9% over greedy decoding by triggering lookahead reranking only at high-uncertainty steps on HumanEval+, MBPP+, and DevEval.