Information Technology Reference
In-Depth Information
parallel to the ground. The NOAs metric is mapped onto the number of
leaves, while the leaf size is equal to 1/NOAs. Then, a class with few
attributes is represented as a tree with large leaves. A large number of
leaves indicates a class with many attributes. The colour of leaves ranges
from green to brown. A class having a number of CLOCs greater than
LOCs is represented as a tree with green foliage, brown otherwise.
Therefore, if a tree has green foliage, it indicates that the corresponding
class is well documented. Finally, the base size of a tree is computed as
NOMs/NEOMs. A value close to one indicates that a class has many
private methods and then the tree has a large base size. Conversely, if
NOMs/NEOMs is near zero, the class has many public methods and its
tree has a small base size. The mappings between the properties of a tree
and the selected metrics try as much as possible to ease the comprehension
of systems, packages, and classes [12].
M ETRICS
V ISUAL P ROPERTIES
LOCs
Height
NEOMs
Branches
NOAs
Number of leaves
NEMs/NEOMs
Branches orientation
1/NOAs
Size of leaves
LOCs/CLOCs
Colour of the leaves (from green to brown)
LOCs = Lines of Code
CLOCs = Lines of Comment
NOAs = Number of Attributes
NEOMs = Total Number of Methods
NEMs = Number of Public Methods
NOMs = Number of Private Methods
Ta b l e 7 . 1 . Metrics and visual properties mapping
Sample Trees. To illustrate how the mapping changes the appearance of a
tree, we illustrate some sample classes. Fig. 7.1 shows a tree of a possible
class where the number of lines of code is large (the foliage is stretched
out), there is huge number of lines of comment, and the total number of
methods (both public and private) can be considered large. We show in
Figure 7.2 a tree of a class with a small number of lines of code (see the
foliage), a number of comment lines much smaller than the lines of source
code, a small number of methods, and few attributes. Finally, Fig. 7.3
depicts a tree of a class with a huge number of methods. Many of these
Search WWH ::




Custom Search