Implementing a 3-way approach of clone detection and removal using pattern & clone detector tool

Software Systems are evolving by adding new functions and modifying existing functions over time. Through the evolution, the structure of software is becoming more complex and so the understandability and maintainability of software systems is deteriorating day by day. These are not only important but one of the most expensive activities in software development. The copying and duplication of source code has been studied in software engineering under several topic areas. Copy and paste programming is a common activity but it introduces a negative point to reuse by creating Clones. Detection of duplicate code fragments leads to efficiency on the software maintenance process and decreases maintenance cost. It is possible to outwit the hindrance of clones by applying a 3-way approach of detecting the clones at design and code level. The process is automated by developing a tool that requires no parsing yet is able to detect a significant amount of code duplication. Since code clones are believed to increase the maintenance effort, several code clone detection techniques and tools have been proposed. This thesis proposes a 3-way approach of integrating Model Based Visual Analysis using UML, Pattern Based Semantic Analysis and Syntactically Code Analysis to detect Type1 and Type 2 clones using Pattern Clone Detector (P C Detector). For the implementation of 3-way approach, I have developed a tool, named Pattern Clone Detector (PC Detector) that extracts code clones in C and C++ source files. After detecting the clones, PC Detector also identifies the pull up pattern residing in the code and thereby removes the clones. The proposed 3-way approach is compared with other clone detection techniques. The other studied clone detection techniques detect clones at code level but the proposed 3-way approach detects and removes cloning at design as well as code level.

[1]  Miryung Kim,et al.  An empirical study of code clone genealogies , 2005, ESEC/FSE-13.

[2]  Serge Demeyer,et al.  Evaluating clone detection techniques , 2003 .

[3]  Shinji Kusumoto,et al.  Refactoring Support Based on Code Clone Analysis , 2004, PROFES.

[4]  Stan Jarzabek,et al.  A Case for Structural Clones , 2009 .

[5]  Yun Yang,et al.  Towards a clone detection benchmark suite and results archive , 2003, 11th IEEE International Workshop on Program Comprehension, 2003..

[6]  Harald Störrle Towards clone detection in UML domain models , 2010, ECSA '10.

[7]  Chanchal Kumar Roy,et al.  Comparison and evaluation of code clone detection techniques and tools: A qualitative approach , 2009, Sci. Comput. Program..

[8]  Michael W. Godfrey,et al.  Cloning by accident: an empirical study of source code cloning across software systems , 2005, 2005 International Symposium on Empirical Software Engineering, 2005..

[9]  Brenda S. Baker,et al.  A Program for Identifying Duplicated Code , 1992 .

[10]  Barry W. Boehm,et al.  A spiral model of software development and enhancement , 1986, Computer.

[11]  Andrew Walenstein,et al.  Duplication, Redundancy, and Similarity in Software, 23.07. - 26.07.2006 , 2007, Duplication, Redundancy, and Similarity in Software.

[12]  Jens Krinke,et al.  Is cloned code older than non-cloned code? , 2011, IWSC '11.

[13]  Rainer Koschke,et al.  Survey of Research on Software Clones , 2006, Duplication, Redundancy, and Similarity in Software.

[14]  Frederick P. Brooks,et al.  The Mythical Man-Month: Essays on Softw , 1978 .

[15]  Daqing Hou,et al.  Aiding Software Maintenance with Copy-and-Paste Clone-Awareness , 2010, 2010 IEEE 18th International Conference on Program Comprehension.

[16]  P. Kidwell,et al.  The mythical man-month: Essays on software engineering , 1996, IEEE Annals of the History of Computing.

[17]  Katsuro Inoue,et al.  Finding Code Clones for Refactoring with Clone Metrics : A Case Study of Open Source Software , 2011 .

[18]  Ali Mili,et al.  Reuse-based software engineering: techniques, organization, and controls , 2001 .

[19]  Michael W. Godfrey,et al.  Subjectivity in Clone Judgment: Can We Ever Agree? , 2006, Duplication, Redundancy, and Similarity in Software.

