Draft AliAlJadaa2
Draft AliAlJadaa2
net/publication/272830375
Software Metrics
CITATIONS READS
0 8,591
1 author:
Ali A. Aljadaa
Birzeit University
4 PUBLICATIONS 5 CITATIONS
SEE PROFILE
All content following this page was uploaded by Ali A. Aljadaa on 27 February 2015.
Ali A. Al-Jadaa
To achieve more efficiency of applications and raise the ability to distinguish between them, we
need metrics which measurable and applicable. So that, software metrics are proposed to help
show indications for quality, size, complexity, etc. software metrics are usually applied by software
metrics tools. In this report, I will present the definition of the measurement and its types, as well
as I will define the software metrics. Furthermore, I will present software metric types, and some
tools which used.
Contents
Acknowledgment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1 Introduction 4
2 Measurements 5
2.1 What is Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Scales of Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Whey we Need Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Software Metrics 7
3.1 Definition of Software Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Software Metrics Classifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3 Types Of Software Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3.1 Size Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3.2 Object Oriented Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3.3 Service Oriented Architecture Metrics . . . . . . . . . . . . . . . . . . . . . . 11
3.3.4 Component Based Software Engineering Metrics . . . . . . . . . . . . . . . . 12
2
Acknowledgment
First and always thank God. I am especially grateful to Professor Adel Taweel for his constructive
criticisms, patience and valuable comments and suggestions to my work. I have been very lucky to
have the continuing support and encouragement from my family especially from my father, mother
and my wife . To all them many thanks. . . .
3
Chapter 1
Introduction
In recent years, software has become an important source of financial income for many compa-
nies, and companies compete to provide the most software efficiency and most quality for customers.
Even companies can evaluate the software special to raise the quality and reduce the time of de-
livery, should have to be used software metrics. Software metrics able to predict the requirements
of the project in terms of personnel and the time required to it. In addition to the more accurate
assessment of the financial cost of the project in general or for each part of it[1]. As regards to the
developer, will have to estimate the amount of effort to the development ,testing and maintenance,
in addition to the possibility of being able to choose external programming sources for the project
if he decided to use components or Services. Regarding customers, will have the full ability to
distinguish between different products and the ability of a clear choice best suited for them.
Software metrics defined as a measurements for the pieces or characteristics of applications in their
life cycle. Many researches classified software metrics which will present in chapter 3 in details.
Each metric covers certain side in software as size of the product and so on. in other hand there are
some metrics specific in special approach as object oriented metrics or other software engineering
approaches. To apply software metrics there are tools which simplified using it.
The organization of this report as follows.The section 2 describes the measurement in general then
the level of measures Section 2.2. Chapter 3 presents the software metrics definition in general in
3.1. the classifications of software metrics will present in 3.2 . the types will show in 3.3 . finally,
chapter 4 presents 5 tools using software metrics .
4
Chapter 2
Measurements
This chapter presents the definition of the measurement and its level scale, in addition to show why
we need it.
1. Nominal Scale
Used to marked items to classification. Dont have numerical values or order. For example:
This application Portable or Portable.
2. Ordinal Scale
This level provides an ordering for items, as the first, second, third and so on. In other words,
5
the larger number offers more value and so on. But this does not offer the difference between
orders, and do not use the basic math operations .
3. Interval Scale
This level gives a degree of difference between items, but does not offer the ratio between
them. We can use addition and subtraction operations only, and it is used to calculate the
mean and standard deviation.
4. Ratio Scale
This is the high level of scales. ratio scale has an absolute zero. Ratio are possible between
items.
6
Chapter 3
Software Metrics
This chapter presents the definition of the software metrics in the first . then show the classifications
of software metrics. Finally, presents some types of metrics.
7
3.3.1 Size Metrics
Lines of Code (LOC)
It is the number of lines of code are in application includes the namespace, classes, and methods [1].
In addition to blank lines, comment lines, data declarations. There is another metric of line of code
called Non-Commented LOC (NCLOC). It is the same of LOC, but it did not considered the blank
lines, comment lines, data declarations [6]. Because these things dont use by the application. See
figure 3.1. The usage of LOC as follows: determine the size of modules to estimate the time or the
requirement in implementation or maintenance. For examples and according to [7],the Windows
NT 3.1 contains 4-5 million LOC, but Windows 2003 server contains 50 million LOC, and that gives
us an overview of the huge difference between the two systems.
Token Count
LOC is not the only way to measure size of software. the other way is function points (FP), and
defined as ” a unit of measurement to express the amount of business functionality an information
system (as a product) provides to a user” [10, 9].
This metric comprise software in five major components:
8
1. Number of external inputs, low complexity, 3; high complexity, 6 .
To calculate the FP you must calculate function count (FC) as following formula 3.1.
5 X
X 3
FC = Wij ∗ Xij (3.1)
i=1 j=1
Where W the weighting factors of five components. X are the count of each component in software.
Then we must calculate the value adjustment factor (VAF) as following formula 3.2.
14
X
V AF = 0.65 + .01 Ci (3.2)
i=1
F P = F C ∗ V AY (3.3)
CBO it is refer to the number of coupled classes with a specific class [12] in other words, rate of
number of links between number of classes. See formula(3.1)[13].
N umberof Links
CBO = (3.4)
N umberof Calsses
If the CBO = 0, that means the class dont have any relation with other classes in the system, and
maybe it is not a part of the system. The normal value for CBO is between 1 to 4 and that gives us
the class can be more reusable. Over that means too tightly coupled class which make the testing
and upgrading the system more complex [12].
9
Depth of Inheritance Tree (DIT)
DIT refers to the maximum inheritance path from the nood to the root class [12]. Example, In
Java language any class has a java.lang.Object as super class ( root). The DIT value of the class
java.lang.Object is 0, and any subclass of this calss has DIT value 1, then any subclass of that class
will have a value 2 of DIT metric, and so on[14]. see figure 3.2.
NOC according to [12]: the number of immediate subclasses subordinated to a class hierarchy. In
other simple words, it is the number of subclasses of class [15]. See figure 3.3. The normal range of
NOC value is between 1 to 4. More childs of class means more reusability, and that indicates the
class it may require more testing of its own methods [16]
In object oriented programming there is at least one method for each class. WMC refers to the
summation of complexity of all methods for a specific class [12], See figure 3.4.
10
Figure 3.4: Example of (WMC).
The importance of this metric are in three things. Firstly, number of methods and summation of
complexity of them, predict the time required to implementation and maintenance. Secondly, the
large number of methods effects directly childrens, because they inherit all methods. Finally, the
larger number of methods in class make it more specific, and that means less reuse.
RFC refer to the number of the methods that can called in response to a message or invoke a specific
class[12].
11
3.3.4 Component Based Software Engineering Metrics
1. Time to Use This metric used to estimate the time need for developer to learn how use the
competent[18].
2. Required Interfaces
This metric refer to the number of interfaces requires to operate the component from others.[19].
3. Error of Propagation
This metric used as physical security, which means the ability of random error in the infor-
mation transmitted from Component X to Y results in an erroneous state of Y. [20]
12
Chapter 4
1. Analyst4j
This tool is used with Eclipse IDE plugins for java language, it is provides a search, metrics,
analyzing quality, and report generation.
3. OOMeter
This tool was developed by Alghamdi [11], its compatible with Java and Csharp languages.
In addition to the UML models in XMI. This tool can provides various metrics [22].
4. Semmle
This tool using as an Eclipse IDE plugins, it is provides SQL search bugs and others for Object
Oriented code [23].
5. VizzAnalyzer
This tool is a quality analysis , it provides reading software code and designs in addition to
documentations [24]
13
Bibliography
[1] Norman E Fenton and Shari Lawrence Pfleeger. Software metrics: a rigorous and practical
approach. PWS Publishing Co., 1998.
[3] Everald E. Mills, Everald E. Mills, and Karl H. Shingler. Software metrics - sei curriculum
module sei-cm-12-1.1, 1988.
[4] Elfriede Dustin, Thom Garrett, and Bernie Gauf. Implementing automated software testing:
How to save time and lower costs while raising quality. Pearson Education, 2009.
[5] Rüdiger Lincke, Jonas Lundberg, and Welf Löwe. Comparing software metrics tools. In Pro-
ceedings of the 2008 international symposium on Software testing and analysis, pages 131–142.
ACM, 2008.
[6] Alsmadi. Software metrics: toward building proxy models. Master’s thesis, North Dakota State
University of Agri-culture and Applied Science, 2006.
[7] Knowing.NET. How many lines of code in windows? Technical report, December 6, 2005.
[9] Gurdev Singh, Dilbag Singh, and Vikram Singh. A study of software metrics. IJCEM Inter-
national Journal of Computational Engineering & Management, 11:22–27, 2011.
[10] Allan J Albrecht. Measuring application development productivity. In Proceedings of the Joint
SHARE/GUIDE/IBM Application Development Symposium, volume 10, pages 83–92, 1979.
[12] Shyam R Chidamber and Chris F Kemerer. A metrics suite for object oriented design. Software
Engineering, IEEE Transactions on, 20(6):476–493, 1994.
14
[13] Coupling Between. http://goo.gl/4bvo6x. last access 23/12/2014.
[17] Eric Newcomer and Greg Lomow. Understanding SOA with web services (independent technol-
ogy guides). Addison-Wesley Professional, 2004.
[18] Manuel F Bertoa and Antonio Vallecillo. Quality attributes for cots components. 2002.
[19] Joaquina Martı́n-Albo, Manuel F Bertoa, Coral Calero, Antonio Vallecillo, Alejandra Cechich,
and Mario Piattini. Cqm: A software component metric classification model. IEEE Transac-
tions onJjournal Name, 2003.
[20] Mark Shereshevsky, Habib Ammari, Nicholay Gradetsky, Ali Mili, and Hany H Ammar. In-
formation theoretic metrics for software architectures. In Computer Software and Applications
Conference, 2001. COMPSAC 2001. 25th Annual International, pages 151–157. IEEE, 2001.
[22] Jarallah S Alghamdi, Raimi A Rufai, and Sohel M Khan. Oometer: A software quality as-
surance tool. In 2011 15th European Conference on Software Maintenance and Reengineering,
pages 190–191. IEEE Computer Society, 2005.
15