Jump to body Japanese

What is Aries component?

Aries component supports refactoring activities. Aries processes code clones detected by CCFinder to support refactorings. One is extraction, and the other is characterization.

Extraction of Structural Parts

On the extraction process, Aries extracts structural parts from code clones. Code clones detected by CCFinder are not apriciate to be refactored because they are token sequence. For example, extracted parts are methods or classes or if-statements or ... The extracted parts are easy to be refactored.

Code clones detected by CCFinder Code clones extracted by Aries
Code clones detected by CCFinder Code clones extracted by Aries

Characterization using Metrics

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.

NRV(S) represents the average of the number of externally defined variables referred in the fragments of clone set S. Additionally, NAV(S) represents the average of the number of externally defined variables assigned to in the fragments of clone set S. The definitions of these are the followings.

NRV(S) and NSV(S)

These metrics represent how strong cloned fragments couple with its surrounding fragments. The greater these valuse are, The more coupled cloned fragments couple with its surroundings. Great values means it diffucult to remove its clone set.

Metric DCH(S) represents how code framgents of clone set S are scattered on the class hierarhcy. The definition of this metric is the followings.

The more widely spread code fragments of clone set S are, the greater the value of DCH(S) is. For example, all code fragments of clone set S are in a same class, the value of DCH(S) is 0.

Refactoring Support Component ARIES

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.

the detail information of the selected clone set

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.