The system uses a developer’s description of a test scenario and expected result to create a project-specific test.
Most automated test-generation tools aim to cover more branches of a program or turn a particular piece of code into a test. IntentionTest instead starts with a validation intention: the test scenario, precondition and expected result a developer wants to check.
The system finds a reusable test from the same project, then uses a large language model to edit it for the new intention. It also supplies relevant project code and global variables as context, helping the generated test use the project’s existing patterns.
What the system produced
In an evaluation of 3,680 test cases from 12 open-source projects, IntentionTest was compared with four other methods: TELPA, DA, ChatTester and EvoSuite. Given a validation intention, it generated tests that were more semantically relevant to the reference tests. Its common mutation scores were 28.1% to 37.6% higher, common coverage ratios were 16.9% to 23.9% higher, and successful-pass rates were 23.7% to 49.0% higher than those of the comparison methods.