Type-aware LLM-based Test Generation for Python Programs
ACM Transactions on Software Engineering and Methodology · 21.07.2026
DOI: 10.1145/3830083 ↗Kurz gefasst
Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 21.07.2026. Verfasst von RunLin Liu und 5 weiteren Autor:innen. Die Arbeit nennt 57 Literaturangaben.
Abstract (Originalsprache)
Automated test generation has been extensively explored, yet generating high-quality tests for Python programs remains particularly challenging. Because of Python’s dynamic typing features, existing approaches, ranging from search-based software testing (SBST) to recent LLM-driven techniques, are often prone to type errors. Hence, existing methods often generate invalid inputs and semantically inconsistent test cases, which ultimately undermine their practical effectiveness. To address these limitations, we present Test4Py, a novel framework that enhances type correctness in automated test generation for Python. Test4Py leverages the program’s call graph to capture richer contextual information about parameters, and introduces a behavior-based type inference mechanism that accurately infers parameter types and constructs valid test inputs. Beyond input construction, Test4Py integrates an iterative repair procedure that progressively refines generated test cases to improve coverage. In an evaluation on 183 real-world Python modules, Test4Py achieved an average line coverage of 83.0% and branch coverage of 70.8%, outperforming state-of-the-art tools by 7.2% and 8.4% in relative gains, respectively.
Zitieren
APA
Liu, R., Zhang, Z., Hu, Y., Lin, Y., Gao, X., & Sun, H. (2026). Type-aware LLM-based Test Generation for Python Programs. ACM Transactions on Software Engineering and Methodology. https://doi.org/10.1145/3830083
Vancouver
Liu R, Zhang Z, Hu Y, Lin Y, Gao X, Sun H. Type-aware LLM-based Test Generation for Python Programs. ACM Transactions on Software Engineering and Methodology. 2026. doi:10.1145/3830083
BibTeX
@article{Liu2026,
author = {Liu, RunLin and Zhang, Zhe and Hu, Yunge and Lin, Yuhang and Gao, Xiang and Sun, Hailong},
title = {Type-aware LLM-based Test Generation for Python Programs},
journal = {ACM Transactions on Software Engineering and Methodology},
year = {2026},
doi = {10.1145/3830083}
}
EUVIMED