A critique of cohesion measures in the object-oriented parad(5)
Weak Functional Cohesion, WFC, is de ned as the ratio of glue tokens to the total number of data tokens in a procedure, p, tokens(p). It indicates a\weaker" type of cohesion than indicated by super-glue tokens as adding a glue token can\glue" together previously non-cohesive elements even if the token does not glue together all of the slices.p)) WFC (p)= jjG(SA((p)jj tokens
Adhesiveness, A, is de ned to be the ratio of the sum of all the slices containing gluetokens to the product of the total number of tokens and the number of data slices.
A(p)=
P
t G(SA(p))# slices containing t
jtokens(p)j jSA(p)j
3.6.1 Class SlicingWe used modi cations of the slice-based functional cohesion measures de ned by Bieman and Ott 9] in the procedural paradigm, to de ne the slice-based data cohesion measures in the object-oriented paradigm. We used the concept of data tokens, glue and super-glue tokens to de ne the metric data slices for a class and the data cohesion measures. The slice data tokens in the object-oriented paradigm were de ned to be the data tokens de ned in the private or the protected sections in the class. We considered these data tokens to be the slice data tokens as all the operations de ned in a class are performed on these data tokens. In the case of the object-oriented paradigm, a class including all the methods of the class is the basic unit considered to be a module. A metric data slice for each method of the class is obtained using the same de nitions of\forward" and\backward" slices as de ned for the procedural paradigm 9]. The slices thus obtained for each method are then combined to obtain the metric data slice for a class. Thus, a metric data slice for a class is the concatenation of the metric data slices for each of the methods of the class. The rede ned measures will then be applied to the class as a module. 12
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
Modifying the de nitions found in 9], we de ne the class slice abstraction of a class C with n methods, CSA(C ) to be the concatenation of all the slice abstractions of its methods denoted as MSA(mn) assuming MSA(mi) is the method slice abstraction of method mi of class C. The slice abstraction for class C is de ned as: CSA(C)= f MSA(m1 ), MSA(m2 ), . . ., MSA(mn )g
3.6.2 Data Cohesion MeasuresThe data cohesion measures are described in terms of slice abstractions, data tokens, and glue and super-glue tokens 9] but as applied to the object-oriented paradigm. The basic de nition for a data token and glue and super-glue to
kens remained similar to their de nition in the procedural paradigm. The set of super-glue tokens for the class, C, denoted as, SG(CSA(C)), was de ned to be a union of the super-glue tokens of each of the methods of the class. Similarly, the set of glue tokens for the class, C, denoted as G(CSA(C)), was de ned to be the union of the glue tokens of each of the methods of the class. tokens(C) is a set of all data tokens of a class C. Strong data cohesion, SDC, is a measure based on the number of data tokens included in all the data slices for a class, i.e., a count of the number of super-glue tokens in the class C . The super-glue tokens bind all the data slices together and are indicative of a highly cohesive class. Thus, a class where all data tokens are super-glue tokens will have data cohesion of 1 while a class with no super-glue tokens will have no cohesion. Classes with fewer number of super-glue tokens will have lower strong data cohesion than classes where all data tokens are super-glue. (C SDC (C )= jSG(CSAC )j))j jtokens(
Weak data cohesion, WDC, is indicative of the amount of cohesion in a class based onthe number of glue tokens. Glue tokens, unlike the super-glue tokens, do not necessarily bind all the data slices together, hence are indicative of a weaker type of cohesion. A class with no glue tokens will have no cohesion. This type of cohesion is more sensitive than strong data cohesion which is based on super-glue tokens. Adding a glue token may bind together previously non-cohesive elements even if it does not bind together all the slices. (C )) WDC (C )= jG(CSA(C )j j jtokens
Adhesiveness, A, is a measure of the cohesiveness of a class, i.e. the binding or relatedness
among the data slices. It is a comparison between the glue tokens and the total number of data tokens in a class. Adhesiveness for a class C can be de ned as the ratio of the sum of all the slices containing glue tokens to the product of the number of data tokens in the class and the number of data slices. Thus,
A(C )=
P
d G(CSA(C ))# slices containing d
jtokens(C )j jCSA(C )j13
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
Weak data cohesion and Adhesiveness di er from Strong data cohesion in cases of three or more data slices. In the case of 1 or 2 data slices, SDC(C)=WDC(C)=A(C). The values of the measures always lies between 0 and 1, where 0 indicates no cohesion and 1 indicates high cohesion.
14
…… 此处隐藏:3320字,全部文档内容请下载后查看。喜欢就下载吧 ……相关推荐:
- [教育文库]夜场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(傲慢与偏见)




