Sdvds

Topics: Object-oriented programming, Software metric, Software quality Pages: 153 (20764 words) Published: January 21, 2013
!

"#

$

%&

'

!
(
!

)
*

(

+,
-

.#

.

%

/

#
"
+

# !0 # "
1.#

*
1
,

$

2
$
2
4

#
2

%3 # %
#+

!

Abstract
The purpose of this report is to evaluate if software metrics can be used to determine the objectoriented design quality of a software system. Several metrics and metric-tools are presented and evaluated. An experimental study was conducted as an attempt to further validate each metric and increase knowledge about them. We present strategies on how analysis of source code with metrics can be integrated in an ongoing software development project and how metrics can be used as a practical aid in code- and architecture investigations on already developed systems. The conclusion is that metrics do have a practical use and that they to some extent can reflect software systems design quality, such as: complexity of methods/classes, package structure design and the level of abstraction in a system. But object-oriented design is much more than that and the metrics covered by this report do not measure vital design issues such as the use of polymorphism or encapsulation, which are two vital parts of the object-oriented paradigm.

As long as no general design standard exists, general metric threshold values will be difficult to determine. Locally however, rules for writing code can be constructed and metrics can be used to assure that the rules are followed. So metrics do have a future but they will always be limited by the subjectivity of software design.

2

C ONTENTS
1.

INTRODUCTION .............................................................................................5 1.1

Background ..............................................................................................................................5

1.2

Defining high quality code .......................................................................................................6

1.2.1

Package Structures in Java ...............................................................................................6

2. SELECTION OF METRICS................................................................................8 2.1

Properties of a Metric ...............................................................................................................8

2.2

Size Related..............................................................................................................................8

2.2.1

Lines of Code (LOC)........................................................................................................9

2.2.2

Halstead Metrics...............................................................................................................9

2.2.3

Maintainability Index (MI).............................................................................................11

2.3

Method Level .........................................................................................................................12

2.3.1

Cyclomatic Complexity (CC).........................................................................................13

2.3.2

Extended Cyclomatic Complexity Metric (ECC)...........................................................14

2.4

Class Level .............................................................................................................................15

2.4.1

Weighted Methods per Class (WMC) ............................................................................15

2.4.2

Lack of Cohesion in Methods (LCOM) .........................................................................16

2.4.3

Depth of Inheritance Tree (DIT) ....................................................................................18

2.4.4

Number of Children (NOC)............................................................................................20

2.4.5

Response For a...

References: Sloan School of Management, 1993.
[4] Norman E. Fenton, Shari L. Pfleeger, Software Metrics A Rigorous & Practical Approach,
Second Edition, PWS Publishing Company, 1997.
[6] Software Engineering Standards Committee of the IEEE Computer Society, IEEE Standard for a
Software Quality Metrics Methodology, IEEE Std 1061-1998, 1998.
2, pp. 308-320, 1976.
Started,
http://heim.ifi.uio.no/~kristen/FORSKNINGSDOK_MAPPE/F_OO_start.html, 2004-06-04.
Vol. 14, Issue 3, pp. 147-160, 2002.
[14] Aldo Liso, Software Maintainability Metrics Model: An Improvement in the Coleman-Oman
Model, http://www.stsc.hill.af.mil/crosstalk/2001/08/liso.html, 2004-05-17.
Canada, NRC 44146, 2000.
[16] David N. Card, Khaled El Emam, Betsy Scalzo, Measurement of Object Oriented Software
Development Projects, Software Productivity Consortium, Herndon, Virgina, 2001.
143-158, 1996.
[18] Letha Etzkorn, Carl Davis, Wei Li, A Statistical Comparison of Various Definitions of the LCOM
Metric, The University of Alabama, Huntsville, TR-UAH-CS-1997-02, 1997.
[19] Radu Marinescu, Measurement and Quality in Object Oriented Design, University of Timisoara,
2002.
[21] Robert C. Martin, Object Oriented Design Quality Metrics an Analysis of Dependencies,
http://www.objectmentor.com/resources/articles/oodmetrc.pdf, 2004-06-04.
[23] Robert C. Martin, Design Principles and Design Patterns,
http://www.objectmentor.com/resources/articles/Principles_and_Patterns.PDF, 2004-06-04.
Metrics Symposium, 5-7 Nov, pp. 137-142, 1997.
[25] Joshua Bloch, Effective Java, Addison-Wesley Pub. Co, First Edition, 2001.
[27] Mei-Huei Tang, Ming-Hung Kao, Mei-Hwa Chen, An Empirical Study on Object Oriented
Metrics, State University of New York, Albany, 1999.
[28] Kurt D. Welker, Paul W. Oman, Software Maintainability Metrics Models in Practise,
http://www.stsc.hill.af.mil/crosstalk/1995/11/Maintain.asp, 2004-06-04.
Symposium, 20-21 Nov, 1998.
Continue Reading

Please join StudyMode to read the full document

Become a StudyMode Member

Sign Up - It's Free