Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more ➡
Download
Standard view
Full view
of .
Add note
Save to My Library
Sync to mobile
Look up keyword
Like this
2Activity
×
0 of .
Results for:
No results containing your search query
P. 1
Establishing Relationships among Chidamber And Kemerer’s Suite of Metrics using Field Experiments

Establishing Relationships among Chidamber And Kemerer’s Suite of Metrics using Field Experiments

Ratings: (0)|Views: 770|Likes:
Published by ijcsis
Chidamber and Kemerer suite of metrics were used in the study of 3250 classes from five JAVA based
industrial systems. System 1 had 34 classes, System 2 had 318 classes, System 3 383 classes, System 4 1055 classes,
and System 5 1460 classes. Metric values were computed for the Lack of Cohesion in Methods (LCOM), Coupling
between Object Classes (CBO), Response For a Class (RFC), Number of Children (NOC), Depth of Inheritance
(DIT), Weighted Methods per Class (WMC), Number of Public Methods (NPM) and Afferent Coupling (CA). LCOM was used as cohesion variable; CBO, RFC, CA as coupling variables; WMC, NPM, NOC as size variables
and DIT as inheritance variable. Descriptive statistics and correlation analysis were used to analyze the results. Tests
of hypotheses were carried out to examine if there were significant relationships between cohesion and coupling
variables, cohesion and size variables, cohesion and inheritance variables, coupling and inheritance variables,
coupling and size variables, inheritance and size variables. The results of the study showed that in System 1, there
were strong significant relationships between cohesion and coupling (CBO, RFC), cohesion and size (WMC,NPM),
coupling and size variables (WMC, NPM), and a weak relationship between Affarent coupling CA and inheritance (DIT). In System 2, there were strong significant relationship between cohesion and coupling (CBO, RFC), cohesion and size variables (WMC, NPM), coupling and size (WMC, NPM); a low relationship between coupling by CA and WMC, NOC, and a weak relationship between inheritance DIT and WMC, RFC, NPM. In System 3, there were strong significant relationship between cohesion and coupling (CBO, RFC), cohesion and size (WMC, NPM), coupling and size (WMC, NPM); a low relationship between coupling by CA. In System 4, there were strong significant relationship between cohesion and coupling (RFC), cohesion and size (WMC, NPM), size WMC and Size NPM. There were low relationships between cohesion and coupling (CBO, CA) and weak relationships between inheritance DIT and CA, inheritance and size (WMC). In System 5, there were strong significant relationship between cohesion and size (WMC, NPM), coupling and size (WMC, NPM); a low relationship between cohesion and coupling, inheritance and coupling (CBO), coupling and size.
Chidamber and Kemerer suite of metrics were used in the study of 3250 classes from five JAVA based
industrial systems. System 1 had 34 classes, System 2 had 318 classes, System 3 383 classes, System 4 1055 classes,
and System 5 1460 classes. Metric values were computed for the Lack of Cohesion in Methods (LCOM), Coupling
between Object Classes (CBO), Response For a Class (RFC), Number of Children (NOC), Depth of Inheritance
(DIT), Weighted Methods per Class (WMC), Number of Public Methods (NPM) and Afferent Coupling (CA). LCOM was used as cohesion variable; CBO, RFC, CA as coupling variables; WMC, NPM, NOC as size variables
and DIT as inheritance variable. Descriptive statistics and correlation analysis were used to analyze the results. Tests
of hypotheses were carried out to examine if there were significant relationships between cohesion and coupling
variables, cohesion and size variables, cohesion and inheritance variables, coupling and inheritance variables,
coupling and size variables, inheritance and size variables. The results of the study showed that in System 1, there
were strong significant relationships between cohesion and coupling (CBO, RFC), cohesion and size (WMC,NPM),
coupling and size variables (WMC, NPM), and a weak relationship between Affarent coupling CA and inheritance (DIT). In System 2, there were strong significant relationship between cohesion and coupling (CBO, RFC), cohesion and size variables (WMC, NPM), coupling and size (WMC, NPM); a low relationship between coupling by CA and WMC, NOC, and a weak relationship between inheritance DIT and WMC, RFC, NPM. In System 3, there were strong significant relationship between cohesion and coupling (CBO, RFC), cohesion and size (WMC, NPM), coupling and size (WMC, NPM); a low relationship between coupling by CA. In System 4, there were strong significant relationship between cohesion and coupling (RFC), cohesion and size (WMC, NPM), size WMC and Size NPM. There were low relationships between cohesion and coupling (CBO, CA) and weak relationships between inheritance DIT and CA, inheritance and size (WMC). In System 5, there were strong significant relationship between cohesion and size (WMC, NPM), coupling and size (WMC, NPM); a low relationship between cohesion and coupling, inheritance and coupling (CBO), coupling and size.

