
\section*{Appendix}

The estimator \LOC and the static code popularity measures used in this paper can be relatively collected. A parser for these metrics has to iterate over the analyzed system's set of classes twice. In the first pass a class dependency graph is constructed. In the second pass the metrics are distilled according to the procedures described below.

% LOC

The measure \emph{Lines of Code} of a class $C$, LOC$(C)$, is defined as the sum of the following components:

\bi

\item OutDegree$(C)$ line(s) for {\tt import} statements
\item 1 line for the class declaration
\item 1 line for super class declaration if not {\tt java.lang.Object}
\item 1 line for each interface implemented by $C$
\item 1 line for each field defined in class $C$
\item 1 line for each method $m$ defined in class $C$, plus

\bi

\item \# parameters of $m$
\item \# {\tt throws} defined by $m$
\item {\tt MaxLocals} attribute (\ie, local variables) of $m$
\item \# byte code instructions in $m$

\ei

\ei


% NOM, NOG, and NOS

The measures \NOM, \NOG, and \NOS define simple class-based counts:
 
\bi

\item NoM$(C)$: Counts all member functions defined by class $C$.

\item Getters$(C)$: 
Counts all non-overloaded member functions in a class $C$ with arity zero, whose name starts with the prefix ``get." 
Getters$(C) \subseteq$ NoM$(C)$.

\item Setters$(C)$: 
Counts all non-overloaded member functions in a class $C$ with arity one, whose name starts with the prefix ``set."
Setters$(C) \subseteq$ NoM$(C)$.

\ei

% IDC, ODC, and CCC

In order to collect the structural complexity measures \IDC, \ODC, and \CCC we need to construct a complete class dependency graph first. A class dependency graph is an ordered pair $(N, L)$, where $N$ is a finite, nonempty set of \emph{types} (\ie, classes and interfaces) and $L$ is a finite, possibly empty, set of \emph{directed links} between types (\ie, $L \subseteq N \times N$). We then analyze each node $n \in N$ in the graph to compute the structural complexity metrics of class $C$ type node $n$ represents as follows:

%\bi
\begin{itemize}

\item InDegree$(C) = |\{ (n',n) \in L\ |\ n \neq n' \}|$. 

\item OutDegree$(C) = |\{ (n,n') \in L\ |\ n \neq n' \}|$. 

\item Clustering Coefficient$(C) = \frac{\displaystyle{2|\{ (n_i,n_j) \in L\ |\ n_i,n_j \in N_n \}|}}{\displaystyle{|N_n|(|N_n| - 1)}}$, where $N_n$ is the neighborhood of $n$ with 
\begin{center}
$N_n = \{ n'\ |\ (n',n) \in L \vee (n,n') \in L \}$.
\end{center}
Thus, the Clustering Coefficient$(C)$ is defined over an undirected image of the class dependency graph.

\end{itemize}
%\ei



