首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 296 毫秒
1.
面向对象软件度量学的研究   总被引:1,自引:0,他引:1  
姚珺 《福建电脑》2005,(12):25-26,17
软件度量学是软件工程领域的一个重要研究方向。通过软件度量,可以降低软件开发的成本,提高软件开发的效率,保证软件能满足用户的需求,开发出高质量的软件。本文分析了面向对象软件度量的特点,在著名的C&K度量方法及其它度量方法的基础上,着重阐述了针对各种不同层次的面向对象的软件度量,包括面向OO项目的度量、面向OO系统的度量、面向类继承树的度量、面向类层的度量、面向方法(操作)的度量。  相似文献   

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

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

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

5.
肖汉 《计算机科学》2006,33(3):252-254
软件产品复杂度在软件度量领域是一个非常重要的方面.软件开发的成本、进度和潜伏的错误数量都与复杂度有密切的关联.由于OOA和OOD被广泛运用,面向对象的软件度量已成为面向对象软件工程一个不可分割的部分.本文通过分析C&K和Lorenz&Kidd度量方法,提出了适用于JAVA语言特征的面向对象的类复杂性度量方法.  相似文献   

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

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

8.
一种面向对象继承复杂性的综合度量   总被引:2,自引:1,他引:1       下载免费PDF全文
通过对面向对象系统和当前存在的面向对象度量方法进行分析,提取出与面向对象继承复杂性度量相关的量度。修改并整合这些量度,提出了一种类级继承复杂性和系统级继承复杂性度量方法。经过修改后得出反映继承复杂性的量度有:继承成员个数(NIM)、覆盖成员个数(NOM)、成员名重复数(NRN)、继承路径长度(LIP)、访问方式改变数(NMA)。由此,通过整合可以得到对类级继承复杂性和系统级继承复杂性度量方法。最后,通过与其他度量方法进行比较,说明了该方法对面向对象继承复杂性的度量更为适合。  相似文献   

9.
分析了C&K度量组中耦合度量指标(CBO)存在的问题,对其进行了改进,提出了一组正交的面向对象耦合度量(Orthogonal Coupling Metrics Suite for Object—Oriented Design,OCMOOD)。并在Frank Sauer开发的Eclipse度量计算插件的基础上实现了Oc—MOOD的自动计算,分析了JUnit3.8.1和JUnit3.7的OCMOOD度量值的计算结果,从而对OCMOOD的有效性进行了验证。  相似文献   

10.
黄子杰  陈军华  高建华 《软件学报》2021,32(8):2505-2521
Code Smell是软件程序中存在不良设计和不良实现的征兆.正确地检测和识别Code Smell可以指导软件重构,提高软件的可用性和可靠性.通过Code Smell的度量指标,可以量化软件的设计问题.JavaScript已成为最常用的编程语言之一,类是JavaScript的设计模式,优秀类的设计体现为高内聚和低耦合.现有关于JavaScript内聚耦合的Code Smell研究均在微观的层面,即函数和语句上进行.它们可以提供程序实现的重构建议,但无法分析内聚耦合相关的软件系统设计问题.针对FE、DC和Blob这3种类的内聚耦合Code Smell,提出一种JavaScript类的内聚耦合Code Smell检测方法JS4C.该方法基于静态分析,同时适用于客户端和服务端程序.它通过遍历软件系统中所有的类,利用源程序的文本相似度特征和结构特征,识别Code Smell并检测其强度.在结构特征检测中,JS4C使用了经扩展的对象类型推断及非严格的耦合分散度度量法NSCDISP,有效地降低了解释型语言的静态分析过程中,类型信息缺失对检测产生的影响.实验通过对6个开源项目的分析表明,JS4C对内聚耦合设计问题有良好的检测效果.  相似文献   

11.
软件度量是保证软件质量的重要方法,该文主要针对面向对象软件经过分析度量后得出结果进行分析与评价,分析与评价主要基于面向对象程序中类的耦合度、内聚度、继承性、复杂度等进行展开,从数学的角度来分析度量指标的可信度,以保证从整体上把握面向对象软件产品的质量。  相似文献   

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

