一句话:将大语言模型与程序分析结合的端到端单元测试生成框架,提升覆盖率、缺陷检测精度与可维护性。
单元测试至关重要却成本高昂。大语言模型虽能生成可读代码,但在覆盖率、缺陷检测和可维护性方面表现不佳。本文提出 WiseUT,一个将 LLM 与程序分析深度融合的端到端单元测试生成框架,针对上述三方面缺陷分别设计了三个关键技术:分析引导的提示(analysis-guided prompting)以扩大测试覆盖范围;类型感知的反射式验证(type-aware reflective validation)以定位真实缺陷;语义净化(semantic purification)以提升生成测试的可维护性。作者在开源项目与工业项目上进行了评估,结果表明 WiseUT 能够一致地提升覆盖率,将类型错误检测的精度翻倍,并且其生成的测试更受开发者青睐。论文同时提供了演示视频链接。
Unit testing is critical but challenging. While LLMs excel at generating readable code, they often struggle with coverage, defect detection, and maintainability. We present WiseUT, an end-to-end framework integrating LLMs with program analysis to address these gaps. WiseUT employs analysis-guided prompting to broaden coverage, type-aware reflective validation to pinpoint genuine defects, and semantic purification for maintainability. Evaluations on open-source and industrial projects demonstrate that WiseUT consistently improves coverage, doubles precision in type error detection, and produces tests preferred by developers. Demo: https://www.youtube.com/watch?v=DmszXs0eEOE.
@inproceedings{paperbot11941,
title = {WiseUT: An Intelligent Framework for Unit Test Generation},
author = {Chen Yang and Ziqi Wang and Lin Yang and Dong Wang and Shutao Gao and Yanjie Jiang and Junjie Chen},
booktitle = {ICSE},
year = {2026},
doi = {10.1145/3774748.3787612}
}