Information Technology Reference
In-Depth Information
5.3.2
Henry-Kafura (1981) Information Flow
This is a metric to measure intermodule complexity of source code based on the
in-out flow of information (e.g., parameter passing, global variables, or arguments)
of a module. A count is made as follows:
I : Information count flowing in the module
O : Information count flowing out of the module
w : Weight (a measure of module size)
c : Module complexity
O ) 2
c
=
w ( I
×
(5.4)
For a source code of n modules, we have
n
n
w j I j xO j 2
C
=
c j =
(5.5)
j = 1
j = 1
5.3.3
Halstead's (1997) Software Science
Maurice Halstead's approach relied on his fundamental assumption that a program
should be viewed as an expression of language. His work was based on studying
the complexities of languages—both programming and written languages. Halstead
found what he believed were mathematically sound relationships among the number
of variables, the type of programming language statements, and the complexity of
the code. He attacked part of the first and second reasons a programmer might find
code complex.
Halstead derived more than a dozen formulas relating properties of code. The
following is a representative sample of his work:
Vocabulary (
η
)
= η 1 + η 2
(5.6)
Length ( N )as N
=
N 1
+
N 2
(5.7)
Vo l u m e ( V )as V
=
N log 2 η
(the program's physical size)
(5.8)
Potential volume ( V )as V =
+ η 2 log 2 (2
+ η 2 )
(2
(5.9)
where
η 2 is the number of distinct
operands in the code, N 1 is the number of all operators in the code, and N 2isthe
number of all operands in the code.
η 1 is the number of distinct operators in the code,
Search WWH ::




Custom Search