An Approach to Detect Similar Script Functions in Web Applications Based on Calling Information

Article Preview

Abstract:

Cloned code might exacerbate a system maintenance problem, so it is important to remove duplicate code to improve system performance. In web development, script code can often be duplicated as a unit of a script function. Previous research for detecting similar script functions forecasted candidates of similar script functions based on the name of the function and classified the detected candidates into four similarity levels by comparing factors contained within the script functions. There are two key issues that need to be considered to detect similar script functions when using that method. One was that a pair of similar script functions needs to have the same name to be detected. The other was that some modifications particularly such as adding or removing calling statements were not identified after detecting. Adding or removing calling statements might prevent identification for duplicate script function. In this paper, we propose a novel approach to detect similar script functions that can determine the similarity of a script function by evaluating the structural similarity of function code and the calling structure. The evaluation for detecting the structural similarity of code and the calling structure is performed based on a similarity metric, FSIM, which we have defined. We showed the usefulness of FSIM by applying it to three open source projects.

You might also be interested in these eBooks

Info:

Periodical:

Pages:

1593-1599

Citation:

Online since:

December 2012

Export:

Price:

Permissions CCC:

Permissions PLS:

Сopyright:

© 2013 Trans Tech Publications Ltd. All Rights Reserved

Share:

Citation:

[1] F. Lanubile and T. Mallardo, "Finding function clones in web application", Proceeding of Software Maintenance and Reengineering on Seventh European Conference, Bari Univ in Italy, pp.379-386(2003).

DOI: 10.1109/csmr.2003.1192447

Google Scholar

[2] F. Calefato, F. Lanubile and T. Mallardo, "Function clone detection in web application : A semiautomated approach", Published in Journal of Web Engineering, Vol.3 , pp.3-21(2004).

Google Scholar

[3] B. Lague, D. Proulx, J. Mayrand, E. Merlo, and J. Hudepohl, "Assessing the Benefits of Incorporating Function Clone Detection in a Development Process," Proc. Int'l Conf. Software Maintenance, pp.244-253(1996)

DOI: 10.1109/icsm.1997.624264

Google Scholar

[4] J. Mayrand, C. Leblanc, and E.M. Merlo, "Experiment on the automatic detection of function clones in a software system using metrics," Software Maintenance 1996, Proceedings., International Conference on , vol., no., pp.244-253(1996).

DOI: 10.1109/icsm.1996.565012

Google Scholar

[5] I. D. Baxter, A. Yahin, L. Moura, M. Sant'Anna and L. Bier, "Clone detection using abstract syntax trees," Proceedings International Conference on Software Maintenance, pp.368-377(1998).

DOI: 10.1109/icsm.1998.738528

Google Scholar

[6] E. Merlo and T. Lavoie, "Computing Structural Types of Clone Syntactic Blocks," Reverse Engineering, 2009. WCRE '09. 16th Working Conference on , pp.274-278(2009).

DOI: 10.1109/wcre.2009.33

Google Scholar

[7] A. Corazza, S. Di. Martino, V. Maggio and G. Scanniello, "A Tree Kernel based approach for clone detection," Software Maintenance (ICSM), 2010 IEEE International Conference on, pp.1-5(2010).

DOI: 10.1109/icsm.2010.5609715

Google Scholar

[8] E. Kodhai, S. Kanmani, A. Kamatchi, R. Radhika and B. Vijaya Saranya, "Detection of Type-1 and Type-2 Code Clones Using Textual Analysis and Metrics," Recent Trends in Information, Telecommunication and Computing (ITC), 2010 International Conference on , pp.241-243(2010).

DOI: 10.1109/itc.2010.55

Google Scholar

[9] J. Krinke, "Identifying similar code with program dependence graphs," Reverse Engineering, 2001. Proceedings. Eighth Working Conference on , vol., no., pp.301-309(2001).

DOI: 10.1109/wcre.2001.957835

Google Scholar

[10] T. Kamiya, S. Kusumoto, and K. Inoue, "CCFinder : a multilinguistic token-based code clone detection system for large scale source code", IEEE Transactions on Software Engineering, pp.654-650(2002).

DOI: 10.1109/tse.2002.1019480

Google Scholar

[11] Z. Li, S. Lu, S. Myagmar and Y. Zhou, "CP-Miner: finding copy-paste and related bugs in large-scale software code", IEEE Transactions on Software Engineering, pp.176-192(2006).

DOI: 10.1109/tse.2006.28

Google Scholar

[12] B.S. Baker, "Finding Clones with Dup: Analysis of an Experiment," Software Engineering, IEEE Transactions on , vol.33, no.9, pp.608-621(2007)

DOI: 10.1109/tse.2007.70720

Google Scholar

[13] L. Jiang, G. Misherghi, Z. Su and S Glondu, "DECKARD: Scalable and Accurate Tree-based Detection of Code Clones", Proceeding of ICSE 07, Washington DC in USA, pp.96-105(2007).

DOI: 10.1109/icse.2007.30

Google Scholar

[14] F. Martin "improving the design of existing code", Addison-Wesley:Reading, MA, 1999.

Google Scholar

[15] M. Balazinska, E. Merlo, M. Dagenais, B. Lague and K. Kontogiannis, "Partial Redesign of Java Software Systems Based on Clone Analysis" 6th working conference on reverse engineering in Atlanta USA, pp.326-336(1999).

DOI: 10.1109/wcre.1999.806971

Google Scholar

[16] R. Fanta and V. Rajlich. "Removing Clones from the Code". Journal of Software Maintenance: Research and Practice, Vol 11, No.4 pp.223-243(1999).

DOI: 10.1002/(sici)1096-908x(199907/08)11:4<223::aid-smr194>3.0.co;2-d

Google Scholar

[17] https://github.com/hanut/ezbuy

Google Scholar

[18] http://www.codeforge.com/read/83638/Login.php__html

Google Scholar

[19] http://www.phpaccounts.com/support/

Google Scholar