Sdvds

Only available on StudyMode
  • Download(s) : 21
  • Published : January 21, 2013
Open Document
Text Preview
!

"#

$

%&

'

!
(
!

)
*

(

+,
-

.#

.

%

/

#
"
+

# !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...
tracking img