教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 教育文库 >

A critique of cohesion measures in the object-oriented parad

来源:网络收集 时间:2026-05-21
导读: 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 Michigan

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

Michigan Technological University Department of Computer Science Master of Science Thesis

A Critique of Cohesion Measures in the Object-Oriented Paradigm

by

Bindu S. Gupta March 11, 1997

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

AbstractCohesion 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 paradigm are based on the idea of data cohesion. The general assumption is that the object-oriented paradigm has modules that encapsulate abstract data types. In this thesis we examine measures of cohesion in the object-oriented paradigm. A list of properties that these cohesion measures must satisfy is presented. Some existing and new measures in the object-oriented paradigm claimed to be cohesion measures are compared with this list of properties. Inconsistencies between the measures and our understanding of cohesion are also discussed. We will be looking at some C++ classes like List, Stack, etc. that are intuitively cohesive classes. The cohesion values are computed for each of the measures to see what they indicate about the cohesion of each class. Contrary to our intuition that methods of a class will use most of the data elements, we see that in most cases methods use only a few of the data elements. This means that characterizing cohesion based on data interactions might not be the correct way of measuring cohesion in the objectoriented paradigm. For classes that seem cohesive but have no data interactions, all the measures give low cohesion values, indicating that such type of classes are not cohesive. This raises a question, is\cohesion" in the object-oriented paradigm something other than data cohesion as has been hypothesized? And, if so, what is the right measure for cohesion? We hypothesize that in addition to data cohesion another form of cohesion exists which is based in the application domain and hence we refer to it as application-based cohesion. Future work on cohesion in the object-oriented paradigm needs to address this question.

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

Contents1 Introduction 2 Background2.1 The Object-Oriented Paradigm::::::::::::::::::::::::: 2.2 Measures in the Object-Oriented Paradigm:::::::::::::::::: 2.3 Cohesion in the Object-Oriented Paradigm:::::::::::::::::: The Lack of Cohesion in Methods Metric:: Connectivity Metric:::::::::::::: Chen and Lu's Cohesion Measure::::::: A Composite Cohesion Measure:::::::: Bieman and Kang's Class Cohesion Measures Slice-Based Data Cohesion Measures::::: 3.6.1 Class Slicing:::::::::::::: 3.6.2 Data Cohesion Measures::::::::

1 33 4 4 7 8 9 9 10 11 12 13

3 Existing Cohesion Measures in the Object-Oriented Paradigm3.1 3.2 3.3 3.4 3.5 3.6

::::::::

::::::::

::::::::

::::::::

::::::::

::::::::

::::::::

:::::

:::

::::::::

::::::::

::::::::

::::::::::::::

::::::::::::::

::::::::::::::

::::::::::::::

::::::::::::::

::::::::::::::

7

4 Are These Measures Satisfactory?

4.1 Necessary Properties for Cohesion Measures:::: 4.2 Do the Cohesion Measures Satisfy the Properties? 4.2.1 Lack of Cohesion in Methods:::::::: 4.2.2 Connectivity Metric::::::::::::: 4.2.3 Chen and Lu's Cohesion Metric::::::: 4.2.4 A Composite Cohesion Measure::::::: i

::::::

::::::

::::::

::::::

::::::

::::::

::::::

::::::

15

15 17 17 20 21 29

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

4.2.5 Bieman and Kang's Class Cohesion Measure::::::::::::: 4.2.6 Slice-Based Data Cohesion Measures:::::::::::::::::: 4.3 Another View of Cohesion::::::::::::::::::::::::::::

32 33 34

5 Summary and Future Work

40

ii

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

List of Figures2.1 LIST class.:::::::::::::::::::::::::::::::::::: 4.1 Case I: Class with a pair of methods that do not share any instance variables. 4.2 Case II: Class with three methods where only two of the methods share an instance variable.::::::::::::::::::::::::::::::::: 4.3 Case III: Class with four methods where a pair of methods share an instance variable each.::::::::::::::::::::::::::::::::::: 4.4 Case IV: Class with four methods where only three of the four methods share an instance variable.::::::::::::::::::::::::::::::: 4.5 Case V: Minimally cohesive class.:::::::::::::::::::::::: 4.6 Stack class.:::::::::::::::::::::::::::::::::::: 4.7 List.h::::::::::::::::::::::::::::::::::::::: 4.8 Object.h:::::::::::::::::::::::::::::::::::::: 4.9 List class.::::::::::::::::::::::::::::::::::::: 4.10 Listiter class.:::::::::: …… 此处隐藏:6488字,全部文档内容请下载后查看。喜欢就下载吧 ……

A critique of cohesion measures in the object-oriented parad.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/108005.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)