More info:

Published by: ijcsis on Jul 07, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See More
See less

09/06/2012

pdf

text

original

 
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 6, June 2011
Establishing Relationships Among Chidamber andKemerer’s suite of Metrics Using Field Experiments
Ezekiel U. Okike
Department of computer ScienceUniversity of IbadanIbadan, Nigeriaeuokike@gmmail.com
Adenike O. Osofisan
Department of computer ScienceUniversity of IbadanIbadan, Nigeriaao.osofisan@mail.ui.edu.ng
 
 Abstract
— Chidamber and Kemerer suite of metrics wereused in the study of 3250 classes from five JAVA basedindustrial systems. System 1 had 34 classes, System 2 had318 classes, System 3 383 classes, System 4 1055 classes,and System 5 1460 classes. Metric values were computedfor the Lack of Cohesion in Methods (LCOM), Couplingbetween Object Classes (CBO), Response For a Class(RFC), Number of Children (NOC), Depth of Inheritance(DIT), Weighted Methods per Class (WMC), Number of Public Methods (NPM) and Afferent Coupling (CA).LCOM was used as cohesion variable; CBO, RFC, CA ascoupling variables; WMC, NPM, NOC as size variablesand DIT as inheritance variable. Descriptive statistics andcorrelation analysis were used to analyze the results. Testsof hypotheses were carried out to examine if there weresignificant relationships between cohesion and couplingvariables, cohesion and size variables, cohesion andinheritance variables, coupling and inheritance variables,coupling and size variables, inheritance and size variables.The results of the study showed that in System 1, therewere strong significant relationships between cohesion andcoupling (CBO, RFC), cohesion and size (WMC,NPM),coupling and size variables (WMC, NPM), and a weakrelationship between Affarent coupling CA andinheritance (DIT). In System 2, there were strongsignificant relationship between cohesion and coupling(CBO, RFC), cohesion and size variables (WMC, NPM),coupling and size (WMC, NPM); a low relationshipbetween coupling by CA and WMC, NOC, and a weakrelationship between inheritance DIT and WMC, RFC,NPM. In System 3, there were strong significantrelationship between cohesion and coupling (CBO, RFC),cohesion and size (WMC, NPM), coupling and size (WMC,NPM); a low relationship between coupling by CA. InSystem 4, there were strong significant relationshipbetween cohesion and coupling (RFC), cohesion and size(WMC, NPM), size WMC and Size NPM. There were lowrelationships between cohesion and coupling (CBO, CA)and weak relationships between inheritance DIT and CA,inheritance and size (WMC). In System 5, there werestrong significant relationship between cohesion and size(WMC, NPM), coupling and size (WMC, NPM); a lowrelationship between cohesion and coupling, inheritanceand coupling (CBO), coupling and size
 Keywords-software measurement; cohesion, coupling,inheritance, Chidamber and Kemerer metrics
I.
 
I
 NTRODUCTION
