0% found this document useful (0 votes)
13 views17 pages

Draft AliAlJadaa2

The document discusses software metrics including definitions, types, and tools. It defines software metrics and outlines classifications. It also describes different types of metrics like size, object-oriented, service-oriented architecture, and component-based software engineering metrics. Finally, it mentions some software metrics tools.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views17 pages

Draft AliAlJadaa2

The document discusses software metrics including definitions, types, and tools. It defines software metrics and outlines classifications. It also describes different types of metrics like size, object-oriented, service-oriented architecture, and component-based software engineering metrics. Finally, it mentions some software metrics tools.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/272830375

Software Metrics

Technical Report · December 2014


DOI: 10.13140/2.1.4026.1923

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.

The user has requested enhancement of the downloaded file.


Software Metrics

Ali A. Al-Jadaa

Birzeit University Faculty of Engineering and Information Technology Master of


Computing-Software Engineering Course 2014
Abstract

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

4 Software Metrics Tools 13


References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

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.

2.1 What is Measurement


According to Norman and Shari in [1], measurement is the process by which number or symbols
are assigned to attributes of entities in the real world in such a way as to describe them according
to clearly defined rules. In other simple words, measurement makes value more meaningful, and
more useful [2].For example, instead of saying someone is fat, we can say his weight is 120 Kg. In
softwares, instead of saying an application is big, we can say it is contain a one million of lines of
code.
There are tow main types of software measures[2]:

1. Direct Measures (internal attributes) Cost, effort, LOC, speed, memory

2. Indirect Measures (external attributes) Functionality, quality, complexity, efficiency,


reliability, maintainability

2.2 Scales of Measurement


The measurement categories into four levels[3].

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.

2.3 Whey we Need Measurement


We need measurement in software for different ways. Firstly, in order to improve, determine and
predict the product or process. Secondly, in order to raise the ability to determine the requirements.
We can expect the time to end the project or future projects, and gives us the ability to predict
the number of staff required to finish the project, in addition to the possibility of estimating the
financial cost and other things. Thirdly, in order to make comparisons between different products,
which aim to choose the best ones and thus raise the final product of the project level.

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.

3.1 Definition of Software Metrics


Many definitions for software metrics but the most widely used is a measure for the pieces or
characteristics of applications in their life cycle, which mapping the modules of an application to
numerical values [1].

3.2 Software Metrics Classifications


There is many classifications for software metrics in the literature. According to [3] it is three main
types: Products: Explicit results of software development activities ,deliverable, documentation,
by products. Processes :Activities related to production of software. Resources:Inputs into the
software development activities hardware, knowledge, people. Other researches as[4], classify the
software metrics as follows : Implementation metrics, Testing metrics, Designing metrics, Man-
agement metrics and son on. The next section presents a classification for software metrics which
based on software engineering approaches : Object Oriented metrics , Service Oriented Architecture
metrics, Component Based Software Engineering metrics. In addition to the most commonly type
used Size metrics[5].

3.3 Types Of Software Metrics


This section presents four main types of metrics, the Size Metrics, Object Oriented Metrics, Service
Oriented Metrics and Component Based Software Engineering 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.

Figure 3.1: Example Lines of Code (LOC)[8].

Token Count

Each software is considered to be a summation of tokens, which may be operators or operands[9].


n1 = number of unique operators
n2 = number of unique operands.
N1 = number of total occurrences of operators.
N2 = number of total occurrence of operands.
Token Count = N1 + N2

Function Points (FP)

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 .

2. Number of external outputs,low complexity, 4; high complexity, 7 .

3. Number of logical internal files, low complexity, 7; high complexity, 15.

4. Number of external interface files, low complexity, 5; high complexity, 10.

5. Number of external inquiries, 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

Where C is the score for general system characteristic i.


-Note: you can see the list of general system characteristic in [11].
Finally, calculate the FP as following formula 3.3.

F P = F C ∗ V AY (3.3)

3.3.2 Object Oriented Metrics


Coupling between Objects (CBO)

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.

Figure 3.2: Example of (DIT).

Number of Children (NOC)

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]

Figure 3.3: Example of (NOC).

Weight Methods per Class (WMC):

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.

Response For a Class (RFC)

RFC refer to the number of the methods that can called in response to a message or invoke a specific
class[12].

3.3.3 Service Oriented Architecture Metrics


1. Number of Services (NS) NS is the count of services in the system. The range value of
NS is from 0 to infinity.

2. Network Cohesion in the System( NCY)


This metric used to identify the number of direction relations between the nodes in the
software[17].

3. Services Interdependence in the System (SIY)


This metric represents the number of pairs of services which depend on each other[17].

4. Absolute Importance of the Service (AIS)


This metric represents the number of clients which depends on one service[17].

5. Sizes of Input and Output Messages


According to [17], it is ”The number of arguments of a method (of a function, of an operation,
etc.)”.

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

Software Metrics Tools

1. Analyst4j
This tool is used with Eclipse IDE plugins for java language, it is provides a search, metrics,
analyzing quality, and report generation.

2. C and C++ Code Counter (CCCC)


This tool is an open source tool, it is a command line tool. it is provides a various of metrics
as LOC, it’s useful for analyzes C++ and JAVA Language[21]

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.

[2] Business dictionary. http://www.businessdictionary.com/definition/measurement.html. Last


Access : 12/2014.

[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.

[8] Lines Of Code-wikipedia. http://en.wikipedia.org/wiki/sourcelinesofcode. last access


23/12/2014.

[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.

[11] pearson. http://home.pearsonhighered.com/. last accsess 23/12/2014.

[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.

[14] DIT. http://staff.unak.is/andy/staticanalysis0809/metrics/dit.html. 23/12/2014.

[15] NOC. http://staff.unak.is/andy/staticanalysis0809/metrics/noc.html. last access 23/12/2014.

[16] Number of Children. http://goo.gl/rnzzxn. 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.

[21] CCCC. http://sourceforge.net/projects/cccc. last access 23/12/2004.

[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.

[23] semmle. http://semmle.com. last access 23/12/2014.

[24] arisa. http://www.arisa.se. last access 23/12/2014.

15

View publication stats

You might also like