[20]  Charles W. Krueger,et al.  Software reuse , 1992, CSUR.

[21]  Qing Li,et al.  Unified Modeling Language , 2009 .

[22]  Michael W. Godfrey,et al.  "Cloning Considered Harmful" Considered Harmful , 2006, 2006 13th Working Conference on Reverse Engineering.

[23]  Ron Jeffries,et al.  Extreme Programming and Agile Software Development Methodologies , 2004, Inf. Syst. Manag..

[24]  Kent L. Beck,et al.  Extreme programming explained - embrace change , 1990 .

[25]  Stéphane Ducasse,et al.  A language independent approach for detecting duplicated code , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[26]  B. Rumpe,et al.  Roots of Refactoring , 2001 .

[27]  Manishankar Mondal,et al.  An Empirical Study of the Impacts of Clones in Software Maintenance , 2011, 2011 IEEE 19th International Conference on Program Comprehension.

[28]  Paul W. Oman,et al.  Using metrics to evaluate software system maintainability , 1994, Computer.

[29]  Michael W. Godfrey,et al.  A Taxonomy of Clones in Source Code: The Re–Engineers Most Wanted List , 2003 .

[30]  Serge Demeyer,et al.  Software Evolution , 2010 .

[31]  Philip S. Yu,et al.  GPLAG: detection of software plagiarism by program dependence graph analysis , 2006, KDD '06.

[32]  Ettore Merlo,et al.  Experiment on the automatic detection of function clones in a software system using metrics , 1996, 1996 Proceedings of International Conference on Software Maintenance.

[33]  Ghazi Alkhatib,et al.  The maintenance problem of application software: An empirical analysis , 1992, J. Softw. Maintenance Res. Pract..

[34]  Shinji Kusumoto,et al.  ARIES: Refactoring support environment based on code clone analysis , 2004, IASTED Conf. on Software Engineering and Applications.

[35]  J. Howard Johnson,et al.  Identifying redundancy in source code using fingerprints , 1993, CASCON.

[36]  Pieter Van Gorp,et al.  A discussion of refactoring in research and practice , 2004 .

[37]  Rainer Koschke,et al.  An Assessment of Type-3 Clones as Detected by State-of-the-Art Tools , 2009, 2009 Ninth IEEE International Working Conference on Source Code Analysis and Manipulation.

[38]  Shinji Kusumoto,et al.  CCFinder: A Multilinguistic Token-Based Code Clone Detection System for Large Scale Source Code , 2002, IEEE Trans. Software Eng..

[39]  Donald J. Reifer,et al.  How to Get the Most out of Extreme Programming/Agile Methods , 2002, XP/Agile Universe.

[40]  Ginika Mahajan,et al.  Software Cloning in Extreme Programming Environment , 2014, ArXiv.

[41]  Don Roberts,et al.  Practical analysis for refactoring , 1999 .

[42]  William G. Griswold,et al.  Automated support for program refactoring using invariants , 2001, Proceedings IEEE International Conference on Software Maintenance. ICSM 2001.

[43]  Robert S. Arnold Tutorial on software restructuring , 1986 .

[44]  李幼升,et al.  Ph , 1989 .

[45]  Oscar Nierstrasz,et al.  Finding refactorings via change metrics , 2000, OOPSLA '00.

[46]  Alberto Sillitti,et al.  Does Refactoring Improve Reusability? , 2006, ICSR.

[47]  Bernhard Schätz,et al.  Clone detection in automotive model-based development , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[48]  Barrett R. Bryant,et al.  Representation, analysis, and refactoring techniques to support code clone maintenance , 2010 .

[49]  J. Stephen Downie,et al.  Remix and reuse of source code in software production , 2010 .

[50]  Chanchal K. Roy,et al.  A Survey on Software Clone Detection Research , 2007 .

[51]  Premkumar T. Devanbu,et al.  Clones: what is that smell? , 2010, 2010 7th IEEE Working Conference on Mining Software Repositories (MSR 2010).