Comparison indices each for two components incorporated in a source
program are used for easy and quantitative evaluation of functional
redundancy in the program, effective and accurate extraction of redundant
code segments from the program and also effective and accurate extraction
of components to be modified simultaneously. A tree T is entered and an
initial level of functional redundancy m(P) is set at 0 in a program P
expressed by the tree T. The top node of the tree T is selected as a node
N. A specific computation is performed for the top node selected as the
node N with attribute information including the similarity and the number
of children of the node N to obtain a level .alpha.. The level .alpha. is
added to the functional redundancy m(P). The specific computation is
performed for every node in the tree T, to obtain functional redundancy
m(P) including the total of .alpha. for all nodes.