Generating Project-Specific Test Cases with Requirement Validation Intention
Binhang Qi, Yun Lin, Xinyi Weng, Yuhuan Huang, Chenyan Liu, Hailong Sun, Zhi Jin, Jin Song Dong

TL;DR
This paper introduces IntentionTest, a method that generates project-specific test cases aligned with validation intentions using retrieval and editing with an LLM, improving relevance and success rates.
Contribution
It presents a novel approach combining retrieval and editing with LLMs to generate validation intention-aware test cases, outperforming existing baselines.
Findings
IntentionTest kills 28.1% to 37.6% more common mutants.
It shares 16.9% to 23.9% more common coverage.
It generates 23.7% to 49.0% more successful passing tests.
Abstract
Test cases are valuable assets for maintaining software quality. State-of-the-art automated test generation techniques typically focus on maximizing program branch coverage or translating focal methods into test code. However, in contrast to branch coverage or code-to-test translation, practical tests are written out of the need to validate whether a requirement has been fulfilled. Specifically, each test usually reflects a developer's validation intention for a program function, regarding (1) what is the test scenario of a program function? and (2) what is expected behavior under such a scenario? Without taking such intention into account, generated tests are less likely to be adopted in practice. In this work, we propose IntentionTest, which generates project-specific tests given the description of validation intention. IntentionTest adopts a retrieval-and-edit manner. First, given a…
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.
