School of Computer Science
    
CloneTracker
Tool Support for Code Clone Management

Overview

Source code duplication (i.e., code regions with identical syntax and semantics; typically formed through copy and paste operations) are generally considered obstacles to software maintenance because a change in one clone region often necessitate consistent changes to all other clone regions in the clone group. Oversights in that respect may introduce bugs in the system. Research has provided evidence that a significant percentage of code clones cannot be easily refactored. The CloneTracker plug-in provides support for developers to document clone-groups-of-interest, and to be notified through the Eclipse warning mechanism when a future modification task intersects with the documented model. Once notified, CloneTracker can point the developer to the other clone regions that require consistent modification and provide support for simultaneously modifying two clone regions. CloneTracker also provides support for sharing a clone model with project collaborators, and for updating the clone model after a development session.

User Guide

Clone Detection & Documentation



Right-click on a project to invoke CloneTracker (Click here for explanation of search parameters). Clone detection is
memory intensive. We recommend a minimum of 748MB maximum VM memory parameter. More memory may be
required for larger code bases. Ideally, your machine should have greater than 1GB of RAM to ensure successful
detection of clones. The clone groups identifed in the project are displayed under the "Clone Detector" node once
clone detection is completed.





1. The CloneTracker view has two top level nodes: CloneDetector (displays the clone groups for a given project
    after a successful clone detection) and CloneDocumentation (contains the documented clone groups - with yellow nodes).  
                                       
2. To document a clone group, you can either right-click on the group and select "Document Clone Group" or drag the group
    node from its project node in the CloneDetector node the and drop it on the CloneDocumentation node.                                                                                                         
3. Modifications may change clone relationships. Update to the clone model is automatically triggered whenever modifications
are committed to the source code repository. The "DELTA" node shows the result of an update operation. In this example,
CloneTracker informs the developer that Group14 has been modified. One of its clone region(m-) no longer exist, and a new
clone region(m+) has been added to the group. To update the clone model, delete the documented node, and drag-and-drop
the new node on the Clone Documentation node.                              


Change Notification



Change notification in CloneTracker is integrated with the Eclipse warning mechanism. The notification describes the clone group to which
the modified region belongs provides three QuickFix options.
The Show Me option points the developer to the group to which the clone region belongs by highlighting the background of the row in the Clone Documentation node to yellow, thus effectively eliminating the need to repeat the clone detection and investigation process.

The Link/Unlink option provides support for consistently modifying clone regions when necessary. When selected, CloneTracker opens a
corresponding clone region, and modifications made within common sub-regions of both clone regions are echoed from the active clone region
to the sibling clone region.

The Ignore/Resolved option is used to inform CloneTracker to ignore the clone region. Once selected, the plug-in removes the marker from the clone region and from the Eclipse Problems View for the duration of the Eclipse session. Modifications to regions of this clone group during the current
session are not communicated to the developer.

Download

System requirements: Eclipse 3.x, Java 1.5 or later, and a minimum of 1 GB RAM. CloneTracker has been tested on Windows, Mac, and Linux.

The CloneTracker plug-in depends on the clone detection tool SimScan. To successfully install CloneTracker, please download SimScan
from
here, unzip the downloaded file, and copy the simscan_all.jar to your Eclipse installation directory (please do not rename the jar file).

CloneTracker can be easily installed through the Eclipse's update mechanism. CloneTracker is distributed under the terms of the Eclipse Public License, v. 1.0

To install CloneTracker:

  1. From the Eclipse menu bar, select Help | Software Updates | Find and Install...
  2. Select "Search for new features to install" and click Next >
  3. Click on the New Remote Site... button.
  4. For the name, enter "CloneTracker". For the URL, enter "http://www.cs.mcgill.ca/~swevo/clonetracker/update", and click OK
  5. Select the new CloneTracker entry in the list and click Finish
  6. In the list of features to install, select the root node of the CloneTracker tree, and click Next >
  7. Select that you accept the terms of the license agreement, and click Next >
  8. Click Finish, and then Install
  9. Restart your workspace.

Documentation

User Interface

The features of the CloneTracker plug-in and the underlying algorithms and heuristics are described in detail in our ICSE 2008 and ICSE 2007 papers respectively.

Publications

Ekwa Duala-Ekoko and Martin P. Robillard: CloneTracker: Tool Support for Code Clone Management. In Proceedings of the 30th ACM/IEEE International Conference on Software Engineering, May 2008, Formal Research Demonstration. (pdf).

Ekwa Duala-Ekoko and Martin P. Robillard: Tracking Code Clones in Evolving Software. In Proceedings of the 29th ACM/IEEE International Conference
on Software Engineering
, May 2007 [ACM SIGSOFT Distinguished Paper Award ]. (pdf).

Issues

Search and report issues with CloneTracker using Bugzilla(Product: CloneTracker).

People

CloneTracker was developed by Ekwa Duala-Ekoko with contributions from Martin Robillard.

Contact Information

Address questions, bugs, and comments to Ekwa Duala-Ekoko.