Test cases are often similar. A preliminary study of eight open-source projects found that on average at least 8 % of all test cases are clones; the maximum found was 42 %. The clones are not identical with their originals -identifiers of classes, methods, attributes and sometimes even order of statements and assertions differ. But the test cases reuse testing logic and are needed for testing. They serve a purpose and cannot be eliminated.We present an approach that generates useful test clones automatically, thereby eliminating some of the "grunt" work of testing. An important advantage over existing automated test case generators is that the clones include the test oracle. Hence, a human decision maker is often not needed to determine whether the output of a test is correct.The approach hinges on pairs of classes that provide analogous functionality, i.e., functions that are tested with the same logic. TestCloner transcribes tests involving analogous functions from one class to the other. Programmers merely need to indicate which methods are analogs. Automatic detection of analogs is currently under investigation. Preliminary results indicate a significant reduction in the number of "boilerplate" tests that need to be written by hand. The transcribed tests do detect defects and can provide hints about missing functionality.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2025 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.