This paper suggests that a single class rather than methods should be used as the slice scope to compute class cohesion. First, for a given attribute, the statements in all methods that last define the attribute are c...This paper suggests that a single class rather than methods should be used as the slice scope to compute class cohesion. First, for a given attribute, the statements in all methods that last define the attribute are computed. Then, the forward and backward data slices for this attribute are generated by using the class as the slice scope and are combined to compute the corresponding class data slice. Finally, the class cohesion is computed based on all class data slices for the attributes. Compared to traditional cohesion metrics that use methods as the slice scope, the proposed metrics that use a single class as slice scope take into account the possible interactions between the methods. The experimental results show that class cohesion can be more accurately measured when using the class as the slice scope.展开更多
Classes are the basic modules in object-oriented (OO) software, which consist of attributes and methods. Thus, in OO environment, the cohesion is mainly about the tightness of the attributes and methods of classes. Th...Classes are the basic modules in object-oriented (OO) software, which consist of attributes and methods. Thus, in OO environment, the cohesion is mainly about the tightness of the attributes and methods of classes. This paper discusses the relationships between attributes and attributes, attributes and methods, methods and methods of a class based on dependence analysis. Then the paper presents methods to compute these dependencies. Based on these, the paper proposes a method to measure the class cohesion, which satisfies the properties that a good measurement should have. The approach overcomes the limitations of previous class cohesion measures, which consider only one or two of the three relationships in a class. Keywords cohesion - object-orientation - class - program complexity - dependence analysis Supported by the National Natural Science Foundation of China under Grant No.60073012; the National Basic Research 973 Program of China under Grant No.2002CB312000; the Program for Cross-Century Outstanding Teachers of the Ministry of Education; the National Research Foundation for the Doctoral Program of Higher Education of China under Grant No.20020286004; the Natural Science Foundation of Jiangsu, China, under Grant No.BK2001004; the Jiangsu Key Science and Technology Project under Grant No.BE2001025; the Opening Foundation of State Key Laboratory of Software Engineering in Wuhan University; the Opening Foundation of Jiangsu Key Laboratory of Computer Information Processing Technology in Soochow University.Zheng-Qiang Chen was born in 1976. He received the M.S. and Ph.D. degrees in computer science in 2000 and 2003, respectively. His current research interests include program analysis, understanding and testing as well as other topics related to reverse engineering. He has published more than 30 technical papers.Bao-Wen Xu was born in 1961. He received the M.S. and Ph.D. degrees in computer science in 1984 and 2002, respectively. He is a professor in the Computer Science & Engineering Department of Southeast 展开更多
Cohesion is a design quality that has a great im- pact on the posterior development and maintenance. As software evolves, the cohesion of the system becomes weaker due to the changes introduced during evolution. Over ...Cohesion is a design quality that has a great im- pact on the posterior development and maintenance. As software evolves, the cohesion of the system becomes weaker due to the changes introduced during evolution. Over evolution, a single responsibility class may be unintentionally assigned other responsibilities, which makes the class less cohesive and more complex and consequently increases the complexity of the entire system. There has been much work on decomposing class responsibilities based on internal class relationships such as method-attribute referencing and internal method calls. However, object-oriented systems involve significant external class relationships carrying important behavioral semantics, which should be taken into account in identifying class responsibilities. In this paper, we present a novel approach for identifying and decomposing classes responsibilities based on method similarity using both internal and external class relationships. We extend the existing work for measuring similarity of internal class relationships and present a distance-based method for measuring external class relationships. We evaluate the approach using three open source applications -- JMeter, JHotDraw, and ArgoUML. The evaluation shows that the presented approach improves precision over the existing work. We validate the results using independent samples T-test and ANOVA applied to a set of hypotheses. The validation confirms that the results are statistically significant.展开更多
In object oriented paradigm, cohesion of a class refers to the degree to which members of the class are interrelated. Metrics have been defined to measure cohesiveness of a class both at design and source code levels....In object oriented paradigm, cohesion of a class refers to the degree to which members of the class are interrelated. Metrics have been defined to measure cohesiveness of a class both at design and source code levels. In comparison to source code level class cohesion metrics, only a few design level class cohesion metrics have been proposed. Design level class cohesion metrics are based on the assumption that if all the methods of a class have access to similar para-meter types then they all process closely related information. A class with a large number of parameter types common in its methods is more cohesive than a class with less number of parameter types common in its methods. In this paper, we review the design level class cohesion metrics with a special focus on metrics which use similarity of parameter types of methods of a class as the basis of its cohesiveness. Basically three metrics fall in this category: Cohesion among Methods of a Class (CAMC), Normalized Hamming Distance (NHD), and Scaled NHD (SNHD). Keeping in mind the anomalies in the definitions of the existing metrics, a variant of the existing metrics is introduced. It is named NHD Modified (NHDM). An automated metric collection tool is used to collect the metric data from an open source software program. The metric data is then subjected to statistical analysis.展开更多
基金The National Natural Science Foundation of China(No.60425206,60633010)the High Technology Research and Development Program of Jiangsu Province(No.BG2005032)
文摘This paper suggests that a single class rather than methods should be used as the slice scope to compute class cohesion. First, for a given attribute, the statements in all methods that last define the attribute are computed. Then, the forward and backward data slices for this attribute are generated by using the class as the slice scope and are combined to compute the corresponding class data slice. Finally, the class cohesion is computed based on all class data slices for the attributes. Compared to traditional cohesion metrics that use methods as the slice scope, the proposed metrics that use a single class as slice scope take into account the possible interactions between the methods. The experimental results show that class cohesion can be more accurately measured when using the class as the slice scope.
文摘Classes are the basic modules in object-oriented (OO) software, which consist of attributes and methods. Thus, in OO environment, the cohesion is mainly about the tightness of the attributes and methods of classes. This paper discusses the relationships between attributes and attributes, attributes and methods, methods and methods of a class based on dependence analysis. Then the paper presents methods to compute these dependencies. Based on these, the paper proposes a method to measure the class cohesion, which satisfies the properties that a good measurement should have. The approach overcomes the limitations of previous class cohesion measures, which consider only one or two of the three relationships in a class. Keywords cohesion - object-orientation - class - program complexity - dependence analysis Supported by the National Natural Science Foundation of China under Grant No.60073012; the National Basic Research 973 Program of China under Grant No.2002CB312000; the Program for Cross-Century Outstanding Teachers of the Ministry of Education; the National Research Foundation for the Doctoral Program of Higher Education of China under Grant No.20020286004; the Natural Science Foundation of Jiangsu, China, under Grant No.BK2001004; the Jiangsu Key Science and Technology Project under Grant No.BE2001025; the Opening Foundation of State Key Laboratory of Software Engineering in Wuhan University; the Opening Foundation of Jiangsu Key Laboratory of Computer Information Processing Technology in Soochow University.Zheng-Qiang Chen was born in 1976. He received the M.S. and Ph.D. degrees in computer science in 2000 and 2003, respectively. His current research interests include program analysis, understanding and testing as well as other topics related to reverse engineering. He has published more than 30 technical papers.Bao-Wen Xu was born in 1961. He received the M.S. and Ph.D. degrees in computer science in 1984 and 2002, respectively. He is a professor in the Computer Science & Engineering Department of Southeast
文摘Cohesion is a design quality that has a great im- pact on the posterior development and maintenance. As software evolves, the cohesion of the system becomes weaker due to the changes introduced during evolution. Over evolution, a single responsibility class may be unintentionally assigned other responsibilities, which makes the class less cohesive and more complex and consequently increases the complexity of the entire system. There has been much work on decomposing class responsibilities based on internal class relationships such as method-attribute referencing and internal method calls. However, object-oriented systems involve significant external class relationships carrying important behavioral semantics, which should be taken into account in identifying class responsibilities. In this paper, we present a novel approach for identifying and decomposing classes responsibilities based on method similarity using both internal and external class relationships. We extend the existing work for measuring similarity of internal class relationships and present a distance-based method for measuring external class relationships. We evaluate the approach using three open source applications -- JMeter, JHotDraw, and ArgoUML. The evaluation shows that the presented approach improves precision over the existing work. We validate the results using independent samples T-test and ANOVA applied to a set of hypotheses. The validation confirms that the results are statistically significant.
文摘In object oriented paradigm, cohesion of a class refers to the degree to which members of the class are interrelated. Metrics have been defined to measure cohesiveness of a class both at design and source code levels. In comparison to source code level class cohesion metrics, only a few design level class cohesion metrics have been proposed. Design level class cohesion metrics are based on the assumption that if all the methods of a class have access to similar para-meter types then they all process closely related information. A class with a large number of parameter types common in its methods is more cohesive than a class with less number of parameter types common in its methods. In this paper, we review the design level class cohesion metrics with a special focus on metrics which use similarity of parameter types of methods of a class as the basis of its cohesiveness. Basically three metrics fall in this category: Cohesion among Methods of a Class (CAMC), Normalized Hamming Distance (NHD), and Scaled NHD (SNHD). Keeping in mind the anomalies in the definitions of the existing metrics, a variant of the existing metrics is introduced. It is named NHD Modified (NHDM). An automated metric collection tool is used to collect the metric data from an open source software program. The metric data is then subjected to statistical analysis.