Chidamber and Kemerer [3,4] defined a basic set of object-oriented measures which seem to be widely accepted [11]. Thesuite of metrics include the Lack of Cohesion in Methods(LCOM), Coupling between Object Classes (CBO), ResponseFor a Class (RFC), Number of Children (NOC), Depth of Inheritance (DIT), and Weighted Methods per Class (WMC).The Lack of Cohesion in Methods (LCOM) metric measuresthe dissimilarity of methods in a class by instance variables or attributes. A highly cohesive module should stand alone; highcohesion is an indication of good class subdivision. Lack of cohesion or low cohesion increases complexity, therebyincreasing the likelihood of errors during the development process. It is suggested that classes with low cohesion could be divided into two or more subclasses with increasedcohesion [4]. A critical evaluation of this is already presentedin [7]Coupling between Objects (CBO) is a count of the number of other classes to which a class is coupled. It is measured bycounting the number of distinct non-inheritance related classhierarchies on which a class depends. Excessive coupling isdetrimental to modular design and prevents reuse. The moreindependent a class is, the easier it is reused in another application. Hence, the larger the number of couples, thehigher the sensitivity to changes in other parts of the designand therefore maintenance is more difficult. Strong couplingcomplicates a system since a class is hard to understand,change or correct by itself if it is interrelated with other classes. Complexity can be reduced by designing systems withthe weakest possible coupling between classes. This improvesmodularity and promotes encapsulation [1,2,5].Response for a Class (RFC) is a count of the set of allmethods that can be invoked in response to a message to anobject of the class or by some method in the class. This
175http://sites.google.com/site/ijcsis/ISSN 1947-5500
 
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 6, June 2011
include all methods assessable within the class hierarchy. RFCmetric combines the complexity of a class through the number of methods and the amount of communication with other classes. The larger the number of methods that can be invokedfrom a class through messages, the greater the complexity of the class. If a large number of methods can be invoked inresponse to a message, the testing and debugging of the class becomes complicated since a greater level of understanding onthe part of the tester is required. A worst case value for  possible responses will assist in the appropriate allocation of testing time . Number of Children (NOC) is the number of immediatesubclasses subordinate to a class in the hierarchy. It is anindicator of the potential influence a class can have on thedesign and on the system. The greater the number of children,the greater the likelihood of improper abstraction of the parentand may be a case of misuse of sub classing. But the greater the number of children, the greater the reuse since inheritanceis a form of reuse. If a class has a large number of children, itmay require more testing of methods of that class, thusincreases the testing time.Depth of Inheritance Tree (DIT
)
of a class within theinheritance hierarchy is the maximum number of steps fromthe class node to the root of the tree and is measured by thenumber of ancestor classes. The deeper a class is within thehierarchy, the greater the number of methods it is likely toinherit making it more complex to predict its behavior.Deeper trees constitute greater design complexity, since moremethods and classes are involved, but the greater the potentialfor reuse of inherited methods. A support metric for DIT is thenumber of methods inherited .Weighted Method Per Class (WMC) is a count of the methodsimplemented within a class or the sum of the complexities of the methods (method complexity being measured bycyclomatic complexity). It is difficult to implement WMC bythe cyclomatic complexity method because not all methods areassessable within the class hierarchy due to inheritance. Thenumber of methods and the complexity of the methodsinvolved is a predictor of how much time and effort is requiredto develop and maintain the class. The larger the number of methods in a class, the greater the potential impact onchildren; children inherit all methods defined in the parentclass. Classes with large number of methods are likely to bemore application specific, limiting the possibility of reuse[1,2,5] .
 A.
 
 Aims and Objectives
The overall aims and objectives of this study were toinvestigate the relationship among Chidamber and Kemerer suite of metrics : LCOM, CBO, RFC, NOC, DIT, WMC andtheir implication in software design and implementation.
 B.
 
 Research Questions
Specifically, the research questions investigated by thisstudy are the following:
 
Is there any significant relationship between cohesionvariables and coupling variables?
 
Is there any significant relationship between cohesionand the size of a class?
 
Is there any significant relationship between cohesionand the level of inheritance in a class?
 
Is there any significant relationship between couplingvariables and the size of a class?
 
Is there any significant relationship between couplingvariables and inheritance?
 
Is it true that the larger the number of methods, thelower the cohesiveness, and the higher the coupling of the class?
C.
 
Statemment of Research Hypotheses
 
