首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到19条相似文献,搜索用时 156 毫秒
1.
软件系统开发时应遵循“高内聚、低耦合”的软件工程原则,但内聚度本身是主观的、非形式化的概念,程序设计人员很难客观地评估一个模块的内聚度。在面向对象系统中,内聚度主要是指类内部各成份之间的联结强度。  相似文献   

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

3.
本文首先介绍了面向对象软件的特征,然后具体分析了C&K度量法,着重分析了其中与类继承相关的继承树深度(DIT)和孩子数目(NOC)度量准则。在此基础上,通过分析超类与其子类中元素(方法和属性)的继承关系,提出了基于继承的内聚度度量方法,从而克服了C&K度量法中对类继承性、多态性方面度量的不足,为综合评价类的内聚度度提供了指南。  相似文献   

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

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

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

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

8.
优化的粗糙神经网络在故障诊断中的应用   总被引:3,自引:0,他引:3  
叶斌  王存进  周庆敏 《微计算机信息》2007,23(34):158-159,197
本文在相异度理论的基础上,提出了类间相异度的度量方法,从而以粗糙集理论为属性约简工具,利用相异度理论进行类的泛化和特化.构造出了优化的粗糙神经网络模型。故障诊断实例分析表明,该模型对神经网络分层约简并剔除其中不必要的属性.减少了神经网络的总体训练时间和决策过程中的模式匹配搜索量,大大提高故障诊断系统的反应能力,在大型复杂的故障诊断应用中效果尤为明显。  相似文献   

9.
相异度和相似度度量是聚类算法中非常重要的一种因素,往往会影响到聚类分析的结果。很多聚类算法采用欧式距离作为计算数据相似度的度量。而欧式距离不能反映属性值的全局特性,且不顾及各属性之间的量纲差异,因此当不同属性间具有明显量纲或值域差异时,不能取得很好的效果。对此,提出了一种广义加权Minkowski距离,即由各属性的量纲和值域信息来确定各属性的广义权值,既考虑了整个数据集的特性,又消除了各属性之间的不和谐,同时分位数的引进在一定程度上减弱了噪声属性值对距离度量的影响。将提出的新的距离度量用于经典的k-means算法和量子遗传聚类算法,实验结果表明,采用新的距离度量和引进量子遗传算法的聚类是更加有效的。  相似文献   

10.
模糊聚类分析主要研究样本的分类问题.本文利用模糊聚类方法对软件缺陷进行分类,引入缺陷数据属性权重计算方法,依据数据挖掘中的属性邻近性度量方法,对缺陷数据进行相似度分析.并按照属性类别进行分析,不仅体现了缺陷数据属性间的形贴近程度,而且体现了属性之间的距离贴近程度.本文方法对软件缺陷数据进行分析并对比度量结果,实验结果充分说明改进后的模糊聚类相似性度量方法在分类准确性方面有一定程度的提高.  相似文献   

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

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

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

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

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

16.
A notation called Objectcharts for specifying object classes is introduced. An Objectchart diagram is an extended form of a Statechart, which characterizes the behavior of a class as a state machine. The Objectchart transitions correspond to the state-changing methods that the class provides and those that it requires of other classes. Object attributes and observer methods annotate Objectchart states. Firing and postconditions are used to specify the effect of transitions on class attributes. The Objectchart notions is described through the development of an alarm clock application. How Objectcharts can be used to find subtyping inheritance relationships between classes and a systematic approach for evolving Objectchart specifications are shown  相似文献   

17.
易彤  吴方君 《计算机工程》2004,30(17):68-69,91
UML类图描述了系统中的类及其相互之间的各种静态关系,为了对UML类图提供客观的评价,通过对典型度量方法的改进,文章采用一组度量从不同侧面来评价一个类图的复杂性和可复用性,并考虑了类图中属性和方法在公有、私有和受保护性质方面的区别。  相似文献   

18.
A hierarchical model for object-oriented design quality assessment   总被引:1,自引:0,他引:1  
The paper describes an improved hierarchical model for the assessment of high-level design quality attributes in object-oriented designs. In this model, structural and behavioral design properties of classes, objects, and their relationships are evaluated using a suite of object-oriented design metrics. This model relates design properties such as encapsulation, modularity, coupling, and cohesion to high-level quality attributes such as reusability, flexibility, and complexity using empirical and anecdotal information. The relationship or links from design properties to quality attributes are weighted in accordance with their influence and importance. The model is validated by using empirical and expert opinion to compare with the model results on several large commercial object-oriented systems. A key attribute of the model is that it can be easily modified to include different relationships and weights, thus providing a practical quality assessment tool adaptable to a variety of demands  相似文献   

19.
Placement of methods is one of the most important design activities for any object‐oriented application in terms of coupling and cohesion. Due to method misplacement, the application becomes tightly coupled and loosely cohesive, reflecting inefficient design. Therefore, a feature envy code smell emerges from the application, as many methods use more features of other classes than its current class. Hence, development and maintenance time, cost, and effort are increased. To refactor the code smell and enhance the design quality, move method refactoring plays a significant role through grouping similar behaviors of methods. This is because the manual refactoring process is infeasible due to the necessity of huge time and most of the existing techniques consider only coupling‐based and/or cohesion‐based information of nonstatic entities (methods and attributes) for the recommendation. However, this article proposes an approach that uses contextual information, based on information retrieval techniques, along with dependency (coupling and cohesion)‐based information of the application for the recommendation. In addition, the approach incorporates both static and nonstatic entities in the recommendation process. For validation, the approach is applied on seven well‐known open source projects. The results of the experimental evaluation indicate that the proposed approach provides better results with an average precision of 18.91%, a recall of 69.91%, and an F‐measure of 29.77% than the JDeodorant tool (a widely used eclipse plugin for refactorings). Moreover, this article establishes several relationships between the accuracy of the approach and project standards and sizes.  相似文献   

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

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

京公网安备 11010802026262号