Object-Oriented Metrics: LCOM 内聚性的度量
Object-Oriented Metrics: LCOM https://www.computing.dcu.ie/~renaat/ca421/LCOM.html
Object-Oriented Metrics: LCOM
LCOM (Lack of Cohesion of Methods) as revised by Brian Henderson-Sellers in [HEN96]
CK originally proposed LCOM
Chidamber & Kemerer proposed the original LCOM Lack of Cohesion metric in [CHI94]
Given n methods M1, M2, …, Mn contained in a class C1 which also contains a set of instance variables {Ii} . Then for any method Mi we can define the partitioned set of
P = {(Ii, Ij) | Ii ∩ Ij = φ} and Q = {(Ii, Ij) | Ii ∩ Ij ≠ φ}
then LCOM = |P| - |Q|, if |P| > |Q|
=0 otherwise
LCOM is a count of the number of method pairs whose similarity is zero.
CK example from [HEN96] LCOM as defined above
Based on M's as methods and A's as instance variables both of the above graphs of classes derive an LCOM measure of 8.
However it seems clear that the graph on the right is a lot more intuitively cohesive.
Henderson-Sellers revised LCOM*
Henderson-Sellers revises the LCOM metric to normalise it for the number of methods and variables that rae present in the class:
Where the number of methods is m and the number of instance variables ( attributes) a set of {Aj} (j=1, 2, …, a). Let μ(Aj) be the number of methods which access each datum.
With this new measure the mteric is simplified an normalised.
References
- [CHI94] Chidamber, S., R., Kemerer, C., K., A Metrics Suite for Object Oriented Design, IEEE Trans. on Software Eng., Vol.20, No.6, June 1994.
- [HEN 96] Henderson-Sellers, B., Object-oriented metrics : measures of complexity, Prentice-Hall, pp.142-147, 1996.
Object-Oriented Metrics: LCOM 内聚性的度量的更多相关文章
- CSharpGL - Object Oriented OpenGL in C#
Object Oriented OpenGL in C#
- Object Oriented Programming python
Object Oriented Programming python new concepts of the object oriented programming : class encapsula ...
- What is Object Oriented Design? (OOD)
Object Oriented Design is the concept that forces programmers to plan out their code in order to hav ...
- Java - 面向对象(object oriented)计划 详细解释
面向对象(object oriented)计划 详细解释 本文地址: http://blog.csdn.net/caroline_wendy/article/details/24058107 程序包括 ...
- OO开发思想:面向对象的开发方法(Object oriented,OO)
面向对象的开发方法(Object oriented,OO)认为是好文章吧,拿来分享一下(转载) 面向对象的开发方法(Object oriented,OO) 从事软件开发的工程 师们常常有这样 的体会: ...
- JavaScript: Constructor and Object Oriented Programming
Constructor : Grammar: object.constructor Example: Javascript code: 1 function obj1() { this.number ...
- 面对对象编程(OOP, Object Oriented Programming)及其三个基本特性
一千个读者,一千个哈姆雷特.对于面对对象编程,书上都会告诉我们它有三个基本特性,封装,继承,多态,但谈起对这三点的见解,又是仁者见仁智者见智,感觉还是得多去编程中体验把 . 面向对象编程(OOP, O ...
- Python学习札记(三十) 面向对象编程 Object Oriented Program 1
参考:OOP NOTE 1.面向对象编程--Object Oriented Programming,简称OOP,是一种程序设计思想.OOP把对象作为程序的基本单元,一个对象包含了数据和操作数据的函数. ...
- 使用一个数组存储一个英文句子"java is an object oriented programing language"
class fun { public static void main(String[] args) { String str="java is an object oriented pro ...
随机推荐
- 更改 easyUI 的皮肤样式
我的版本是:jquery-easyui-1.3.2.根据官方提供的皮肤样式,——在theme 里面: 只需要在引入的 页面中 link样式的地址改变即可: <link rel="sty ...
- Xilinx_7_Series_GTX简介
Xilinx_7_Series_GTX简介 https://wenku.baidu.com/view/4639cde7bb68a98270fefab6.html
- Windows 8 64bit Xilinx ISE(14.7) Fix License
http://www.youtube.com/watch?v=ttPbEcNjdo8 It can work successfully!
- sql语句单据编号生成防并发
有用户反馈说发现重复单据号,检查发现以下单据号被分配给了不同的两个职工 系统中使用语句exec GetNewOrderNumber 'pwgnumber','PWG',1, @pwg_number o ...
- Android 4.4 全套源代码及子模块源代码的下载方法
博文<Android源代码下载--用git clone实现单个文件夹下载>介绍了採用git clone方法下载Android单个文件夹源代码的方法,这篇文章已经有四年的历史,这期间Goog ...
- PHP excel读取excel文件转换为数组
/*备注:先去下载PHP EXCEL——http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=phpexcel&am ...
- PHP 7的一些引人注目的新特性简单介绍
1. ?? 运算符(NULL 合并运算符)把这个放在第一个说是因为我觉得它很有用.用法: ? 1 $a = $_GET['a'] ?? 1; 它相当于: ? 1 2 <?php $a = iss ...
- Nodejs各种功能Module的收集整理
收集整理接触过的各种常用的nodejs modules,不断更新~~~ ================================================================ ...
- 解决Bootstrap 试用手机端 布满全屏
@media (max-width: 767px) { body{ margin: 0; padding: 0; } } @media (max-width: 970px) { body{ margi ...
- linux和pycharm下终端彩色打印输出
实际上linux终端是调用ANSI控制码来实现终端彩色输出.终端的字符颜色由转义序列(Escape Sequence)控制,是文本模式下的系统显示功能,与具体语言无关. 转义序列以控制字符'ESC'开 ...