k.Sivapriya
II.MSc(IT)
Department of CS &IT
Nadar saraswathi college of arts and science
Theni
 Most of the metrics incorporate easily computed
properties of the source code ,such as the number of
operators and operands, the complexity of the source
code.
 Such as the number of operators and operands, the
complexity of the control flow graph, the number of
parameters and global variables in routines.
Two source code metrics are discussed in this section
 Halstead’s effort equation
 McCabe’s cyclomatic complexity measure.
 Halstead developed a number of metrics that are
computed from easily obtained properties of the
source code. These properties include the total
number of operators in a program, N1 ; the total
number of operands in the program,N2; the number of
unique operators in the program n1; and the number
of unique operands ,n2. FORTRAN routine and the
associated values of N1,N2 ,n1 and n2.
Halstead defines several quantities using these number.
For example the program length N is defined as
N1+N2;(N1+N2=50). Halstead’s estimator of program
length is:
 N=n1 log2 n1 + n2 log2 n2
Example
 N=10(3.2)+7(2.8)=52.9
 Program volume is defined as
 V=(N1+N2) log2(n1+n2)
 Language level(level of abstraction) is
 L=(2*n2)/(n1*N2)
 Defined as V/L
 E=(n1*N2*(N1+N2)*log2(n1+n2))/(2*n2)
McCabe has observed that the difficulty of
understanding a program is largely determined by the
complexity of the of the control flow graph for that
program. The cyclomatic number V of a connoted
graph G is the number of linearly independent path in
thee graph. V(G) is computed as follows:
 V(G)= E-n +2p
Where
 E is the number of edges
 N is the number of nodes
 P is the number of connected components.
 Because software maintenance is a microcosm of
software development, the activities that a software
maintainer may become involved in span the entire
spectrum of software engineering.
 Automated tools to support software maintenance
include technical support tools and managerial
supports tools.
 A text editor permits rapid, efficient modification of
source programs test data and supporting documents.
text editors can be used to insert and replace
segments of source code , internal comments, test
data, and supporting documents.
 Debugging aids provide traps, dumps, traces, assertion
checking, and history files to aid in locating the causes
of known errors.
 A linkage editor links together objet models of
compiled code to produce an executable program.
 A comparator compares two files of information and
reports the differences.
 Use of complexity metrics requires automated tools to
compute the measures of interest.
 They can be used to track the history of each module
in a system by recording which modules and which
versions of which modules comprise which system
releases.

source code metrics and other maintenance tools and techniques

  • 1.
    k.Sivapriya II.MSc(IT) Department of CS&IT Nadar saraswathi college of arts and science Theni
  • 2.
     Most ofthe metrics incorporate easily computed properties of the source code ,such as the number of operators and operands, the complexity of the source code.  Such as the number of operators and operands, the complexity of the control flow graph, the number of parameters and global variables in routines.
  • 3.
    Two source codemetrics are discussed in this section  Halstead’s effort equation  McCabe’s cyclomatic complexity measure.
  • 4.
     Halstead developeda number of metrics that are computed from easily obtained properties of the source code. These properties include the total number of operators in a program, N1 ; the total number of operands in the program,N2; the number of unique operators in the program n1; and the number of unique operands ,n2. FORTRAN routine and the associated values of N1,N2 ,n1 and n2.
  • 5.
    Halstead defines severalquantities using these number. For example the program length N is defined as N1+N2;(N1+N2=50). Halstead’s estimator of program length is:  N=n1 log2 n1 + n2 log2 n2 Example  N=10(3.2)+7(2.8)=52.9  Program volume is defined as  V=(N1+N2) log2(n1+n2)  Language level(level of abstraction) is  L=(2*n2)/(n1*N2)  Defined as V/L  E=(n1*N2*(N1+N2)*log2(n1+n2))/(2*n2)
  • 6.
    McCabe has observedthat the difficulty of understanding a program is largely determined by the complexity of the of the control flow graph for that program. The cyclomatic number V of a connoted graph G is the number of linearly independent path in thee graph. V(G) is computed as follows:  V(G)= E-n +2p Where  E is the number of edges  N is the number of nodes  P is the number of connected components.
  • 7.
     Because softwaremaintenance is a microcosm of software development, the activities that a software maintainer may become involved in span the entire spectrum of software engineering.  Automated tools to support software maintenance include technical support tools and managerial supports tools.
  • 8.
     A texteditor permits rapid, efficient modification of source programs test data and supporting documents. text editors can be used to insert and replace segments of source code , internal comments, test data, and supporting documents.  Debugging aids provide traps, dumps, traces, assertion checking, and history files to aid in locating the causes of known errors.  A linkage editor links together objet models of compiled code to produce an executable program.
  • 9.
     A comparatorcompares two files of information and reports the differences.  Use of complexity metrics requires automated tools to compute the measures of interest.  They can be used to track the history of each module in a system by recording which modules and which versions of which modules comprise which system releases.