首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 296 毫秒
1.
ContextClass cohesion is an important object-oriented software quality attribute. Assessing class cohesion during the object-oriented design phase is one important way to obtain more comprehensible and maintainable software. In practice, assessing and controlling cohesion in large systems implies measuring it automatically. One issue with the few existing cohesion metrics targeted at the high-level design phase is that they are not based on realistic assumptions and do not fulfill expected mathematical properties.ObjectiveThis paper proposes a High-Level Design (HLD) class cohesion metric, which is based on realistic assumptions, complies with expected mathematical properties, and can be used to automatically assess design quality at early stages using UML diagrams.MethodThe notion of similarity between pairs of methods and pairs of attribute types in a class is introduced and used as a basis to introduce a novel high-level design class cohesion metric. The metric considers method–method, attribute–attribute, and attribute–method direct and transitive interactions. We validate this Similarity-based Class Cohesion (SCC) metric theoretically and empirically. The former includes a careful study of the mathematical properties of the metric whereas the latter investigates, using four open source software systems and 10 cohesion metrics, whether SCC is based on realistic assumptions and whether it better explains the presence of faults, from a statistical standpoint, than other comparable cohesion metrics, considered individually or in combination.ResultsResults confirm that SCC is based on clearly justified theoretical principles, relies on realistic assumptions, and is an early indicator of quality (fault occurrences).ConclusionIt is concluded that SCC is both theoretically valid and supported by empirical evidence. It is a better alternative to measure class cohesion than existing HLD class cohesion metrics.  相似文献   

2.
Improving the applicability of object-oriented class cohesion metrics   总被引:1,自引:0,他引:1  

Context

Class cohesion is an important object-oriented quality attribute. It refers to the degree of relatedness between the methods and attributes of a class. Several metrics have been proposed to measure the extent to which the class members are related. Most of these metrics have undefined values for a relatively high percentage of classes, which limits their applicability. The classes that have undefined values lack methods, attributes, or parameter types, or they include only a single method.

Objective

We improve the applicability of the class cohesion metrics by defining their values for such special classes. In addition, we theoretically and empirically validate the improved metrics.

Method

We theoretically examine whether the defined values satisfy the key cohesion properties. In addition, we empirically validate the metrics before and after the improvements to test whether the defined values improve the ability of the metrics to evaluate class cohesion. We also explore the correlation between the metrics and the presence of faulty classes to indirectly determine the strength or weakness of the metrics in indicating class quality.

Results

The results show that our assigned values for the undefined cases do not violate the key cohesion properties and considerably improve the ability of the metrics to explain the presence of faulty classes and may therefore improve their ability to indicate the quality of the class design.

Conclusions

Having the class cohesion metrics defined for all possible cases improves the applicability of the metrics and potentially increases their precision in indicating class quality.  相似文献   

3.
Class cohesion is a key attribute that is used to assess the design quality of a class, and it refers to the extent to which the attributes and methods of the class are related. Typically, classes contain special types of methods, such as constructors, destructors, and access methods. Each of these special methods has its own characteristics, which can artificially affect the class cohesion measurement. Several metrics have been proposed in the literature to indicate class cohesion during high- or low-level design phases. The impact of accounting for special methods in cohesion measurement has not been addressed for most of these metrics. This paper empirically explores the impact of including or excluding special methods on cohesion measurements that were performed using 20 existing class cohesion metrics. The empirical study applies the metrics that were considered to five open-source systems under four different scenarios, including (1) considering all special methods, (2) ignoring only constructors, (3) ignoring only access methods, and (4) ignoring all special methods. This study empirically explores the impact of including special methods in cohesion measurement for two applications of interest to software practitioners, including refactoring and predicting faulty classes. The results of the empirical studies show that the cohesion values for most of the metrics considered differ significantly across the four scenarios and that this difference significantly affects the refactoring decisions, but does not significantly affect the abilities of the metrics to predict faulty classes.  相似文献   

4.

Context

Several metrics have been proposed to measure the extent to which class members are related. Connectivity-based class cohesion metrics measure the degree of connectivity among the class members.

Objective

We propose a new class cohesion metric that has higher discriminative power than any of the existing cohesion metrics. In addition, we empirically compare the connectivity and non-connectivity-based cohesion metrics.

Method

