There are several methods measuring the complexity of object-oriented programs. Most
of them are based on some special object-oriented feature: number of methods/classes,
cohesion of classes, inheritance, etc. In practice, however, object-oriented programs
are constructed with the help of the same control structures as traditional ones.
Moreover, recent ideas of multiparadigm programming (i.e., emerging use of generic
programming and aspect-oriented programming) has the effect that in modern programs-and
even in class libraries-object-orient at ion is only one (however major) construction
tool among others. An adequate measure therefore should not be based on special features
of one paradigm, but on basic language elements and construction rules which could
be applied to many different paradigms. In our model discussed here, the complexity
of a program is the sum of three components: the complexity of its control structure,
the complexity of data types used, and the complexity of the data handling (i.e.,
the complexity of the connection between the control structure and the data types).
We suggest a new complexity measure. First, we show that this measure works well on
procedural programs, and then we extend it to object-oriented programs. There is a
software tool under development based on gnu g++ compiler which computes our new measure.
We can apply this tool to C and C++ sources to gain a number of quantitative results
with our measure. (C) 2003 Elsevier Ltd. All rights reserved.