{"title":"Lack of Conceptual Cohesion of Methods: A new alternative to Lack Of Cohesion of Methods","authors":"Vaibhav Jain, Arpit Gupta","doi":"10.1145/2723742.2723753","DOIUrl":null,"url":null,"abstract":"While often defined in informal ways, class cohesion reflects important properties of modules in a software system. High cohesion for classes is one of the desirable properties in Object Oriented (OO) analysis as it supports program comprehension, testing, reusability, maintainability. Cohesion metrics have been used for quality assessment, fault prediction, software modularization etc. Existing approaches of class cohesion metrics are largely based on the structural information of the source code, such as attribute references in class methods. These cohesion metrics reflect particular interpretations of cohesion. However, only looking at structural aspect of cohesion is not sufficient for completely and accurately specifying class cohesion. So there is a need to pay attention on other aspects of cohesion like conceptual aspect. But only few conceptual metrics have been proposed till now. In our work, we have proposed a new set of cohesion metrics named LCCM (Lack of Conceptual Cohesion of Methods) metrics. These cohesion metrics are conceptual version of widely used LCOM (Lack of Cohesion of methods) metrics. LCOM metrics measure cohesion on structural information extracted entirely from the source code (e.g., attribute references in methods and method calls) that captures the degree to which the elements of a class belong together from a structural point of view. Proposed LCCM metrics use conceptual concerns embedded in source code entities for measuring class cohesion. These metrics are based on the analysis of latent topics embedded in comments and identifiers in source code. Latent Drichlet Allocation (LDA), a topic modeling tool is used for this purpose. These topics are used by proposed LCCM metrics to define similarity between methods of a class and on the basis of this similarity; proposed LCCM metrics define cohesion of the class. For the verification of proposed metrics, a case study on an open source java software system, called Rhino, is performed. The case study indicates that the novel cohesion metrics capture different aspects of class cohesion compared to the exiting cohesion metrics.","PeriodicalId":288030,"journal":{"name":"Proceedings of the 8th India Software Engineering Conference","volume":"20 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2015-02-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 8th India Software Engineering Conference","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2723742.2723753","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1
Abstract
While often defined in informal ways, class cohesion reflects important properties of modules in a software system. High cohesion for classes is one of the desirable properties in Object Oriented (OO) analysis as it supports program comprehension, testing, reusability, maintainability. Cohesion metrics have been used for quality assessment, fault prediction, software modularization etc. Existing approaches of class cohesion metrics are largely based on the structural information of the source code, such as attribute references in class methods. These cohesion metrics reflect particular interpretations of cohesion. However, only looking at structural aspect of cohesion is not sufficient for completely and accurately specifying class cohesion. So there is a need to pay attention on other aspects of cohesion like conceptual aspect. But only few conceptual metrics have been proposed till now. In our work, we have proposed a new set of cohesion metrics named LCCM (Lack of Conceptual Cohesion of Methods) metrics. These cohesion metrics are conceptual version of widely used LCOM (Lack of Cohesion of methods) metrics. LCOM metrics measure cohesion on structural information extracted entirely from the source code (e.g., attribute references in methods and method calls) that captures the degree to which the elements of a class belong together from a structural point of view. Proposed LCCM metrics use conceptual concerns embedded in source code entities for measuring class cohesion. These metrics are based on the analysis of latent topics embedded in comments and identifiers in source code. Latent Drichlet Allocation (LDA), a topic modeling tool is used for this purpose. These topics are used by proposed LCCM metrics to define similarity between methods of a class and on the basis of this similarity; proposed LCCM metrics define cohesion of the class. For the verification of proposed metrics, a case study on an open source java software system, called Rhino, is performed. The case study indicates that the novel cohesion metrics capture different aspects of class cohesion compared to the exiting cohesion metrics.