The proposed class cohesion metric is based on counting the number of possible paths in a graph that represents the connectivity pattern of the class members. We theoretically and empirically validate this path connectivity class cohesion (PCCC) metric. The empirical validation compares seven connectivity-based metrics, including PCCC, and 11 non-connectivity-based metrics in terms of discriminative and fault detection powers. The discriminative-power study explores the probability that a cohesion metric will incorrectly determine classes to be cohesively equal when they have different connectivity patterns. The fault detection study investigates whether connectivity-based metrics, including PCCC, better explain the presence of faults from a statistical standpoint in comparison to other non-connectivity-based cohesion metrics, considered individually or in combination.

Results

The theoretical validation demonstrates that PCCC satisfies the key cohesion properties. The results of the empirical studies indicate that, in contrast to other connectivity-based cohesion metrics, PCCC is much better than any comparable cohesion metric in terms of its discriminative power. In addition, the results also indicate that PCCC measures cohesion aspects that are not captured by other metrics, wherein it is considerably better than other connectivity-based metrics but slightly worse than some other non-connectivity-based cohesion metrics in terms of its ability to predict faulty classes.

Conclusion

PCCC is more useful in practice for the applications in which practitioners need to distinguish between the quality of different classes or the quality of different implementations of the same class.  相似文献   

5.
In this paper, we consider cluster analysis based on T‐transitive interval‐valued fuzzy relations. A fuzzy relation with its partitional tree for obtaining an agglomerative hierarchical clustering has been studied and applied. In general, these fuzzy‐relation‐based clustering approaches are based on real‐valued memberships of fuzzy relations. Since interval‐valued memberships may be better than real‐valued memberships to represent higher order imprecision and vagueness for human perception, in this paper we first extend fuzzy relations to interval‐valued fuzzy relations and then construct a clustering algorithm based on the proposed T‐transitive interval‐valued fuzzy relations. We use two examples to demonstrate the efficiency and usefulness of the proposed method. In practical application, we apply the proposed clustering method to performance evaluations for academic departments of higher education by using actual engineering school data in Taiwan.  相似文献   

6.
In object-oriented systems, a single class consists of attributes and methods and its cohesion denotes the degree of relatedness among these elements. To quantify the cohesiveness of a class, a large number of measures that only depict method–attribute reference relationships have been proposed in last decade. However, the flow-dependence relationships among attributes, the direction of method–attribute references, and the potential dependence relationships among the elements in the class are ignored. To address this problem, this paper first depicts four types of explicit dependence relationships and uses a class element dependence graph to represent all dependencies among the elements in a class. Then, a dependence matrix that reflects the degree of direct dependence and indirect dependence among the elements in a class is computed. Finally, a more precise cohesion measure for classes is proposed.  相似文献   

7.
Hexahedral (hex‐) meshes are important for solving partial differential equations (PDEs) in applications of scientific computing and mechanical engineering. Many methods have been proposed aiming to generate hex‐meshes with high scaled Jacobians. While it is well established that a hex‐mesh should be inversion‐free (i.e. have a positive Jacobian measured at every corner of its hexahedron), it is not well‐studied that whether the scaled Jacobian is the most effective indicator of the quality of simulations performed on inversion‐free hex‐meshes given the existing dozens of quality metrics for hex‐meshes. Due to the challenge of precisely defining the relations among metrics, studying the correlations among different quality metrics and their correlations with the stability and accuracy of the simulations is a first and effective approach to address the above question. In this work, we propose a correlation analysis framework to systematically study these correlations. Specifically, given a large hex‐mesh dataset, we classify the existing quality metrics into groups based on their correlations, which characterizes their similarity in measuring the quality of hex‐elements. In addition, we rank the individual metrics based on their correlations with the accuracy and stability metrics for simulations that solve a number of elliptic PDE problems. Our preliminary experiments suggest that metrics that assess the conditioning of the elements are more correlated to the quality of solving elliptic PDEs than the others. Furthermore, an inversion‐free hex‐mesh with higher average quality (measured by any quality metrics) usually leads to a more accurate and stable computation of elliptic PDEs. To support our correlation study and address the lack of a publicly available large hex‐mesh dataset with sufficiently varying quality metric values, we also propose a two‐level perturbation strategy to generate the desired dataset from a small number of meshes to exclude the influences of element numbers, vertex connectivity, and volume sizes to our study.  相似文献   

8.
Recently, many computational intelligence algorithms have been proposed to address software remodularization problem. Unfortunately, it has been observed that the performance of optimizers degrades with the optimization problem containing more than three objectives. In this paper, we propose a many‐objective discrete harmony search (MaDHS) to address the software remodularization problem having more than three objectives. The basic idea of MaDHS is that it uses the quality indicator I? + and external archive to rank and store the nondominated solutions. Along with MaDHS, five remodularization objectives, ie, low coupling, high cohesion, low modification degree, quality of class distribution, and low package instability have also been adapted to improve the package structure of existing object‐oriented software systems. To improve the accuracy of modularization solution, the coupling and cohesion objectives are formulated in terms of various dimensions of direct coupling relationships. To test the supremacy of the proposed approach, it is evaluated over eight real‐world object‐oriented software systems. Simulation results show that the proposed approach outperforms the other existing approaches in terms of couplings, cohesion, modularization quality, modularization merit factor, rate per refactoring of achieved improvement, and external developers view.  相似文献   

