首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 125 毫秒
1.
本文首先介绍了面向对象软件的特征,然后具体分析了C&K度量法,着重分析了其中与类继承相关的继承树深度(DIT)和孩子数目(NOC)度量准则。在此基础上,通过分析超类与其子类中元素(方法和属性)的继承关系,提出了基于继承的内聚度度量方法,从而克服了C&K度量法中对类继承性、多态性方面度量的不足,为综合评价类的内聚度度提供了指南。  相似文献   

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

3.
面向对象软件度量中的内聚缺乏度分析   总被引:9,自引:0,他引:9  
从理论和实验两方面对面向对象软件度量中内聚缺乏度本质与表现进行了较深入的分析 ,给出了内聚缺乏度的 3种定义 :α,β和γ,比较了它们的优点和缺点 .理论与实验均表明 ,α内聚缺乏度 (也就是 C& K内聚缺乏度 )和β内聚缺乏度均没有“度”的含义 .而γ内聚缺乏度有较好的特性 ,但对于方法数特别少的类 ,稳定性差 .还简要分析了基于α内聚缺乏度 (C& K内聚缺乏度 )派生出的两种内聚缺乏度定义 ,即β′和γ′内聚缺乏度 ,它们与β和γ内聚缺乏度有相同的性质 .并指出 ,内聚缺乏度研究应当与程序员心理学研究相结合 .  相似文献   

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

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

6.
一个面向对象软件度量工具的实现和度量实验研究   总被引:26,自引:0,他引:26  
李心科  刘宗田  潘飚  邢大红 《计算机学报》2000,23(11):1220-1225
介绍了面向对象软件C&K度量学理论与方法,结合C++语言的特征,分析了C&K度量指标存在的缺点,提出了改进方法.然后描述了作者开发的基于改进C&K度量学理论与方法的针对C++的软件度量工具SMTCPP,该工具使用LL(1)分析法对源程序进行语法分析,从而提取程序中有关类、类成员、成员函数、对象等信息,计算出类的方法数、方法最大复杂度、继承树深度、子类数目、耦合度、响应集、相对内聚缺乏度等指标,以指导软件开发过程.这些度量结果还可以存放在数据库中,以便为建立软件质量评价模型收集充足的数据.论文最后对采用SMTCPP所做的3个实用软件度量实验结果进行了分析,表明了SMTCPP的实用性.  相似文献   

7.
软件系统开发时应遵循“高内聚、低耦合”的软件工程原则,但内聚度本身是主观的、非形式化的概念,程序设计人员很难客观地评估一个模块的内聚度。在面向对象系统中,内聚度主要是指类内部各成份之间的联结强度。  相似文献   

8.
肖瑶  张为群 《计算机科学》2007,34(5):280-284
利用有向带权伪图(Directed Weighted False Chart, DWFC)表示面向对象程序中类内部成员间的依赖关系,提出一种基于DWFE的面向对象类内聚度量方法,结合PSP(Personal Software Process)技术中PROBE(PROx Based Estimating)规模估算方法,改进了良好内聚度量方法的验证准则,并结合实验验证了该方法的优越性。  相似文献   

9.
齐晶晶  郭跟成 《计算机应用》2006,26(5):1183-1185
本文主要是以一种有向带权类依赖图作为面向对象系统的UML类图的抽象表示,结合信息熵技术针对软件构件进行内聚耦合性及独立性度量。通过实验表明,该方法是一种较准确的软件构件度量方法,为权衡构件的设计质量提供了可靠的数据。  相似文献   

10.
随着软件开发迭代速度的加快,开发人员在编码过程中往往由于交付压力等种种原因违反软件设计的基本原则,造成代码坏味,进而影响软件质量.上帝类是最常见的代码坏味之一,指承担了太多职责的类.上帝类违反"高内聚、低耦合"的设计原则,损害软件系统的质量,会影响代码的可理解性和可维护性.因此,文中提出一种新的上帝类检测方法.首先抽取实际项目中方法在演化、语义等维度上的特征;然后对演化、语义特征进行融合,并基于融合后的结果重新聚类,将彼此关系紧密的方法重新划归到新的类簇中;通过分析实际项目中各个类的成员方法在新的聚类结果中的分布情况,计算类的内聚度,从而找出内聚度低的类作为上帝类检测结果.实验表明,所提方法优于目前主流的上帝类检测方法.与基于度量的传统检测方法相比,该方法在查全率、查准率上均提升超过20个百分点;与基于机器学习的检测方法相比,该方法尽管查全率略低,但查准率、F1值均有显著提升.  相似文献   

11.
One 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 finding code that should be refactored. Often refactoring or applying a design pattern is related to the role of the class to be refactored. In client-based 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 defined 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 find out what kind of refactorings are needed. We also analyse the relation of different design patterns and refactorings to our metric. Our experiments reveal the usefulness of client-based metrics to improve the quality of code.  相似文献   

12.
A new class of metrics, called path-generated metrics, is defined for the digital plane. There are essentially five different metrics in the class, including the classical city block and chessboard metrics.  相似文献   