H0: There is no significant relationship between classcohesion and coupling.H1: There is significant relationship between classcohesion and coupling.
 
H0: There is no significant relationship between classcohesion and the size of a classH1: There is significant relationship between classcohesion and the size of a class.
 
H0: There is no significant relationship between classcohesion and inheritance.H1: There is significant relationship between classcohesion and inheritance.
 
H0: There is no significant relationship betweencoupling and inheritance.H1: There is significant relationship between couplingand inheritance.
 D.
 
 Methodology
Chidamber and Kemerer’s Lack of Cohesion in Methods(LCOM) metric was experimentally examined using ametric tool that computes Chidamber and Kemerer metric (ckjm), and a Java based Scanning program. TheChidamber and Kemerer metric tool and the Java basedscanning program were applied in the experimentalstudy of 3250 classes from five Java based industrialsystems in order to measure class cohesion, coupling,and inheritance in the selected systems. The choice of Chidamber and Kemerer metric as the base metric for this study was informed by the fact that the componentsof the metric enabled the measurement of all variablesneeded in this study such as Lack of Cohesion inMethods (LCOM), Coupling Between Object classes(CBO), Weighted Methods per Class (WMC), Depth of Inheritance Tree (DIT), Number of Children (NOC),
Identify applicable sponsor/s here.
(sponsors)
176http://sites.google.com/site/ijcsis/ISSN 1947-5500
 
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 6, June 2011
and Response For a Class (RFC). Two other metrics,although not part of Chidamber and Kemerer were usednamely: Number of Public methods (NPM), andAfferent Coupling (CA). The decision to incorporatethe use of NPM and CA metrics in this study wasinformed by the need to have a measure of the number of public methods as well as a measure of afferentcoupling in the systems. Moreover the metric tool usedto compute the Chidamber and Kemerer metrics alreadyincorporated NPM and CA measures. Cohesion ismeasured by LCOM; coupling measured by CBO, RFC,CA; size is measured by WMC, NPM; inheritance ismeasured by DIT, NOC.In the experiment, a maximum number of Java classesin the selected systems were examined. The consideredsystems varied not only in size but also in domain.System 1, a small compiler project system has 34classes. System 2, an open source GNU Java Server Pages (JSP) has 318 classes. System 3, a metric systemfor calculating Chidamber and Kemerer metrics has 383classes. System 4, a Java based tool from OpenCmssystems has 1055 classes. System 5, a mathematicaldatabase tool has 1460 classes. Some of thecharacteristics of the selected systems are presented inTable1.1. The environment for the computation of theChidamber and Kemerer metric consist of a JavaScanning tool to scan the system source codes used inthis study in order to extract data about classes such asthe number of classes in the system, number of attributes, number of methods, and the size in repositoryof the systems. This information was treated in a second phase by a Chidamber and Kemerer metric tool [ 9]which was used to compute metric values for LCOM,CBO, WMC, DIT, NOC, RFC, NPM and CA.The metric calculation process is presented in Figure1.2.Descriptive Statistics (mean, median, minimum,maximum, standard deviation) and correlation analysis(Spearman’s Correlations) were used to analyze theresults. Tests of hypotheses were carried out to examineif there were relationships between cohesion andcoupling variables, cohesion and class size variables,cohesion and inheritance, coupling and class sizevariables, coupling variables and number of children,coupling and inheritance variables..
Table 1.1.
Some characteristics of the selected testsystems
 Sys1Sys2 Sys3 Sys4 Sys5 Total
 No of classes34 318 383 1055 1460 3254 No of methods(Pro&Pub30 3388 685 22000 223066 249179 No of  publicmethods21 2536 266 6232 6414 15476Sizein(KB)3.9 172.9 180 770 1030 2157.9
System System MetricMeasuresFigure 1.2
Metric calculation process
 
The remainder of this study is organized as follows: section 2examines the approaches to measuring software complexity.SystemSource Code(Java)JavaScanner ClassesDataMetricToolResult
177http://sites.google.com/site/ijcsis/ISSN 1947-5500

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->