20.01.2014 Views

thesis - Faculty of Information and Communication Technologies ...

thesis - Faculty of Information and Communication Technologies ...

thesis - Faculty of Information and Communication Technologies ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 4. Measuring Evolving S<strong>of</strong>tware<br />

sub-set <strong>of</strong> classes that they use from this package. Furthermore,<br />

the type names within the source code typically contain just the<br />

class name, not the fully qualified name (for example, it is more<br />

common to use Math rather than java.lang.Math when the developers<br />

rely on mathematical library functions).<br />

• All comments are removed from compiled class files.<br />

• The compilation process typically erases local variable names <strong>and</strong><br />

hence we lose these symbol names in the compiled class.<br />

• A compiled class contains a constant pool which is an array containing<br />

all the numeric, string <strong>and</strong> type constants that are used in<br />

the class. These constants are defined only once in the constant<br />

pool <strong>and</strong> referenced (via an index) in all other sections <strong>of</strong> the class.<br />

Metrics Extraction <strong>and</strong> Post Processing<br />

We process each compiled Java class file <strong>and</strong> extract two types <strong>of</strong> metrics:<br />

direct count metrics <strong>and</strong> modifier flags. Table 4.2 shows the list <strong>of</strong><br />

count metrics that we extract by processing field <strong>and</strong> method interface<br />

information for each class, Table 4.3 shows the list <strong>of</strong> count metrics<br />

that are computed by processing the bytecode instructions present in<br />

method bodies, <strong>and</strong> Table 4.4 shows the flags that we extract for each<br />

class. In this <strong>thesis</strong>, we treat all the count metrics as measures <strong>of</strong> size<br />

as they reflect size <strong>of</strong> a class from different perspectives. However, we<br />

consider the Number <strong>of</strong> Branches (NOB) measure as a complexity metric<br />

that captures the internal structure <strong>of</strong> a class. The NOB measure is<br />

equivalent to the widely used Weighted Method Count (WMC) metric [46]<br />

with Cyclomatic Complexity [190] used as the weight [46]. The WMC<br />

<strong>and</strong> (hence our formulation <strong>of</strong> the NOB) is accepted within the literature<br />

as a measure <strong>of</strong> structural complexity [116, 165].<br />

Along with the metrics shown in Tables 4.2, 4.3, <strong>and</strong> 4.4 we also capture<br />

the fully qualified name <strong>of</strong> each class, its fully-qualified super class<br />

name as well as all method names (including full signature capturing<br />

the return type), field names (including the type) <strong>and</strong> the fully-qualified<br />

name <strong>of</strong> all other classes that a class depends upon.<br />

78

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!