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 内聚性的度量的更多相关文章

  1. CSharpGL - Object Oriented OpenGL in C#

    Object Oriented OpenGL in C#

  2. Object Oriented Programming python

    Object Oriented Programming python new concepts of the object oriented programming : class encapsula ...

  3. What is Object Oriented Design? (OOD)

    Object Oriented Design is the concept that forces programmers to plan out their code in order to hav ...

  4. Java - 面向对象(object oriented)计划 详细解释

    面向对象(object oriented)计划 详细解释 本文地址: http://blog.csdn.net/caroline_wendy/article/details/24058107 程序包括 ...

  5. OO开发思想:面向对象的开发方法(Object oriented,OO)

    面向对象的开发方法(Object oriented,OO)认为是好文章吧,拿来分享一下(转载) 面向对象的开发方法(Object oriented,OO) 从事软件开发的工程 师们常常有这样 的体会: ...

  6. JavaScript: Constructor and Object Oriented Programming

    Constructor :  Grammar: object.constructor Example: Javascript code: 1 function obj1() { this.number ...

  7. 面对对象编程(OOP, Object Oriented Programming)及其三个基本特性

    一千个读者,一千个哈姆雷特.对于面对对象编程,书上都会告诉我们它有三个基本特性,封装,继承,多态,但谈起对这三点的见解,又是仁者见仁智者见智,感觉还是得多去编程中体验把 . 面向对象编程(OOP, O ...

  8. Python学习札记(三十) 面向对象编程 Object Oriented Program 1

    参考:OOP NOTE 1.面向对象编程--Object Oriented Programming,简称OOP,是一种程序设计思想.OOP把对象作为程序的基本单元,一个对象包含了数据和操作数据的函数. ...

  9. 使用一个数组存储一个英文句子"java is an object oriented programing language"

    class fun { public static void main(String[] args) { String str="java is an object oriented pro ...

随机推荐

  1. JavaScript内存示意图

    一.JavaScript内存示意图 二.js原理 1.js执行规则 (1)先定义 定义变量.定义函数.顺序:自上而下. (2)后执行 除了定义外的代码都是执行代码.顺序:自上而下. 2.动态开辟内存 ...

  2. java泛型 7 泛型的基本介绍和使用

    现在开始深入学习Java的泛型了,以前一直只是在集合中简单的使用泛型,根本就不明白泛型的原理和作用.泛型在java中,是一个十分重要的特性,所以要好好的研究下. 一.泛型的基本概念 泛型的定义:泛型是 ...

  3. AIDL调用指南

    近期有需求要实现两个apk之间的通信,想到用AIDL来实现,现写一个demo学习下AIDL怎样使用. 这里我要实现一个apk(client端)调用还有一个apk(server端)的方法. 先实现ser ...

  4. MATLABR 2016 b 安装教程

    1.下载相应的 MATLABR 2016 b 版本如下: 主要是下面三个文件,其中, Matlab 2016b Win64 Crack.rar 是破解文件.另两个为安装包.(本软件在win8/10上不 ...

  5. 同时安装office2016与visio2016的实现过程

    visio 2016安装问题 同时安装office2016与visio2016的实现过程 visio2016  but failed

  6. 改变Fragment的默认动画

    FragmentTransaction ft = getFragmentManager().beginTransaction(); //设置进入退出动画 ft.setCustomAnimations( ...

  7. Html Table用JS导出excel格式问题 导出EXCEL后单元格里的000412341234会变成412341234 7-14 会变成 2018-7-14(7月14) 自定义格式 web利用table表格生成excel格式问题 js导出excel增加表头、mso-number-format定义数据格式 数字输出格式转换 mso-number-format:"\@"

    Html Table用JS导出excel格式问题 我在网上找的JS把HTML Tabel导出成EXCEL.但是如果Table里的数字内容为0开的的导成Excel后会自动删除0,我想以text的格式写入 ...

  8. WIN10系统如何设置系统的护眼色

    小编的眼神不是很好,所以喜欢把电脑的各种文档的背景色设置成护眼色(就是在视觉效果看起来非常舒适的那种淡绿色) 方法/步骤     windows+R键调出运行窗口(或者鼠标右击开始键,选择运行)   ...

  9. mysql命令:set sql_log_bin=on/off

    对于数据库的操作,经常需要暂时停止对bin-log日志的写入,那就需要这个命令:set sql_log_bin=on/off 参考:dev.mysql.com/doc/refman/5.5/en/se ...

  10. c++ istream(ostream)是如何转换为bool的

    http://www.cplusplus.com/reference/ios/ios/operator_not/ http://stackoverflow.com/questions/8117566/ ...