## 4 Empirical Evaluations Utilizing Open Source Systems  
To evaluate the proposed approach, we considered two real systems in this study: Tomcat[28] version 6.0.0 and Ant[29] version 1.5.2. Both of the two systems are open source, object-oriented, and written in Java. Tomcat is a system used to implement _Java Servlet_, _JavaServer Pages_, _and JavaWebSocket technologies_ and Ant is a Java library and command-line tool used mainly to build Java applications. Ten large classes are selected from each system based on the following two criteria. (1) The class has at least 8 public methods and (2) the cardinality of the union of the clients of the methods is at least 2. Tables 2 and 3 report the name of the Blob, the name of the package to which the class belongs, the number of public methods in the class (#Methods), and the cardinality of the union of the clients of each method in the class (#Clients). Our goal in the empirical evaluation is to investigate if the proposed refactoring approach can suggest to extract classes with cohesive responsibilities from a given class that has many non-cohesive responsibilities. For this purpose, we formulate the following research question. **RQ:** Do the extracted classes suggested by the proposed approach have higher cohesion than the original classes? To answer the above research question, we compare the cohesion of the original classes with the cohesion of the extracted classes. We measure class cohesion using \(CBCS\) given in Definition 6. \(CBCS\) is a variation of \(CCC\) which was proposed and validated in a previous works [7,8]. The original metric \(CCC\) measures the cohesion of a class based on the ratio of the summation of client-based class cohesion per each client of the class to the total number of clients of the class, where the client-based \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Class Name** & **Package Name** & **\#Methods** & **\#Clients** \\ \hline GenericServlet & javax.servlet & 12 & 21 \\ ServletResponseWrapper & javax.servlet & 17 & 36 \\ ServletRequestWrapper & javax.servlet & 31 & 50 \\ HttpServletRequestWrapper & javax.servlet.http & 25 & 35 \\ NoBodyResponse & javax.servlet.http & 32 & 38 \\ Request & org.apache.catalina.connector & 123 & 91 \\ ObjectReader & org.apache.catalina.tribes.io & 14 & 3 \\ XByteBuffer & org.apache.catalina.tribes.io & 40 & 24 \\ ChanneData & org.apache.catalina.tribes.io & 24 & 18 \\ MemberImpl & org.apache.catalina.tribes.membership & 39 & 22 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The classes selected from Tomcat 6.0.0. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Class Name** & **Package Name** & **\#Methods** & **\#Clients** \\ \hline Project & org.apache.tools.ant & 77 & 157 \\ Task & org.apache.tools.ant & 16 & 185 \\ Zip & org.apache.tools.ant.taskdefs & 19 & 4 \\ Ant & org.apache.tools.ant.taskdefs & 14 & 4 \\ Execute & org.apache.tools.ant.taskdefs & 15 & 31 \\ Extension & org.apache.tools.ant.taskdefs.optional.extension & 15 & 5 \\ VAJBuildInfo & org.apache.tools.ant.taskdefs.optional.ide & 19 & 4 \\ CommandineJava & org.apache.tools.ant.types & 25 & 12 \\ Commandine & org.apache.tools.ant.types & 22 & 62 \\ Path & org.apache.tools.ant.types & 20 & 67 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The classes selected from Ant 1.5.2.  
class cohesion per a client is defined as the number of methods used by the client divided by the total number of methods in the class. The reason of why we consider \(CBCS\) instead of \(CCC\) is that \(CBCS\) computes the similarities between each pair of methods in the class in order to measure the class cohesion while \(CCC\) does not, and cohesion metrics that compute the similarities between the methods are better in identifying the non-cohesive (dissimilar) methods that need to be separated into different classes [30]. We developed two tools to automate the application of our proposed approach. The first tool is implemented in Java and it is based on Eclipse JDT [31].