Efficient Code Clone Management based on Historical Analysis and Refactoring Support
Keisuke Hotta · OUKA (Osaka University Knowledge Archive) (Osaka University) · 2013
Code clones have recieved great interests in recent years from many researchers, engineers, and practitioners in the field of software engineering.A code clone is defined as a group of code fragments that are identical or similar to one another.Code clones are introduced into source code of software systems by various reasons, and the most typical one is code cloning by copy-and-paste operations for reusing existing features.Typical software systems contain a certain amount of code clones because code cloning is a common practice for software developers.The existence of code clones has been regarded as a bad smell for software evolution over a period of time because code clones require much attention to be maintained.Once code clones are introduced into source code, most of them should be consistently maintained.Unintended inconsistencies among code clones have a high risk for introducing bugs in software systems.However, it is not an easy task for developers or maintainers to be aware of all the code clones and maintain all of them consistently, specifically in the case of large software systems.This is a reason why code clones are regarded as bad factors for software evolution.Many researchers have proposed a variety of techniques to cope with code clones based on this common wisdom.However, some of recent empirical studies have been against it.That is, these studies revealed that code clones do not highly affect software evolution.The discussion for harmfulness of code clones remains inconclusive, but it is widely accepted that not all but a part of code clones have negative impacts on software evolution.For these reasons, it is not effective to prohibit software engineers from code cloning.Furthermore, prohibiting code cloning is also unrealistic because of advantages of it.Therefore, it is strongly required to manage code clones effectively.The objective of the work described in this dissertation is to promote efficient software evolution through effective managements for code clones.To achieve this objective, it is necessary to know state-of-the-art of research achievements.Therefore, we conducted a survey on research literatures on code clones.This survey categorized literatures into five categories, detection, removal, prevention, analysis, and bug detection.The survey told us current states of re-During this work, I have been fortunate to have received assistance from many individuals.First, I would like to express my heartfelt gratitude to my supervisor, Professor Shinji Kusumoto, for his considerate support, encouragement, and guidance throughout this work.