Where academic tradition
meets the exciting future

Client-Based Cohesion Metrics for Java Programs

Sami Mäkelä, Ville Leppänen, Client-Based Cohesion Metrics for Java Programs. Science of Computer Programming 74(5-6), 355–378, 2009.

Abstract:

One purpose of software metrics is to measure the quality of programs. The results can be for example used to predict maintenance costs or improve code quality. An emerging view is that if software metrics are going to be used to improve quality, they must help in finding code that should be refactored. Often refactoring or applying a design pattern is related to the role of the class to be refactored. In client-based metrics, a project gives the class a context. These metrics measure how a class is used by other classes in the context. We present a new client-based metric LCIC (Lack of Coherence in Clients), which analyses if the class being measured has a coherent set of roles in the program. Interfaces represent the roles of classes. If a class does not have a coherent set of roles, it should be refactored, or a new interface should be defined for the class. We have implemented a tool for measuring the metric LCIC for Java projects in the Eclipse environment. We calculated LCIC values for classes of several open source projects. We compare these results with results of other related metrics, and inspect the measured classes to find out what kind of refactorings are needed. We also analyse the relation of different design patterns and refactorings to our metric. Our experiments reveal the usefulness of client-based metrics to improve the quality of code.

BibTeX entry:

@ARTICLE{jMaLe09a,
  title = {Client-Based Cohesion Metrics for Java Programs},
  author = {Mäkelä, Sami and Leppänen, Ville},
  journal = {Science of Computer Programming},
  volume = {74},
  number = {5-6},
  pages = {355–378},
  year = {2009},
}

Belongs to TUCS Research Unit(s): Algorithmics and Computational Intelligence Group (ACI)

Publication Forum rating of this publication: level 2

Edit publication