Generalizing Test Cases for Comprehensive Test Scenario Coverage
Binhang Qi, Yun Lin, Xinyi Weng, Chenyan Liu, Hailong Sun, Gordon Fraser, Jin Song Dong

TL;DR
This paper introduces TestGeneralizer, a framework that enhances test case coverage by generalizing initial tests to cover diverse scenarios aligned with requirements, outperforming existing methods.
Contribution
Proposes TestGeneralizer, a novel framework for expanding initial test cases into comprehensive scenario-based tests using a three-stage process.
Findings
TestGeneralizer improves scenario coverage by over 30% compared to baselines.
It effectively infers requirements and generates diverse test scenarios.
The approach outperforms state-of-the-art methods on open-source Java projects.
Abstract
Test cases are essential for software development and maintenance. In practice, developers derive multiple test cases from an implicit pattern based on their understanding of requirements and inference of diverse test scenarios, each validating a specific behavior of the focal method. However, producing comprehensive tests is time-consuming and error-prone: many important tests that should have accompanied the initial test are added only after a significant delay, sometimes only after bugs are triggered. Existing automated test generation techniques largely focus on code coverage. Yet in real projects, practical tests are seldom driven by code coverage alone, since test scenarios do not necessarily align with control-flow branches. Instead, test scenarios originate from requirements, which are often undocumented and implicitly embedded in a project's design and implementation. However,…
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.
