Abstract:
Class Cohesion is an important software quality that can be used to improve software development process and assess the software product: process merit assessment and dependable software product. Many Class cohesion metrics measuring the relationship between methods and attributes have been developed and extensively researched. However, the use of relationships among attributes in measuring class cohesion from class scopes has been ignored and the effects of local variables on class cohesion need to be factored in the measurements. This thesis presents a new class cohesion metric that uses attributes relationships within class scopes. The data was collected from JavaScript, PHP, C++ and Java cluster classes using the Scoped Class Cohesion Metric (SCCM) software tool. The browser accessible JavaScript tool allows the user to select any cluster valid class, scans for the methods and attributes and output a metric value on the browser console. The analysed values of Scoped Class Cohesion Metric (SCCM) and Cohesion Metric (COH) showed that development of large classes with many attributes and methods possess low class cohesion compared to the small classes. Moreover, as the number of local variables increase within a class, the value of cohesion decreases and they should therefore be introduced or used only and only when necessary. This makes the software product more understandable, it improves class testing as well as easier maintenance consequently leading to an overall good quality software product.