Automated Test-Case Generation by Cloning

  • Name:

    Konferenzartikel 

  • Author:

    Mathias Landhäußer
    Walter F. Tichy

  • Zusammenfassung

    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. The testing framework can even suggest suitable analogs by using natural language processing techniques. Preliminary results indicate a significant reduction in the number of "boiler-plate" tests that need to be written by hand. The transcribed tests do detect defects and can provide hints about missing functionality.

Beteiligte Mitarbeiter (zufällige Reihenfolge)
Titel Vorname Nachname

Bibtex

@inproceedings{,
author={Mathias Landh{\"a}u{\ss}er, Walter F. Tichy},
title={Automated Test-Case Generation by Cloning},
year=2012,
month=Jun,
booktitle={Proc. of the 7th International Workshop on Automation of Software Test (AST 2012)},
doi={10.1109/IWAST.2012.6228995},
url={https://ps.ipd.kit.edu/backend/downloads/},
abstract={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. The testing framework can even suggest suitable analogs by using natural language processing techniques. Preliminary results indicate a significant reduction in the number of \\"boiler-plate\\" tests that need to be written by hand. The transcribed tests do detect defects and can provide hints about missing functionality.},
pages={83-88},
pptUrl={https://ps.ipd.kit.edu/downloads/},