EUVIMEDEUVIMED entdecken
Crossref

CITYWALK : Enhancing LLM-Based C++ Unit Test Generation via Project-Dependency Awareness and Language-Specific Knowledge

Yuwei Zhang, Qingyuan Lu, Kai Liu, Wensheng Dou, Jiaxin Zhu, Li Qian, Chunxi Zhang, Zheng Lin, Jun Wei

ACM Transactions on Software Engineering and Methodology · 31.05.2026 · 35 (5) · 1-32

DOI: 10.1145/3763791 ↗

Kurz gefasst

Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 24.04.2026. Verfasst von Yuwei Zhang und 8 weiteren Autor:innen. Die Arbeit wurde bisher 10-mal zitiert (Crossref) und nennt 57 Literaturangaben. Gefördert von: National Key R&D Program of China, Major Project of ISCAS, Basic Research Project of ISCAS.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Unit testing plays a pivotal role in the software development lifecycle, as it ensures code quality. However, writing high-quality unit tests remains a time-consuming task for developers in practice. More recently, the application of large language models (LLMs) in automated unit test generation has demonstrated promising results. Existing approaches primarily focus on interpreted programming languages (e.g., Java), while mature solutions tailored to compiled programming languages like C++ are yet to be explored. The intricate language features of C++, such as pointers, templates, and virtual functions, pose particular challenges for LLMs in generating both executable and high-coverage unit tests. To tackle the aforementioned problems, this article introduces CITYWALK , a novel LLM-based framework for C++ unit test generation. CITYWALK enhances LLMs by providing a comprehensive understanding of the dependency relationships within the project under test via program analysis. Furthermore, CITYWALK incorporates language-specific knowledge about C++ derived from project documentation and empirical observations, significantly improving the correctness of the LLM-generated unit tests. We implement CITYWALK by employing the widely popular LLM GPT-4o. The experimental results show that CITYWALK outperforms current state-of-the-art approaches on a collection of ten popular C++ projects. Our findings demonstrate the effectiveness of CITYWALK in generating high-quality C++ unit tests.

Förderung

  • National Key R&D Program of China
  • Major Project of ISCAS
  • Basic Research Project of ISCAS
  • Youth Innovation Promotion Association of the Chinese Academy of Sciences

Zitieren

APA

Zhang, Y., Lu, Q., Liu, K., Dou, W., Zhu, J., Qian, L., Zhang, C., Lin, Z., & Wei, J. (2026). CITYWALK : Enhancing LLM-Based C++ Unit Test Generation via Project-Dependency Awareness and Language-Specific Knowledge. ACM Transactions on Software Engineering and Methodology, 35(5), 1-32. https://doi.org/10.1145/3763791

Vancouver

Zhang Y, Lu Q, Liu K, Dou W, Zhu J, Qian L, et al. CITYWALK : Enhancing LLM-Based C++ Unit Test Generation via Project-Dependency Awareness and Language-Specific Knowledge. ACM Transactions on Software Engineering and Methodology. 2026;35(5):1-32. doi:10.1145/3763791

BibTeX
@article{Zhang2026,
  author = {Zhang, Yuwei and Lu, Qingyuan and Liu, Kai and Dou, Wensheng and Zhu, Jiaxin and Qian, Li and Zhang, Chunxi and Lin, Zheng and Wei, Jun},
  title = {CITYWALK : Enhancing LLM-Based C++ Unit Test Generation via Project-Dependency Awareness and Language-Specific Knowledge},
  journal = {ACM Transactions on Software Engineering and Methodology},
  year = {2026},
  volume = {35},
  number = {5},
  pages = {1--32},
  doi = {10.1145/3763791}
}
Kostenlos starten →