A critique of cohesion measures in the object-oriented parad(4)
3.4 A Composite Cohesion MeasureBaxter, Chu and Patel 4], propose a composite cohesion measure to measure the cohesion in Ada packages. They claim that their cohesion measure is based on measuring the cohesive strength of a module consisting of two or more primitive components (e.g. an Ada package consisting of subprograms such as procedures, functions, and tasks) 4]. Baxter, Chu and Patel claim that programs from the same package will use the same type of variables and hence have higher cohesion than programs from completely di erent packages. The following de nition is taken directly from 4]. Given a composite module P= fp1,p2, ..., pm g (where pi may either be a procedure or a function), the cohesion of a composite module is de ned as:
Cohesion(P )=
P
S Sim2(pi; pj ) Pm?1 i i
9
Cohesion refers to the "relatedness " of a module's components. In the object-oriented paradigm, cohesion refers to the "relatedness " among the methods of a class. Most of the current measures of cohesion in the object-oriented paradig
where S= f(i,j) j i,j 2 (1,m)^ i> jg Sim2(pi; pj ) is the summation of the similarity betw
een distinct pairs of functions or procedures in the module; the i>j condition insures that the similarity computation between a pair is only considered once within the summation.
Sim2(pi; pj )= qPn1
P
x2 i
pj S piq
P
n y2 1 i
where n is the number of members in the module. The numerator represents the summation of the product of the frequencies of the set of variables shared between modules pi and pj . This is explained in detail in the later part of this section. The denominator is the cardinality of modules pi and pj . Pm?1 i i computes the the total number of possible pairs for which the similarity metric is computed in the numerator. The composite module cohesion is thus computed to be the average of the similarity measures over distinct pairs of functions and procedures in the module 4]. Baxter, Chu and Patel claim that their proposed composite cohesion measure is based on information retrieval principles that accomplish the task of highlighting properties shared between members of a module. They claim that in the domain of information retrieval a logical organization of related members in a group is determined by a measure of similarity. A similarity measure is de ned so that an object is more like other objects in the same group and less like objects from other groups 30]. In order to compute the similarity between members of a module, rst a type vector for each member of the module must be computed. The basic idea is to scan the module for references to variables of a given type. If a member references a variable, V, and V is of type, T, then the counter associated with type T is incremented. Thus a type vector contains the frequency of the variables referenced of a particular type. The type vectors of all members are placed in a table where the rows represent the type vectors and the columns represent the members of the module. Once this is done, the similarity between the members is computed as Sim2(pi; pj ) where pi; pj are members of the module. The cohesion of the module, Cohesion(P), is de ned to be a ratio of the similarities between modules to the possible number of pairs for which the similarities can be computed. Baxter, Chu and Patel have obtained measurements for some Ada and C packages 4].
3.5 Bieman and Kang's Class Cohesion MeasuresBieman and Kang 6] propose two class cohesion measures to evaluate the relationship between class cohesion and private reuse in the system. They de ne class cohesion to be an attribute of a class that refers to the\relatedness" or\connectivity" among components of the class. The components include the instance variables and the methods de ned in a class plus those that are inherited. A method is said to be\related" or\connected" to an instance variable if the method uses that instance variable. 10
Cohesion refers to the "relatedness " of a module's components. In the object-oriented paradigm, cohesion refers to the "relatedness " among the methods of a class. Most of the current measures of cohesion in the object-oriented paradig
The class cohesion measures proposed by Bieman and Kang 6] are based on the direct or indirect connectivity between a pair of methods. Two methods that use one or more common instanc
e variables are said to be directly connected. Two methods that are connected through other directly connected methods, are indirectly connected. Let NDC(C), be the number of directly connected methods in a class C. NIC(C), is the number of indirectly connected methods in a class C. NP(C)=N * (N - 1)/2 is the maximum possible number of connections in a class. Tight class cohesion (TCC) is de ned to be a ratio of the number of directly connected methods in a class, NDC(C), to the maximum possible number of connections in a class. TCC(C)= NDC(C)/ NP(C) Loose class cohesion (LCC) is de ned to be a ratio of all directly connected methods, NDC(C), and indirectly connected methods, NIC(C), in a class to the maximum possible number of connections in a class, NP(C). LCC(C)= (NDC(C)+ NIC(C))/ NP(C)
3.6 Slice-Based Data Cohesion MeasuresHere we propose measures based on the slice-based functional cohesion measures in the procedural paradigm. By modifying the functional cohesion measures we de ne slice-based data cohesion measures for the object-oriented paradigm. In 9] Bieman and Ott introduce the concept of data slices to measure slice-based functional cohesion in the procedural paradigm. In order for the metrics to be sensitive to changes in code, they use data tokens (i.e., variable and constant de nitions and references) to measure cohesion. A data slice for a slice data token, v, is de ned to be the sequence of all data tokens Ti in the stat …… 此处隐藏:6029字,全部文档内容请下载后查看。喜欢就下载吧 ……
相关推荐:
- [教育文库]夜场KTV服务员的岗位职责及工作流程[1]
- [教育文库]企划、网络、市场绩效考核方案
- [教育文库]学党史、知党情、强党性--“党的基本理
- [教育文库]2016年高考物理大一轮总复习(江苏专版
- [教育文库]干部廉洁自律自查自纠的报告
- [教育文库]2010年北京大学心理学系拟录取硕士研究
- [教育文库]资金时间价值练习题及答案
- [教育文库]保护环境的心得体会
- [教育文库]英语角内容:英语趣味小知识
- [教育文库]档案收集与管理工作通知
- [教育文库]劳动规章制度范本范本
- [教育文库]高考物理一轮复习课后限时作业1运动的
- [教育文库]机械工艺夹具毕业设计195推动架设计说
- [教育文库]通用技术教学比赛说课稿2
- [教育文库]2018年四年级英语下册 Module 7 Unit 2
- [教育文库]第2章 宽带IP网络的体系结构
- [教育文库]九年级化学第五单元课题3《根据化学方
- [教育文库]小学英语六年级情态动词用法归纳
- [教育文库]甲级单位编制窑井盖项目可行性报告(立
- [教育文库]2016-2021年中国城市规划行业全景调研
- 高考英语听力十大场景词汇总结
- 全省领导班子思想政治建设座谈会会议精
- 人教版新课标高一英语提优竞赛试题 下
- 江西省2014年生物中考试题
- 长沙镇食品药品安全事故应急预案
- 《金刚石、石墨和C60》片段教学设计
- 福州教育学院(王旭东)
- 基于EDA音乐播放器的设计
- 9、古诗两首《夜书所见》《九月九日忆
- 小学语文课外阅读有效策略探讨
- 贵州文化产业发展成支柱产业的问卷调查
- 膀胱类癌的诊治体会(附3例报告)
- 发动机积碳产生的原因
- Configuring Code Composer Studio for
- 学生良好的心理素质如何培养点滴谈
- 46 电沉积法制备锂离子电池用硅-锂薄膜
- 美舍雅阁公司管理中各部门职责
- 去壳剥皮的小妙招
- 六自由度运动平台的仿真研究
- Pride and Prejudice(傲慢与偏见)