9.
Measuring class cohesion based on dependence analysis   总被引:1,自引:0,他引:1       下载免费PDF全文
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.  相似文献   

10.
Similarity is a core concept in case‐based reasoning (CBR), because case base building, case retrieval, and even case adaptation all use similarity or similarity‐based reasoning. However, there is some confusion using similarity, similarity measures, and similarity metrics in CBR, in particular in domain‐dependent CBR systems. This article attempts to resolve this confusion by providing a unified framework for similarity, similarity relations, similarity measures, and similarity metrics, and their relationship. This article also extends some of the well‐known results in the theory of relations to similarity metrics. It appears that such extension may be of significance in case base building and case retrieval in CBR, as well as in various applied areas in which similarity plays an important role in system behavior. © 2002 Wiley Periodicals, Inc.  相似文献   

11.
周晓聪  赖蔚  温剑丰 《软件学报》2018,29(10):3051-3067
度量数据的分布信息对于理解和使用面向对象软件度量有重要意义.人们对面向对象软件规模度量、耦合度度量乃至继承维度的度量数据的分布都有研究,但对除内聚度缺乏度LCOM之外的内聚度度量数据的分布却缺乏研究.已有的实证研究表明,LCOM并不是好的内聚度度量,因此探讨其他内聚度度量数据分布很有必要.对包括内聚度缺乏度、基于连通性的内聚度度量和基于相似性的内聚度度量总共17个度量指标在112个Java开源软件项目的分布情况进行实证研究,对每个度量指标的每个项目数据使用幂律分布和对数正态分布进行拟合,并使用荟萃分析方法对拟合结果进行了分析.实证研究结果表明,非规范化的内聚度量可使用对数正态分布和幂律分布拟合,但规范化的基于相似性的内聚度量(包括CC、LSCC、SCOM和SCC)需要排除方法数小于等于1或字段数为0的特殊类才能使用对数正态分布拟合,而基于连通性的内聚度度量(包括TCC、LCC、DCD和DCI)则只有对应的非规范化版本的数据才符合对数正态分布或幂律分布.实证研究可帮助人们更好地理解和使用内聚度度量,特别是可以帮助人们如何利用已有的方法确定内聚度度量的阈值.  相似文献   

12.
This article studies the aggregation of transitive fuzzy relations. We first find operators that preserve transitivity and then extend the results to aggregating operators. As special cases, means and some kind of suitable ordered weighted averaging (OWAs) are used to aggregate transitive fuzzy relations with respect to an Archimedean t‐norm. Three families of transitive relations that allow us to modify the entries of a given relation R continuously towards the smallest and the greatest ones in our universe are given. Aggregation of nonfinite families of transitive relations also is studied and applied to calculate the degree of inclusion or similarity of fuzzy quantities (fuzzy subsets of an interval of the real line). © 2003 Wiley Periodicals, Inc.  相似文献   

13.
状态依赖的类内聚度量   总被引:1,自引:0,他引:1  
类是面向对象软件中的模块,包含属性和方法。类内聚度量是对类属性和方法相关程度的度量。通过对类方法和属性的分类及其与类状态之间的关系分析,提出了类核的概念和状态依赖的类内聚度量方法。该方法有利于克服类内聚度量复杂性和判断模糊性问题,并可以在设计阶段对类的内聚进行度量。  相似文献   

14.
一种基于依赖性分析的类内聚度度量方法   总被引:8,自引:2,他引:8  
陈振强  徐宝文 《软件学报》2003,14(11):1849-1856
内聚度是指模块内各成分之间的联结强度.在面向对象程序中,内聚度主要是指类内部各成分之间的联结强度.在深入剖析了类的属性与属性、方法与属性以及方法与方法之间的关系及其性质的基础上,提出了一种基于依赖性分析的内聚度度量方法,并证明了它满足优良的内聚度度量方法应该具有的性质,从而克服了已有方法只是分析了某个方面的不足,为综合评价类内聚度提供了指南。  相似文献   

