DiffuTester: Accelerating Unit Test Generation for Diffusion LLMs via Mining Structural Pattern

Lekang Yang, Yuetong Liu, Yitong Zhang, Jia Li


Abstract
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/THU-Agent/DiffuTester .
Anthology ID:
2026.emnlp-main.1046
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
24029–24048
Language:
URL:
https://aclanthology.org/2026.emnlp-main.1046/
DOI:
Bibkey:
Cite (ACL):
Lekang Yang, Yuetong Liu, Yitong Zhang, and Jia Li. 2026. DiffuTester: Accelerating Unit Test Generation for Diffusion LLMs via Mining Structural Pattern. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 24029–24048, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
DiffuTester: Accelerating Unit Test Generation for Diffusion LLMs via Mining Structural Pattern (Yang et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.1046.pdf