Function clone detection in web applications: a semiautomated approach

  • Authors:
  • Fabio Calefato;Filippo Lanubile;Teresa Mallardo

  • Affiliations:
  • Dipartimento di Informatica, University of Bari, Italy;Dipartimento di Informatica, University of Bari, Italy;Dipartimento di Informatica, University of Bari, Italy

  • Venue:
  • Journal of Web Engineering
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many web applications use a mixture of HTML and scripting language code as the front-end to business services, where scripts can run on both the client and server side. Analogously to traditional applications, code duplication occurs frequently during the development and evolution of web applications. This ad-hoc but pathological form of reuse consists in copying, and eventually modifying, a block of existing code that implements a piece of required functionality. Duplicated blocks are named clones and the act of copying, including slight modifications, is called cloning. When entire functions are copied rather than fragments, duplicated functions are called function clones. This paper describes how a semiautomated approach can be used to identify cloned functions within scripting code of web applications. The approach is based on the automatic selection of potential function clones and the visual inspection of selected script functions. The results obtained from the clone analysis of four web applications show that the semiautomated approach is both effective and efficient at identifying function clones in web applications, and can be applied to prevent clone from spreading or to remove redundant scripting code.