15.
A Lyapunov direct method is presented for a class of second‐order systems that includes mechanical systems. This method shall be called a pseudo‐energy shaping method because it reduces to the energy shaping method when a given second‐order system is a mechanical system. The pseudo‐energy shaping method comprehends both the Lyapunov direct method for mechanical systems proposed by Aguilar‐Ibañez and the controlled Lagrangian method that has been successfully applied to stabilize mechanical systems. A class of second‐order systems including mechanical systems is defined first. For this class, matching conditions are derived for the construction of an energy‐like Lyapunov function that shall be called a pseudo‐energy function. Easily verifiable conditions are then presented for stabilizability by the pseudo‐energy shaping method for a class of second‐order linear systems and for a class of second‐order nonlinear systems with one degree of under‐actuation. These results are applied to stabilize a two‐dimensional overhead crane system and a three‐link robot arm system. Copyright © 2011 John Wiley & Sons, Ltd.  相似文献   

16.
Rescaling is possibly the most popular approach to cost‐sensitive learning. This approach works by rebalancing the classes according to their costs, and it can be realized in different ways, for example, re‐weighting or resampling the training examples in proportion to their costs, moving the decision boundaries of classifiers faraway from high‐cost classes in proportion to costs, etc. This approach is very effective in dealing with two‐class problems, yet some studies showed that it is often not so helpful on multi‐class problems. In this article, we try to explore why the rescaling approach is often helpless on multi‐class problems. Our analysis discloses that the rescaling approach works well when the costs are consistent, while directly applying it to multi‐class problems with inconsistent costs may not be a good choice. Based on this recognition, we advocate that before applying the rescaling approach, the consistency of the costs must be examined at first. If the costs are consistent, the rescaling approach can be conducted directly; otherwise it is better to apply rescaling after decomposing the multi‐class problem into a series of two‐class problems. An empirical study involving 20 multi‐class data sets and seven types of cost‐sensitive learners validates our proposal. Moreover, we show that the proposal is also helpful for class‐imbalance learning.  相似文献   

17.
High cohesion is a desirable property of software as it positively impacts understanding, reuse, and maintenance. Currently proposed measures for cohesion in Object-Oriented (OO) software reflect particular interpretations of cohesion and capture different aspects of it. Existing approaches are largely based on using the structural information from the source code, such as attribute references, in methods to measure cohesion. This paper proposes a new measure for the cohesion of classes in OO software systems based on the analysis of the unstructured information embedded in the source code, such as comments and identifiers. The measure, named the Conceptual Cohesion of Classes (C3), is inspired by the mechanisms used to measure textual coherence in cognitive psychology and computational linguistics. This paper presents the principles and the technology that stand behind the C3 measure. A large case study on three open source software systems is presented which compares the new measure with an extensive set of existing metrics and uses them to construct models that predict software faults. The case study shows that the novel measure captures different aspects of class cohesion compared to any of the existing cohesion measures. In addition, combining C3 with existing structural cohesion metrics proves to be a better predictor of faulty classes when compared to different combinations of structural cohesion metrics.  相似文献   

18.
Debugging is crucial for producing reliable software. One of the effective bug localization techniques is spectral‐based fault localization. It tries to locate a buggy statement by applying an evaluation metric to program spectra and ranking program components on the basis of the score it computes. Here, we propose a restricted class of “hyperbolic” metrics, with a small number of numeric parameters. This class of functions is based on past theoretical and empirical results. We show that optimization methods such as genetic programming and simulated annealing can reliably discover effective metrics over a wide range of data sets of program spectra. We evaluate the performance for both real programs and model programs with single bugs, multiple bugs, “deterministic” bugs, and nondeterministic bugs and find that the proposed class of metrics performs as well as or better than the previous best‐performing metrics over a broad range of data.  相似文献   

19.
Approaches for improving class cohesion identify refactoring opportunities using metrics that capture structural relationships between the methods of a class, e.g., attribute references. Semantic metrics, e.g., C3 metric, have also been proposed to measure class cohesion, as they seem to complement structural metrics. However, until now semantic relationships between methods have not been used to identify refactoring opportunities. In this paper we propose an Extract Class refactoring method based on graph theory that exploits structural and semantic relationships between methods. The empirical evaluation of the proposed approach highlighted the benefits provided by the combination of semantic and structural measures and the potential usefulness of the proposed method as a feature for software development environments.  相似文献   

20.
The existing cohesion metrics for classes do not consider the characteristics of dependent instance variables that are commonly used in a class and, thus, do not properly reflect the cohesiveness of the class. This paper presents an approach for improving the cohesion metrics by considering the characteristics of the dependent instance variables in an object-oriented program.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号