Several cohesion metrics measuring quality of object-oriented programs have been proposed recently. Typically some kind of bipartite usage graph is calculated between methods of a class and its variables, and interpretations of what constitutes methods, variables, usage relation and calculation method have served as sources of variation. By advancing the usage of instance variables by the instance methods to measure relatedness of the class properties, the values given by metrics depend on implementation choices -how the contents of an object is presented as instance variable values. Another problem is that objects often consist of property sets that are only slightly related internally, but clients of objects make such connections between the property sets by advancing internally seemingly unrelated property sets simultaneously. In this paper, we propose forming cohesion graphs between the clients of a class and its abstract properties. Since abstract properties are usually not specified in program code, in practice we use the actual instance variables instead. Our approach complements the internal cohesion view with external views based on the external usage of class properties. We show results for some parts of the Java SDK 5.0 library.
The 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 nding code that should be refactored. Often refactoring or applying a design pattern is related to the role of the class to be refactored. In clientbased 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 dened 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 nd out, what kind of refactorings are needed. We also analyse the relation of dierent design patterns and refactorings to our metric. Our experiments reveal the usefulness of client-based metrics to improve the quality of code.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2025 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.