CasModaTest: A Cascaded and Model-agnostic Self-directed Framework for Unit Test Generation
Chao Ni, Xiaoya Wang, Liushan Chen, Dehai Zhao, Zhengong Cai, Shaohua, Wang, Xiaohu Yang

TL;DR
CasModaTest is a novel, model-agnostic framework that enhances unit test generation by combining cascaded stages for test prefix and oracle creation, significantly outperforming existing approaches in accuracy and coverage.
Contribution
It introduces a cascaded, end-to-end, model-agnostic approach for unit test generation, addressing limitations of existing ML-based methods with high-quality test prefix and oracle assembly.
Findings
Outperforms state-of-the-art methods by 60.62%-352.55% in accuracy.
Achieves 2.83%-87.27% higher focal method coverage.
Effective across different open-source LLMs.
Abstract
Though many machine learning (ML)-based unit testing generation approaches have been proposed and indeed achieved remarkable performance, they still have several limitations in effectiveness and practical usage. More precisely, existing ML-based approaches (1) generate partial content of a unit test, mainly focusing on test oracle generation; (2) mismatch the test prefix with the test oracle semantically; and (3) are highly bound with the close-sourced model, eventually damaging data security. We propose CasModaTest, a cascaded, model-agnostic, and end-to-end unit test generation framework, to alleviate the above limitations with two cascaded stages: test prefix generation and test oracle generation. Then, we manually build large-scale demo pools to provide CasModaTest with high-quality test prefixes and test oracles examples. Finally, CasModaTest automatically assembles the generated…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Real-time simulation and control systems · Model-Driven Software Engineering Techniques
