What is Cleman?
Cleman (Clone evolution management) is a framework for construction of clone group management systems. Cleman contains a formal model, two algorithms, and a system architecture. Four clone group management systems have been implemented based on Cleman for evaluation.
What are clones?
Clones are identical or similar fragments in a software system. Clones are usually created by copy-and-paste programming and extending existing code. Clones appear in both code-based and model-based software (Click this link to see an example of clones).
Clones seem to have identical or similar logic, thus, require additional effort from engineers in development. For example, they have to make sure that multiple clones are modified in a consistent manner.
How to deal with clones?
Since clones cause difficulty for software development, early approaches aim to detect and remove them. However, the elimination of code clones could incur many trade-offs. For example, unifying clones in a web application increases page access time and the complexity of web page design. Sometimes, code duplication seems to be a reasonable or even beneficial design option. Even in some situations, developers intentionally maintain the cloned code and evolve them into distinct code over time.
Clone group management
Like other parts of source code, clones and their groups, i.e. sets of cloned fragments, evolve during software development. Therefore, there is a need of automatic support for the management of clones and their groups in software evolution. Clone group management requires two tasks:
- Clone grouping: Identify cloned fragments and group them into relevant groups. The resulted groups should be precise, complete and non-redundant.
- Clone update: When the software changes, update clone groups relevant to the change of software, i.e. identify the deleted, created, modified clones and clone groups. For modified clone groups, the update process should identify the change to their members.
Some approaches limitedly support clone management by tracking, i.e. identifying clones in the source code. However, those approaches are based on ad-hoc methods which might reduce precision and completeness of managed clones in many situations.
Cleman is the first approach that addresses clone group management in software evolution formally, comprehensively, and flexibly.