FUNCTION CLONE DETECTION IN WEB APPLICATIONS: A SEMIAUTOMATED APPROACH

Authors

  • FABIO CALEFATO Dipartimento di Informatica, University of Bari, Italy
  • FILIPPO LANUBILE Dipartimento di Informatica, University of Bari, Italy
  • TERESA MALLARDO Dipartimento di Informatica, University of Bari, Italy

Keywords:

web applications, refactoring, code duplication, clone detection, function clones

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.

 

Downloads

Download data is not yet available.

References

Antoniol, G., Villano, U., Merlo, E. and Di Penta, M. Analyzing cloning evolution in the Linux

kernel. Information and Software Technology 2002, 44(13). 755–765.

Antoniol, G., Casazza, G., Di Penta, M. and Merlo, E. Modeling Clones Evolution Through Time

Series. in International Conference on Software Maintenance, (Florence, Italy, 2001). 273-280.

Baker, B.S. On Finding Duplication and Near-Duplication in Large Software Systems. in Second

Working Conference on Reverse Engineering, (Toronto, Canada, 1995). 86-95.

Balazinska, M., Merlo, E., Dagenais, M., Lague, B. and Kontogiannis, K. Partial Redesign of Java

Software Systems Based on Clone Analysis. in Sixth Working Conference on Reverse

Engineering, (Atlanta, USA, 1999). 326-336.

Balazinska, M., Merlo, E., Dagenais, M., Lague, B and Kontogiannis, K. Measuring Clone Based

Reengineering Opportunities. in Sixth IEEE International Symposium on Software Metrics, (Boca

Raton, USA, 1999). 292-303.

Baxter, I.D., Yahin, A., Moura, L., Santa Anna, M. and Bier, L. Clone Detection Using Abstract

Syntax Trees. in International Conference on Software Maintenance, (Washington DC, USA,

. 368-377.

Berners-Lee, T. Principles of Design. 1998, last change: January 2002.

http://www.w3.org/DesignIssues/Principles.html

Boldyreff, C. and Kewish, R. Reverse Engineering to Achieve Maintainable WWW Sites. in Eight

Working Conference on Reverse Engineering (WCRE’01), (Stuttgart, Germany, 2001). 249-257.

Carpenter, B (Ed.). Architectural Principles of the Internet. RFC 1958, June 1996.

http://www.ietf.org/rfc/rfc1958.txt

Conallen, J. Building Web Applications with UML. Addison-Wesley: Reading, MA, 2000.

Di Lucca, G.A., Di Penta, M., Fasolino, AR. and Granato, P. Clone Analysis in the Web Era: an

Approach to Identify Cloned Web Pages. in Seventh IEEE Workshop on Empirical Studies of

Software Maintenance. (Florence, Italy, 2001). 107-113.

Ducasse, S., Rieger, M. and Demeyer, S. A Language Independent Approach for Detecting

Duplicated Code. in International Conference on Software Maintenance, (Oxford, U.K., 1999).

-118.

Fanta, R. and Rajlich, V. Removing Clones from the Code. Journal of Software Maintenance:

Research and Practice 1999, 11(4). 223–243.

Fioravanti, F., Migliarase, G. and Nesi, P. Reengineering Analysis of Object-Oriented Systems via

Duplication Analysis. in International Conference on Software Engineering, (Florence, Italy,

; 577-590.

Fowler, M. Refactoring: Improving the design of existing code. Addison-Wesley: Reading, MA,

Johnson, J.H. Identifying Redundancy in Source Code using Fingerprints. in CAS Conference.

(Toronto, Canada, 1993). 171–183.

Johnson, J.H. Substring Matching for Clone Detection and Change Tracking. in Proceedings

International Conference on Software Maintenance, (Victoria, Canada, 1994). 120-126.

Kamiya, T., Kusumoto, S. and Inoue, K. CCFinder: A Multilinguistic Token-Based Code Clone

Detection System for Large Scale Source Code. IEEE Transactions On Software Engineering

, 28(7). 654–670.

Kontogiannis, K. Evaluation Experiments on the Detection of Programming Patterns Using

Software Metrics. in Fourth Working Conference on Reverse Engineering, (Amsterdam, The

Netherlands, 1997); 44-54.

Krinke, J. Identifying Similar Code with Program Dependence Graphs. in Eighth Working

Conference on Reverse Engineering, (Stuttgart, Germany, 2001). 301-309.

Lague, B., Proulx, D., Mayrand, J., Merlo, E.M. and Hudepohl, J. Assessing the Benefits of

Incorporating Function Clone Detection in a Development Process. in International Conference on

Software Maintenance, (Bari, Italy, 1997). 314-321.

Lanubile, F. and Mallardo, T. Tool Support for Distributed Inspection. in Proceedings 26th

Annual International Computer Software & Applications Conference, (Oxford, U.K., 2002). 1071-

Lanubile, F. and Mallardo, T. Finding Function Clones in Web Applications. in Seventh European

Conference on Software Maintenance and Reengineering, (Benevento, Italy, 2003). 379-388.

Manber, U. Finding Similar Files in a Large File System. in USENIX Winter 1994 Technical

Conference. (San Francisco, USA, 1994). 1-10.

Mayrand, J., Leblanc, C., Merlo, E.M. Experiment on the Automatic Detection of Function Clones

in a Software System Using Metrics. in International Conference on Software Maintenance,

(Monterey, USA, 1996). 244-254.

Microsoft, Exchange 2000 Conferencing Server. Available:

http://www.microsoft.com/exchange/techinfo/conferencing/ [Accessed January 2004].

Parnas, D.L. Software Aging. in 16th International Conference on Software Engineering,

(Sorrento, Italy, 1994). 279-287.

Patenaude, J.F., Merlo, E.M., Dagenais, M. and Lague, B. Extending Software Quality

Assessment Techniques to Java Systems. in Seventh International Workshop on Program

Comprehension, (Pittsburgh, USA, 1999). 49-57.

Pressman, R.S., Lewis, T., Adida, B., Ullman, E., DeMarco, T., Gilb, T., Gorda, B., Humphrey,

W. and Johnson, R. Can Internet-Based Applications Be Engineered? IEEE Software 1998, 15(5).

–110.

Ricca, F. and Tonella, P. Using Clustering to Support the Migration from Static to Dynamic Web

Pages. in of the 11th International Workshop on Program Comprehension, (Portland, USA, 2003).

-216.

Rieger, M. and Ducasse, S. Visual Detection of Duplicated Code. in Workshop on Experiences in

Object-Oriented Re-Engineering. (Brussels, Belgium, 1998). 75-76.

Snitz Forums 2000, Product Specifications and Downloads. Available:

http://forum.snitz.com/spec.asp [Accessed January 2004].

van Rijsbergen C. Information Retrieval. Butterworths: London, UK. 1979.

Web Wiz Guide, Web Wiz Forums Downloads. Available:

http://www.webwizguide.info/web_wiz_forums/forum_download.asp [Accessed January 2004].

Xcent, QuickAuction. Available: http://www.xcent.com/products/QuickAuction.htm [Accessed

January 2004].

Downloads

Published

2004-05-24

How to Cite

CALEFATO, F. ., LANUBILE, F., & MALLARDO, T. . (2004). FUNCTION CLONE DETECTION IN WEB APPLICATIONS: A SEMIAUTOMATED APPROACH . Journal of Web Engineering, 3(1-2), 003–021. Retrieved from https://journals.riverpublishers.com/index.php/JWE/article/view/4349

Issue

Section

Articles