13.
Many studies have investigated the relationships between object-oriented (OO) metrics and change-proneness and conclude that OO metrics are able to predict the extent of change of a class across the versions of a system. However, there is a need to re-examine this subject for two reasons. First, most studies only analyze a small number of OO metrics and, therefore, it is not clear whether this conclusion is applicable to most, if not all, OO metrics. Second, most studies only uses relatively few systems to investigate the relationships between OO metrics and change-proneness and, therefore, it is not clear whether this conclusion can be generalized to other systems. In this paper, based on 102 Java systems, we employ statistical meta-analysis techniques to investigate the ability of 62 OO metrics to predict change-proneness. In our context, a class which is changed in the next version of a system is called change-prone and not change-prone otherwise. The investigated OO metrics cover four metric dimensions, including 7 size metrics, 18 cohesion metrics, 20 coupling metrics, and 17 inheritance metrics. We use AUC (the area under a relative operating characteristic, ROC) to evaluate the predictive effectiveness of OO metrics. For each OO metric, we first compute AUCs and the corresponding variances for individual systems. Then, we employ a random-effect model to compute the average AUC over all systems. Finally, we perform a sensitivity analysis to investigate whether the AUC result from the random-effect model is robust to the data selection bias in this study. Our results from random-effect models reveal that: (1) size metrics exhibit moderate or almost moderate ability in discriminating between change-prone and not change-prone classes; (2) coupling and cohesion metrics generally have a lower predictive ability compared to size metrics; and (3) inheritance metrics have a poor ability to discriminate between change-prone and not change-prone classes. Our results from sensitivity analyses show that these conclusions reached are not substantially influenced by the data selection bias.  相似文献   

14.

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

15.
Cohesion and coupling metrics for ontology modules   总被引:1,自引:1,他引:0  
In recent years, an increasing number of ontologies and semantic web applications have been developed and used. A conscious effort has been made to develop methods to modularize ontologies. These methods contribute to building a new ontology. However, few studies have focused on the evaluative methods for ontology modules. In this study, we propose novel metrics to measure ontology modularity. To evaluate the ontology modules, we introduce cohesion and coupling based on the theory of software metrics. A cohesion metric and two coupling metrics were used to measure cohesion and coupling for ontology modules. The proposed metrics provide more detailed support in considering the different types of relationships between classes in ontology modules. In addition, the new coupling metrics contribute to checking the consistency between the ontology modules and their original ontology. The proposed metrics were validated using well-known verification frameworks and empirical experiments to complement the previous investigations. The results of this study offer ontology engineers valuable criteria with which to evaluate ontology modules and help ontology users select qualifying ontology modules.  相似文献   

16.
随着软件的演化,软件规模和复杂性的上升往往会造成代码设计质量的退化,进而导致代码可维护性下降。已有大量软件度量指标用于量化代码设计质量,但是由于数量众多,不同指标体系度量结果可比性较差,使得开发人员难以找到存在设计质量问题的模块。系统调研并整理归类了现有的规模、耦合、内聚、封装、继承和多态等6方面软件度量指标。结合度量指标关系以及实验分析,从每个方面的指标集中发现了与代码设计质量关联度最高的6个指标,从而提出一种面向代码设计质量监控的软件度量指标集。实验表明,该指标集可以有效挑选出存在代码设计质量问题的类,可作为开发人员监控和定位代码设计问题的重点关注指标。  相似文献   

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

18.
In the metric suite for object oriented design put forward by S.R. Chidamber and C.F. Kemerer (1994), it is observed that E. Weyuker's (1988) Property 9 is not satisfied by any of the structural inheritance complexity metrics. The same is also observed for candidate structural inheritance complexity metrics proposed by A.F. Brito and R. Carapuca (1994). The authors formally show that particular classes of inheritance metrics (that include the above proposals) that are defined on a directed graph abstraction of the inheritance structure and that are contrived on the assumptions and definitions given by Chidamber and Kemerer, can never satisfy Property 9. Furthermore, it is also argued that the formalisation can be generalized to include other classes of structural metrics that are not necessarily inheritance metrics  相似文献   

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.
Extracting objects from Ada83 programs: A case study   总被引:1,自引:0,他引:1       下载免费PDF全文
Reengineering legacy systems written in conventional procedural languages to equivelent OO systms makes software more maintainable and reliable.This paper proposes a method for extracting objects from legacy Ada83 systems using module features.Firest.metrics are developed to measure module cohesion.Then,effects on cohesion from changing module components are analyzed and rules about how to extract inheritance relations among objects are given.At the end of this paper,an object-extracting algorithm usin module features is proposed.  相似文献   

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

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

京公网安备 11010802026262号