Information Technology Reference
In-Depth Information
x
a tree is a complex structure composed of unmistakable elements
such as trunk, branches, leaves, and colour. These properties can be
meaningfully mapped onto source code characteristics;
x
a tree provides a fine-grained representation of the components of a
piece of software in terms of individual classes;
x
a forest and sub-forests of trees provide developers with a large-
scale understanding of the design and the proliferation of classes.
The Trees. The model upon which we have based the creation and the
rendering of the trees is based on the Weber and Penn approach [27],
which uses a model to create the geometrical structure of trees. This model
handles several parameters to modify the property of a tree. Examples are:
the height of the tree, the width of the trunk, the level of recursion of the
branches, leaves' orientation, and so on.
To build trees, the approach needs knowledge of neither botany nor
complex mathematical principles. For example, each branch may have
similarity with its parent and inherit attributes from it. Then, the primary
branches influence all the branches. In our proposal, we consider a subset
of the parameters needed to render a tree that affect its shape (trunk and
foliage) according to the main characteristics of a class the tree represents.
Mapping Tree Properties and Source Metrics. We considered the
following visual properties of a tree: height, branch number, branch
direction, leaf number, leaf colour, leaf size, and base size (i.e. the part of
the trunk without branches). On the other hand, the metrics exploited to
influence the visual appearance of a tree are: lines of code (LOCs), lines of
comment (CLOCs), number of attributes (NOAs), number of public
methods (NEMs), number of private methods (NOMs), and the total
number of methods (NEOMs). We considered only the most widely
known and used (e.g. [28]).
In Table 7.1 we summarize the mapping between metrics and the
visual properties of a tree. Some visual properties highlight the local
characteristics of a given class (e.g., NOMs/NEOMs), while others make
sense only when trees are analysed together (e.g., LOCs). In particular, we
mapped the height of a tree with LOCs, while the number of branches that
sprout from the trunk corresponds to NEOMs. A tree with few branches
represents a class with few methods. To highlight the number of public
methods, we use branch orientation. In the case where the value
NEMs/NEOMs is close to one, the class has many public methods and its
tree has branches pointing outwards. Otherwise, if NEMs/NEOMs tend to
zero, the class has many private methods and its tree has branches oriented
Search WWH ::




Custom Search