The International Arab Journal of Information Technology (IAJIT)

..............................
..............................
..............................


Method-level Code Clone Detection for Java

A software clone is an active research area where several researchers have investigated techniques to automatically detect duplicated code in programs. However their researches have limitations either in finding the structural or functional clones. Moreover, all these techniques detected only the first three types of clones. In this paper, we propose a hybrid approach combining metric-based approach with textual analysis of the source code for the detection of both syntactical and functional clones in a given Java source code. This proposal is also used to detect all four types of clones. The detection process makes use of a set of metrics calculated for each type of clones. A tool named CloneManager is developed based on this method in Java for high portability and platform-independency. The various types of clones detected by the tool are classified and clustered as clone clusters. The tool is also tested with seven existing open source projects developed in Java and compared with the existing approaches.


[1] Baker.B.S., Parameterized Duplication in Strings: Algorithms and an Application to Software Maintenance, Society of Industrial And Applied Mathematics, vol. 26, no. 5, pp. 1343-1362, 1997.

[2] Bellon S., http://www.bauhaus- stuttgart.de/clones, Last Visited 2013.

[3] Bellon S., Koschke R., Antoniol G., Krinke J., and Merlo E., Comparison and Evaluation of Clone Detection Tools, IEEE Transactions on Software Engineering, vol. 33, no. 9, pp. 577- 591, 2007.

[4] Bettenburg N., Shang W., Ibrahim M., Adams B., Zou Y., and Hassan A., An Empirical Study on Inconsistent Changes to Code Clones at the Release Level, Science of Computer Programming, vol. 77, no. 6, pp. 760-776, 2012.

[5] Cataldo M., Mockus A., Roberts A., and Herbsleb D., Software Dependencies, Work Dependencies and Their Impact on Failure, IEEE Transactions on Software Engineering, vol. 35, no. 6, pp. 864-878, 2009.

[6] Demeyer S., Ducasse S., and Nierstrasz O., Object-Oriented Reengineering Patterns, Morgan Kaufmann and DPunkt, 2002.

[7] Ducasse S., Nierstrasz O., and Rieger M., On the Effectiveness of Clone Detection by String Matching, Journal of Software Maintenance and Evolution, vol. 18, no.1, pp. 37-58, 2006.

[8] Evans W., Fraser C., and Ma F., Clone Detection via Structural Abstraction, Software Quality Journal, vol. 17, no. 4, pp. 309-330, 2009.

[9] Evans W. and Fraser C., Clone Detection via Structural Abstraction, Technical Report MSR- TR-2005-104, 2005.

[10] Fowler M. and Beck K., Refactoring: Improving the Design of Existing Code, Addison Wesley, 1999.

[11] Gabel M., Jiang L., and Su Z., Scalable Detection of Semantic Clones, in Proceeding of 30th International Conference on Software Engineering, Leipzig, pp. 321-330, 2008.

[12] Godfrey W. and Zou L., Using Origin Analysis to Detect Merging and Splitting of Source Code Entities, IEEE Transactions on Software Engineering, vol. 31, no. 2, pp. 166-181, 2005.

[13] Greenan K., Method-Level Code Clone Detection on Transformed Abstract Syntax Trees using Sequence Matching Algorithms, Student Report, 2005.

[14] Hariharan S., Automatic Plagiarism Detection Using Similarity Analysis, The International Arab Journal of Information Technology, vol. 9, no. 4, pp. 322-326, 2012.

[15] Kamiya T., Kusumoto S., and Inoue K., CCFinder: A Multi-Linguistic Token-based Code Clone Detection System for Large Scale Source Code, IEEE Computer Society Transactions on Software Engineering, vol. 28, no. 7, pp. 654-670, 2002.

[16] Kapser C. and Godfrey W., Cloning Considered Harmful: Patterns of Cloning in Software, Empirical Software Engineering, vol. 13, no. 6, pp. 645-692, 2008.

[17] Kapser J. and Godfrey W., Supporting the Analysis of Clones in Software Systems: Research Articles, Journal of Software Maintenance: Research and Practice, vol. 18, no. 2, pp. 61-82, 2006.

[18] Liu C., Chen C., Han J., and Yu P., GPLAG: Detection of Software Plagiarism by Program Dependence Graph Analysis, in Proceeding of 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Philadelphia, pp. 872-881, 2006.

[19] Mayland J., Leblanc C., and Merlo E., Experiment on the Automatic Detection of Function Clones in a Software System Using Metrics, in Proceeding of International Conference of Software Engineering, Monterey, pp. 244-253, 1996.

[20] Nguyen H., Nguyen T., Pham H., Al-Kofahi J., and Nguyen N., Clone Management for Evolving Software, IEEE Transactions on Software Engineering, vol. 38, no. 5, pp. 1008- 1026, 2011.

[21] Pate J., Tairas R., and Kraft N., Clone Evolution: a Systematic Review, Journal of Software Maintenance: Research and Practice, vol. 25, no. 3, pp. 261-283, 2013.

[22] Petersen H., Clone Detection in Matlab Simulink Models, Master s thesis Technical University of Denmark, 2012.

[23] Roy C. and Cordy J., NICAD: Accurate Detection of Near-Miss Intentional Clones Using Flexible Pretty-Printing and Code Normalization, The 16th IEEE International Conference on Program Comprehension, Amsterdam, pp. 172-181, 2008.

[24] Roy C., Cordy J., and Koschke R., Comparison and Evaluation of Code Clone Detection Techniques and Tools: A Qualitative Approach, Science of Computer Programming, vol. 74, no. 7, pp. 470-495, 2009.

[25] Satta G. and Stock O., Bidirectional Context- Free Grammar Parsing for Natural Language Process, Artificial Intelligence, vol. 69, no. 1, pp. 123-164, 1994. 922 The International Arab Journal of Information Technology, Vol. 14, No. 6, November 2017

[26] Thummalapenta S., Cerulo L., Aversano L., and Penta M., An Empirical Study on the Maintenance of Source Code Clones, Empirical Software Engineering, vol. 15, no. 1, pp. 1-34, 2009.

[27] Zibran M. and Roy C., Con ict-Aware Optimal Scheduling of Code Clone Refactoring, Institution of Engineering and Technology Software, vol. 7, no. 3, pp. 167-186, 2013. Egambaram Kodhai is currently working as Associate Professor in the Department of Computer Science and Engineering at Sri ManakulaVinayagar Engineering College affiliated to Pondicherry University, Puducherry, India. She has completed her M.C.A from Cauvery College for women, Trichy affiliated to Bharathidasan University, Trichy and M.E. in Computer Science and Engineering from Vinayaka Mission s KirupanandaVariyar Engineering College, Salem. She has completed her Ph.D from Pondicherry Engineering College affiliated to Pondicherry University, Puducherry, India. She has more than 16 years of experience in teaching in various engineering colleges. Her Research interests include Software Clones. She has published more than 50 papers in international conference and journals. She is a member of ISTE, India. Selvadurai Kanmani received her BE and ME degree in Computer Science and Engineering from Bharathiar University and PhD from Anna University, Chennai. She has been the faculty of the Department of Computer Science and Engineering, Pondicherry Engineering College since 1992. She has published about 150 papers in international conferences and journals. Her research interests are software engineering and data mining techniques. She is a member of Computer Society of India, ISTE and Institute of engineers, India.