Saved in:
Bibliographic Details
Main Authors: Yang, Lekang, Liu, Yuetong, Zhang, Yitong, Li, Jia
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2509.24975
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912895484297216
author Yang, Lekang
Liu, Yuetong
Zhang, Yitong
Li, Jia
author_facet Yang, Lekang
Liu, Yuetong
Zhang, Yitong
Li, Jia
contents Diffusion large language models (dLLMs) enable parallel generation and are promising for unit test generation (UTG), where efficient and large-scale automated testing is essential in software development. Despite this advantage, their application to UTG is still constrained by a clear trade-off between efficiency and test quality, since increasing the number of tokens generated in each step often causes a sharp decline in the quality of test cases. To overcome this limitation, we present DiffuTester, an acceleration framework specifically tailored for dLLMs in UTG. The motivation of DiffuTester is that unit tests targeting the same focal method often share structural patterns. DiffuTester employs a novel structural pattern based decoding approach, which dynamically identifies structural patterns across unit tests through their abstract syntax trees and additionally decodes the corresponding tokens, thereby achieving acceleration without compromising the quality of the output. To enable comprehensive evaluation, we extend the original TestEval benchmark to three programming languages. Extensive experiments on three benchmarks with two representative models show that DiffuTester delivers significant acceleration while preserving test coverage. Moreover, DiffuTester generalizes well across different dLLMs and programming languages, providing a practical and scalable solution for efficient UTG in software development. Code and data are publicly available at https://github.com/TsinghuaISE/DiffuTester.
format Preprint
id arxiv_https___arxiv_org_abs_2509_24975
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle DiffuTester: Accelerating Unit Test Generation for Diffusion LLMs via Mining Structural Pattern
Yang, Lekang
Liu, Yuetong
Zhang, Yitong
Li, Jia
Software Engineering
Computation and Language
Diffusion large language models (dLLMs) enable parallel generation and are promising for unit test generation (UTG), where efficient and large-scale automated testing is essential in software development. Despite this advantage, their application to UTG is still constrained by a clear trade-off between efficiency and test quality, since increasing the number of tokens generated in each step often causes a sharp decline in the quality of test cases. To overcome this limitation, we present DiffuTester, an acceleration framework specifically tailored for dLLMs in UTG. The motivation of DiffuTester is that unit tests targeting the same focal method often share structural patterns. DiffuTester employs a novel structural pattern based decoding approach, which dynamically identifies structural patterns across unit tests through their abstract syntax trees and additionally decodes the corresponding tokens, thereby achieving acceleration without compromising the quality of the output. To enable comprehensive evaluation, we extend the original TestEval benchmark to three programming languages. Extensive experiments on three benchmarks with two representative models show that DiffuTester delivers significant acceleration while preserving test coverage. Moreover, DiffuTester generalizes well across different dLLMs and programming languages, providing a practical and scalable solution for efficient UTG in software development. Code and data are publicly available at https://github.com/TsinghuaISE/DiffuTester.
title DiffuTester: Accelerating Unit Test Generation for Diffusion LLMs via Mining Structural Pattern
topic Software Engineering
Computation and Language
url https://arxiv.org/abs/2509.24975