• DocumentCode
    2472490
  • Title

    Automated test-case generation by cloning

  • Author

    Landhausser, Mathias ; Tichy, Walter F.

  • Author_Institution
    Karlsruhe Inst. of Technol., Karlsruhe, Germany
  • fYear
    2012
  • fDate
    2-3 June 2012
  • Firstpage
    83
  • Lastpage
    88
  • 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. 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.
  • Keywords
    program testing; public domain software; automated test-case generation; automatic detection; cloning; human decision maker; open-source projects; test clones; testing logic; Adaptation models; Cloning; Containers; Java; Libraries; Load modeling; Testing; Automatic testing; Software testing; Test oracle; Testing;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Automation of Software Test (AST), 2012 7th International Workshop on
  • Conference_Location
    Zurich
  • Print_ISBN
    978-1-4673-1821-1
  • Type

    conf

  • DOI
    10.1109/IWAST.2012.6228995
  • Filename
    6228995