Aries component supports refactoring activities. Aries processes code clones detected by CCFinder to support refactorings. One is extraction, and the other is characterization.
Code clones detected by CCFinder | Code clones extracted by Aries |
Extracting structural parts, the user can get refactoring-oriented code clones. But, the user determine how they can/should be removed on his/her own. Espically, therer are many way to remove code clones in object-oriented languages. For example, moving them to utility class or pulling up them to parent class. Aries characterizes refactoring-oriented code clones using several metrics to predict how they can/should be removed. The following metrics are some parts of metrics used in Aries. All metrics are calculated on each clon set.
Aries outputs the result to a file after extraction and characterization. The user can graphically analysis refactoring-oriented code clones after GUI component loads the result file. The left figure is a snapshot of Aries. How to use GUI of Aries is similar to the Clone Base Analysis of Gemini. Refactoring-oriented code clones can be categorized into three units, declaration, method, and statement. Different metrics are used for each unit, but NRV(S), NSV(S), and DCH(S) are common. The left side consists of the Metric Graph and the Clone Unit Selection Panel. On the Metric Graph, the user can filter clone sets based on their metrics values. On the Clone Unit Selection Panel, the user can filte clone sets based on their unit. If you don't know the Metric Graph, refer to the Gemini component page. The left figure represents the tab of statement-unit clone sets. In the Clone Unit Selection Panel, 7-th unit exist, do-, for-, if-, switch-, synchronized-, try-, while-statements. Each of them has a check box, and the user can filters units by checking. A filtering result of the Metric Graph and the Clone Unit Selection Panel is reflected to the Clone Set List, which means that only filtered clone sets show up on the Clone Set List.
Double clicking a clone set on the list make a window as the left figure appearing. The window hold the more detail information about the selected clone set. The top of it is the list of all metrics of the clone set. The middle is the list of all code fragments included the clone set. Each element of it consists of three parts, file path, location on the file, and the number of cloned tokens. When the user selects a fragment of them, its source code was represented on the Source Code View, which lays on the bottom left of the window. And all externally defined variables used in the selected code fragment shows up on the Variable List. Conducting refacotring processes, such variables must be treated carefully.
Copyright © 2005-2007 Software Engineering Laboratory All Rights Reserved.