13.
Software metrics are computed for the purpose of evaluating certain characteristics of the software developed. A Fortran static source code analyzer, FORTRANAL, was developed to study 31 metrics, including a new hybrid metric introduced in this paper, and applied to a database of 255 programs, all of which were student assignments. Comparisons among these metrics are performed. Their cross-correlation confirms the internal consistency of some of these metrics which belong to the same class. To remedy the incompleteness of most of these metrics, the proposed metric incorporates context sensitivity to structural attributes extracted from a flow graph. It is also concluded that many volume metrics have similar performance while some control metrics surprisingly correlate well with typical volume metrics in the test samples used. A flexible class of hybrid metric can incorporate both volume and control attributes in assessing software complexity.  相似文献   

14.
Previous research shows that class size can influence the associations between object-oriented (OO) metrics and fault-proneness and therefore proposes that it should be controlled as a confounding variable when validating OO metrics on fault-proneness. Otherwise, their true associations may be distorted. However, it has not been determined whether this practice is equally applicable to other external quality attributes. In this paper, we use three size metrics, two of which are available during the high-level design phase, to examine the potentially confounding effect of class size on the associations between OO metrics and change-proneness. The OO metrics that are investigated include cohesion, coupling, and inheritance metrics. Our results, based on Eclipse, indicate that: 1) The confounding effect of class size on the associations between OO metrics and change-proneness, in general, exists, regardless of whichever size metric is used; 2) the confounding effect of class size generally leads to an overestimate of the associations between OO metrics and change-proneness; and 3) for many OO metrics, the confounding effect of class size completely accounts for their associations with change-proneness or results in a change of the direction of the associations. These results strongly suggest that studies validating OO metrics on change-proneness should also consider class size as a confounding variable.  相似文献   

15.
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.  相似文献   

16.

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.  相似文献   

17.
Many empirical studies have found that software metrics can predict class error proneness and the prediction can be used to accurately group error-prone classes. Recent empirical studies have used open source systems. These studies, however, focused on the relationship between software metrics and class error proneness during the development phase of software projects. Whether software metrics can still predict class error proneness in a system’s post-release evolution is still a question to be answered. This study examined three releases of the Eclipse project and found that although some metrics can still predict class error proneness in three error-severity categories, the accuracy of the prediction decreased from release to release. Furthermore, we found that the prediction cannot be used to build a metrics model to identify error-prone classes with acceptable accuracy. These findings suggest that as a system evolves, the use of some commonly used metrics to identify which classes are more prone to errors becomes increasingly difficult and we should seek alternative methods (to the metric-prediction models) to locate error-prone classes if we want high accuracy.  相似文献   

18.
Much effort has been devoted to the development and empirical validation of object-oriented metrics. The empirical validations performed thus far would suggest that a core set of validated metrics is close to being identified. However, none of these studies allow for the potentially confounding effect of class size. We demonstrate a strong size confounding effect and question the results of previous object-oriented metrics validation studies. We first investigated whether there is a confounding effect of class size in validation studies of object-oriented metrics and show that, based on previous work, there is reason to believe that such an effect exists. We then describe a detailed empirical methodology for identifying those effects. Finally, we perform a study on a large C++ telecommunications framework to examine if size is really a confounder. This study considered the Chidamber and Kemerer metrics and a subset of the Lorenz and Kidd metrics. The dependent variable was the incidence of a fault attributable to a field failure (fault-proneness of a class). Our findings indicate that, before controlling for size, the results are very similar to previous studies. The metrics that are expected to be validated are indeed associated with fault-proneness  相似文献   

19.
Jehad Al Dallal 《Software》2013,43(6):685-704
Class cohesion metrics apply different approaches to quantify the relatedness of the attributes and methods in a class. These relations can be direct or transitive. Method invocations are among the key sources of potential transitive attribute–method relations. That is, a method is not only related to the attributes that it references, but it may also be transitively related to the attributes referenced by the methods that it invokes. A few of the existing class cohesion metrics capture this potential transitive cohesion aspect. In this paper, we classify the method invocations as direct or transitive. The definitions of the class representative models used by 16 existing low‐level design (LLD) metrics are extended to incorporate the cohesion caused by the two types of method invocations. The impact of incorporating the transitive relations because of the two types of method invocations on the cohesion values and on the ability of the LLD metrics to predict faulty classes are studied empirically. The results show that the transitive relations because of both types of method invocations featured a considerable degree of cohesion that is not captured by most of the existing LLD metrics. However, practically, incorporating transitive relations in cohesion measurement was found to be ineffective in improving the fault‐prediction powers of most of the LLD metrics. Copyright © 2012 John Wiley & Sons, Ltd.  相似文献   

20.
面向对象程序复杂性度量层次模型   总被引:2,自引:2,他引:2  
程序复杂性度量可以实现定量地分析程序复杂性,从而为估计成本提供一个标准。为了度量面向对象程序复杂性,在讨论了度量的定义.度量的理论基础后,提出了一种面向对象程序复杂性度量的层次模型。该模型分成5个层次:系统层、类簇层、类继承树层、类层和方法层,每个层次都有自己的度量方法。采用这种分层度量模型的好处是:它是一个框架,各度量方法归属到各层中;各层之间相互独立;一层中方法的修改并不影响其它层。  相似文献   

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

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

京公网安备 11010802026262号