properties of object-oriented software measuresproperties of object-oriented software measures horst...

22
Properties of Object-Oriented Software Measures Horst Zuse Technische Universität Berlin Fachbereich Informatik Franklinstraße 28/29 FR 5-3 10587 Berlin Gemany E-mail: zuse at cs.tu-berlin.de Phone: +49-30-314-73439 Fax: +49-30-314-21103 WWW: www.cs.tu-berlin.de/ zuse Keywords Software measures, software measurement, measurement theory, object-oriented software measures, concatenation operations, Dempster-Shafer Function of Belief, Kolmogoroff axioms, DeFinetti axioms, Dominance axiom. Abstract In this paper foundations of the properties of object-oriented software measures are presented. The criteria for the properties of object-oriented software measures are characterized with several binary operations between objects, classes, methods, etc. Binary operations can be used as a tool to give numbers an interpretation above the ordinal scale level. The result of this investigation is that software measures for object-oriented mostly do not assume an extensive structure. In order to get qualitative criteria for object-oriented measures, the Dempster-Shafer Function of Belief, the Kolmogoroff axioms and the DeFinetti axioms are introduced. These axioms give qualitative criteria for the use of object-oriented software measures between the weak order and the extensive structure. 1 Introduction In literature more than two hundred software measures /FETC95/ for applications in the area of object-oriented programming can be found. This process of defining new measures is not finished today. The reason for such a lot of measures may be problems in understanding and maintaining object- oriented programs. In order to show properties of software measures, we use measurement theory which allows us to translate mathematical / numerical properties of measures back to empirical (intuitive) properties and vice versa. We can do this under the assumption of a homomorphism. In the past we used the extensive structure and the independence conditions /ZUSE92/ to characterize software measures with empirical properties. This concept leads, among others, to the characterization of scale types. . In the area of object-oriented software measures the concept of the extensive structure cannot be applied in the same way as for imperative languages. The reason is that the extensive structure is not assumed by many measures in the object-oriented environment. In order to have criteria for properties of measures above the ordinal level for object-oriented software measures, we introduce weaker axioms than the axioms of the extensive structure. We introduce the

Upload: others

Post on 18-Mar-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Properties

of

Object-Oriented Software Measures

Horst Zuse

Technische Universität BerlinFachbereich InformatikFranklinstraße 28/29

FR 5-310587 Berlin

GemanyE-mail: zuse at cs.tu-berlin.de

Phone: +49-30-314-73439Fax: +49-30-314-21103

WWW: www.cs.tu-berlin.de/~zuse

Keywords

Software measures, software measurement,measurement theory, object-oriented softwaremeasures, concatenation operations,Dempster-Shafer Function of Belief,Kolmogoroff axioms, DeFinetti axioms,Dominance axiom.

Abstract

In this paper foundations of the propertiesof object-oriented software measures arepresented. The criteria for the properties ofobject-oriented software measures arecharacterized with several binaryoperations between objects, classes,methods, etc. Binary operations can be usedas a tool to give numbers an interpretationabove the ordinal scale level. The result ofthis investigation is that software measuresfor object-oriented mostly do not assume anextensive structure. In order to getqualitative criteria for object-orientedmeasures, the Dempster-Shafer Function ofBelief, the Kolmogoroff axioms and theDeFinetti axioms are introduced. Theseaxioms give qualitative criteria for the useof object-oriented software measuresbetween the weak order and the extensivestructure.

1 Introduction

In literature more than two hundred softwaremeasures /FETC95/ for applications in thearea of object-oriented programming can befound. This process of defining new measuresis not finished today. The reason for such a lotof measures may be problems inunderstanding and maintaining object-oriented programs.

In order to show properties of softwaremeasures, we use measurement theory whichallows us to translate mathematical /numerical properties of measures back toempirical (intuitive) properties and vice versa.We can do this under the assumption of ahomomorphism. In the past we used theextensive structure and the independenceconditions /ZUSE92/ to characterize softwaremeasures with empirical properties. Thisconcept leads, among others, to thecharacterization of scale types..In the area of object-oriented softwaremeasures the concept of the extensivestructure cannot be applied in the same way asfor imperative languages. The reason is thatthe extensive structure is not assumed bymany measures in the object-orientedenvironment. In order to have criteria forproperties of measures above the ordinal levelfor object-oriented software measures, weintroduce weaker axioms than the axioms ofthe extensive structure. We introduce the

Function of Belief, the Kolmogoroff axiomsand De Finetti axioms.

The paper is structured as follows: In Section2 we introduce some aspects of measurementtheory, in Section 3 we discuss properties ofobject-oriented measures with a new axiomsystem derived from the function of belief, inSection 4 we summarize the results, in Section5 conclusions are given, in Section 6 followsan attachment related to measurement theory,and Section 7 contains the used references.

2 Measurement Theory

There exists a theory, called measurementtheory, which gives conditions how tocombine empirical conditions with numericalconditions. Measurement theory is also aproper theory to translate mathematicalproperties of measures back to empiricalproperties under the assumption of ahomomorphism. Readers who are interested toget a deeper understanding of measurementtheory we refer to Roberts /ROBE79/, toKrantz et al. /KRAN71/, Luce et al. /LUCE90/and to some works of the author, like/ZUSE91/, /ZUSE92/, /BOLL93/, /ZUSE94b/.and the Attachment in Chapter 6.

In the past we investigated software measureswith measurement theory. We introducedempirical relations •≥ and called them, amongothers, as equally or more difficult tomaintain. Mainly, we used the Theorem of theextensive structure to derive empiricalconditions from the additive property of ameasure. The theorem of the extensivestructure in measurement theory says: aMeasure u, which is additive related to abinary / concatenation operation, assumes anextensive structure. An extensive structureconsists of a set of empirical conditions alsocalled axioms. The extensive structure consistsof the following six axioms:

1. Weak order.2. Axiom of weak positivity.3. Axiom of weak associativity.4. Axiom of weak commutativity.5. Axiom of weak monotonicity.6. Archimedian axiom.

These six necessary and sufficient empiricalconditions are, for example, assumed by theMeasure LOC. We illustrate this with apicture.

P2

P1

P2

P1P1

P3

P2

P1

P3

P1 P2

P2 P1

P1

P1

P3

P2

P2

P3

P2

P2

P1

P1

P3 P4

=>

.>=.=

=>.>=

.>=

>

.=

Weak Positivity Weak associativity

WeakCommutativity

Weak MonotonicityArchimedian axiom

Extensive Structure

Figure 2.1: Extensive structure forflowgraphs and a sequential concatenationoperation.

Every Measure u, which is additive, assumesan extensive structure. The approach of theextensive structure also can be applied to costestimation models, design and maintainabilitymeasures, etc.

2.1 Extensive Structure and ImperativeLanguages

In the area of structured programming,imperative languages, software design, etc.,we can find many software measures, whichare defined as additive measures. Examplesare LOC= |N|, and the Measure of McCabe:MCC-V2 = |E| -|N| + 1. From the extensivestructure we come easily to the additive ratioscale, and with a modification of thenumerical relations system we also come tothe non-additive ratio scale.

Put in other words. Using the concept of theextensive structure, the meaning of thenumbers of the measures could be interpretedby the empirical conditions of the extensivestructure. The extensive structure is theappropriate tool to characterize softwaremeasures above the ordinal scale level.

2.2 Extensive Structure an Object-Oriented Applications

However, in the area of object-orientedapplications, software measures mostly are notadditive related to a concatenation operation.Mostly, the Archimedian axiom, and/or theaxiom of weak monotonicity are violated. Weillustrate this with a picture.

Weak Positivity

ArchimedianAxiom

WeakCommutativity

WeakAssociativity

WeakMonotonicity

Extensive Structure

Figure 2.2: No Extensive Structure for themost object-oriented measures.

In order to discuss measurement structures inthe object-oriented area above the ordinalscale level, we consider qualitativeprobabilities, quantitative probabilities, andbelief structures or belief functions.

Ordinal Scale

Extensive Structure

Function of Belief

Ratio Scale

Figure 2.3: Ordinal scale, modified functionof belief, and extensive structure.

The picture above shows the goal of the newaxiom systems. Having only an ordinal scalelevel, we have a simple level of measurementstructures. We are far away from the empiricalconditions of the extensive structure. Themodified axioms of the function of belief shallhelp to get more empirical conditions for theinterpretation of measurement values in thedirection of the extensive structure.

3 Measurement Theory and Object-Oriented Software Measures

In this section foundations of the properties ofobject-oriented software measures arepresented.

3.1 Introduction

The criteria for the properties of object-oriented software measures are characterizedwith several concatenation operations between

objects, classes and methods. Concatenationoperations can be used as a tool to givenumbers an interpretation above the ordinalscale level. The result of this investigation isthat software measures for object-orientedtechniques have completely other propertiesthan measures for imperative languages. It isshown that many of the measures in theobject-oriented programming area follow theDempster-Shafer Function of Belief inArtificial Intelligence and the DeFinettiaxioms.

3.2 Abstraction Levels

In order to discuss object-oriented softwaremeasures, we have to discuss the abstractionlevel which we use for measurement in theobject-oriented area. For example, theMeasure of McCabe is based on theabstraction level of a flowgraph. We discussfor our investigation four levels of abstractionin the area of object-oriented measures.

3.2.1 Classes

The first level of abstraction is the class level.A class describes the properties of objects withattributes (often called instance variables) andmethods. A class has a set of attributes and aset of methods defined in it. In Figure 3.1 theabstraction of a class as a picture is presented.

3.2.1.1 Methods

The behavior of an object is characterized bythe methods defined in its class. A methodcontains the code of an OO program. Methodscan be seen as being subroutines, which areinvoked by messages sent to an object. Insome OO-systems methods are constructedsimilar as subroutines in structuredprogramming. The idea, in our case ofmeasurement, is therefore to treat methods asprocedures in software measurement.

A method in our view (measurement view)consists of a sequence of statements with asingle entry point and a single exit point. Thesequence of statements is executed each timethe method is called. That means, we canconsider the control flow (flowgraph) of themethod.

Additionally, a method can be parameterized,having a list of parameters. Parameters can beinput, output or both. So we can considersome data flow, additionally. In Figure 3.1 theabstraction of a class with methods ispresented.

3.3 Structures On Classes

Of course, classes are not the major structurein OO-systems. Classes are related to eachother by two types of relationship: usesrelationships and inheritance relationships/BOOC91/. Two other types of relationshipwill not be considered here, namely metaclasses and generic classes. These constructsare not under consideration by any proposedsoftware measure we found.

3.3.1 Inheritances Relationships

A class A inherits the properties / attributes ofclass B. The properties of Class B becomeadditional properties of Class A without beingdefined in Class A again. In turn, Class B is ageneralization of Class A.

In Figure 3.1 we have a class vehicle that isable to move. Car and bicycle arespecialization’s of vehicle, both are able tomove too. The method move and the attributewheels are inherited along the thick arrowfrom vehicle to its subclasses. These propertiesare not denoted for the inheriting class.

bicycle

vehiclewheels move

bellcar

horn honkring

Figure 3.1: Classes, methods, andInheritance.

We see, that we represent a class by arectangle. The inheritance is represented by athick arrow, which points to the class whichinherits. Methods are represented by a thinline assigned to the rectangle and a name ofthe method. The specialized classes haveadditional properties, i.e. a bike can ring it'sbell. A class can inherit properties from morethan one class. This case is called multipleinheritance and is shown in Figure 3.2

vehiclewheels move

boatmotor swim

amphibian vehicle

Figure 3.2: Multiple inheritance.

Here, the class amphibian vehicle is a specialcase of vehicle and of boat. So an amphibianvehicle can move and swim.

3.3.2 Uses Relationships

A Class A uses class B, if Class A accessesobjects of Class B. Let us consider a Classlibrary with a method borrow a book to borrowa book, where books is a class itself, then theClass book uses the Class Books. The use of aclass can be hidden by the implementation, theClass Library could use a Class List, withoutthe appearance in the interface of ClassLibrary. Booch divided these two cases intouses for interface and uses forimplementation. We denote the usesrelationship with a thin arrow to the used classand leave the kind of use unspecified.

Books

Library

Lists

Figure 3.3: Uses relationships.

3.4 OO-System Level

Taking classes and the two relationships onclasses (inheritance and uses relationship)together we can speak of an OO system. Thatis a set of classes and the uses and inheritancerelation on this set.

Typically, none of the two relations builds acomplete graph on the set of classes. Incontrast, both can build a couple ofunconnected subgraphs in one system. Inorder to be able to cope with structures onclasses, we define two subsets of systems.These are

a) inheritance hierarchies with one singleroot. The graph has to be connected,multiple inheritance is allowed.

b) uses hierarchies with one single mainclass that is the only class that is notused by any other class in that graph.The graph must be acyclic andconnected.

A system can consist of several of suchsubsystems. We discuss the properties ofmeasures related to the constructs as described

above. Both inheritance and uses hierarchiescontain the single class as a special case.

3.5 Concatenation Operations for Object-oriented Programs and their Properties

We now consider for each level of abstractionas described above, concatenation operations.We extend the approach to classes. To beapplicable as operations in measurementtheory, these concatenation operations have tobe complete, which leads to some restrictionson the set of empirical objects on system level.Before discussing the operations themselves,we shall speak of some properties ofoperations in general.

3.5.1 Extensive Structure

Above, we defined the extensive structurewhich consists of the axioms weak positivity,weak associativity, weak commutativity, weakmonotonicity and the Archimedian axiom. Forour considerations of object-oriented measureswe need a further axioms called idempotency.

Idempotency

Idempotency is defined as:

Definition 3.1: (Idempotency)A concatenation rule is called idempotency, iffor all objects a ∈ A holds:

a o a = a.®When ever a concatenation operation isidempotent, there is no way that theArchimedian axiom can be fulfilled. Theconsequence is that we have no extensivestructure. Hence, having idempotency, wecannot come to the ratio scale via aconcatenation operation. Some of theconcatenation operations discussed in thefollowing sections are in fact idempotent, sothat we have to consider other structures thanthe extensive structure. These new structuresare belief structures and the De Finettiaxioms.

3.5.2 Concatenation Operations ForMethods

Since many OO programming languages areimperative in their methods, it is possible toapply traditional intra-modular metrics onmethod level. More than ninety of suchmeasures based on flowgraphs wereinvestigated in /ZUSE91/ /ZUSE92/ togetherwith the sequential and alternativeconcatenation operations BSEQ and BALT.

These concatenation operations were alsoinvestigated in this Chapter. A minimal set ofsoftware measures for methods is discussed in/ZUSE91/.

3.5.3 Concatenation Operations on theClass Level

Chidamber et. al. introduce in /CHID91/ and/CHID94/ a concatenation operation forclasses. They use concatenation operations inorder to study the properties of their measures.However, the authors base their investigationnot on the basis of the extensive structure inorder to see whether the measures assume aratio scale. They consider the Weyuker/WEYU88/ properties. It should be mentionedhere, that the Weyuker are not compatible/ZUSE91/, Chapter 6.

We will use the concatenation operations ofChidamber et al. for our studies, too, and weconsider some additional concatenationoperations.

3.5.3.1 CUNI: Class Unification

The unification of two classes has no means ofexpression in OO models. As necessary forbeing an concatenation operation the result ofcombining two classes is one single new class.This new class combines all the properties thetwo single classes. If we concatenate ClassesA and B to a new class C, we denote this with

C=CUNI(A,B).

Doing this, we unify the sets of properties ofthe both Classes A and B to the set ofproperties of the new Class C. Properties of aclass are it's attributes (or instance variables)and methods. The sets of properties areunified, so identical methods or attributesoccur only once. Considering the Classes Aand B in Figure 3.4 we see, that both classeshave the variable a and method M1 incommon. The new Class C has these variableand method only once..

A B A©BCUNIM1M2

M1M3

ab

a ab

M1M2M3

=

Figure 3.4: Class unification.

We now consider the implications ofconcatenation operations on the inheritancerelation.

Inheritance Relationship

Within a class declaration we usually findinformation on (direct) superclasses. We don'tfind information on subclasses, as we canfreely define subclasses to existing classes. Wecan consider subclasses to some extent to be aform of a property of a class, as for examplefor polymorphism. Furthermore, somemeasures proposed in literature use subclassesto characterize a class. For this reason, weconsider the inheritance relation in bothdirections.

We require that the combined class inherits allthe properties which any of the two originalclasses inherited. So any superclass of either Aor B or both must be a superclass of theconcatenation operation CUNI(A,B). This canlead to multiple inheritance. Consistently, wedefine all the direct subclasses of A and B tobe direct subclasses of the unified class. Toillustrate this definition, we consider somecases including those discussed in /CHID94/.The first case discussed by Chidamber et. al.assumes two Classes A and B having the samedirect superclass (father) V. The resultingclass has the same father V. The directsubclasses (children) of A and B respectivelyalso are children of the unified class. Figure3.5 illustrates this case.

V V

C D E FC D E F

A BM1M2

M1M3

M1M2M3

CUNI

A©B

Figure 3.5: Unification CUNI (A,B) of siblingclasses.

If Class B is a direct subclass of class A, thesewill be combined as follows. The father V ofA also was an indirect superclass of B and isnow the father of CUNI(A,B). The childrenare again all children of A and B, in this casethe children of B do not inherit moreproperties as they inherited already theproperties of A via B (See Figure 3.6).

C D E

M1M2M3

V

D E

CUNIA©BA

M1

M2

C

V

BM4

M3

M4

Figure 3.6: Unification CUNI(A,B) with adirect subclass

Classes that have separate fathers have to becombined as shown in figure Figure 3.7. Thecombined class inherits from both superclassesvia multiple inheritance. The children areagain all the children of A and B, here Cmultiply inherits from A and B, of course it isonly once a child of CUNI(A,B).

V W

A

WV

C DC

CUNI(A,B)B

D

CUNI (A,B)

M1M2

M1M3

M1

M2M3

Figure 3.7: Unification CUNI(A,B) ofunrelated classes.

We now consider the implications of CUNI foruses relations. The behavior is very similar asdescribed above for inheritance. All theclasses used by either one ore both of theclasses combined will be used by the unifiedclass. This lies already in the unification of theproperties defined in the class. Analogously,we define all classes that used any single orboth separate classes to use the combinedclass. This won't cause problems as thoseclasses need not use the additional parts of thenew class but the original parts of that classalready used. The figures below illustrate thiscase with two examples.

V V

AM1

M2

C

M3

M4

D

B

C D

M1M2M3M4

A©BCUNI

Figure 3.8: Concatenation operationCUNI(A,B) with uses relationships.

C D

M1M2M3M4

V V

AM1

M2

CM3

M4

D

B

WW

A©B

CUNI

Figure 3.9: CUNI with uses relationships

We now consider the properties of theconcatenation operation CUNI.

Properties of CUNI

Since the unification of the sets of attributesand the sets of methods are independent of theordering in which these sets are unified, andno order is defined neither for the uses norinheritance relation, CUNI is commutativeand it is also associative. Interesting is, thatCUNI is also idempotent: if A is a class itholds:

A o A = A

Assuming idempotency by a concatenationoperation has the consequence, that the ameasure does not assume an extensivestructure which has the consequence that wecannot come to the ratio scale via theextensive structure.

Of course, this property of CUNI is not by anaccident. CUNI has been defined as aunification and we know that unification ofsets is idempotent. This reflects an advantageof object-oriented design. Similar classesshould be combined to one class with theconsequence of less maintenance effort.

Chidamber et. al. check, whether theirmeasures agree with the Weyuker properties.If we keep in mind, that CUNI is idempotent,it is not surprising that none of their sixmeasures agree with wholeness, which isdefined as:

u(A o B) ≥ u(A) + u(B),

for all A, B ∈ A. If idempotency is fulfilled,we cannot have wholeness, as Weyukerrequires that. Wholeness requires an non-additive ratio scale. In fact, if A=B, we obtainfor any Measure µ

u(CUNI(A,A) = u(A).

As we mentioned above, this is due to CUNI isa kind of an unification. Our suggestion is toadd a second combination operation thatcorresponds to intersection of sets.

3.5.3.2 CINT: Class Intersection

We have seen, that the unification of classesleads to a class which includes all theproperties, methods and attributes which arecommon for the both single classes.

The result of an intersection of two classes isthat the common properties of both classes arereduced to one property in the combined class.We illustrate this with the following picture.Assume two Classes A and B with variablesand methods. The new Class C, combined byClasses A and B only consists of the variable aand method M1.

A B A@BCINTM 1M2

M1M3

ab

a ab

M1=B

Figure 3.10: CINT: Intersection of classes.

As for CUNI, we now consider theimplications of CINT for the inheritancerelationship. It is important to say that CINTis not a combination rule to build new standalone classes. We are discussing theconsequences for a concatenation operationwhich is defined as CINT. Later we willdiscuss generalization, then we will see anapplication of CINT in reality.

CINT intersects the sets of properties ofclasses. We now require that the intersectedclass inherits all the properties that bothclasses inherited. These properties are againcommon to both classes. And we require thatevery subclass that are common to both classeswill be subclasses of the intersection.

That leads to somewhat non-intuitivesituations as shown in Figure 3.11. Here, G isan indirect superclass of A and B and so theintersected class CINT (A,B) will inherit fromG but neither from V nor W. And the onlycommon subclass is E, which becomes a childof the intersection.

E

M1

W

B

D

M3

G

M1

V

A

C

M2

M1

G

A@B

E

CINT

Figure 3.11: Class intersection andinheritance relationships.

Again, for the uses relation our considerationare very similar. Only those classes which useboth classes use the intersection and as animplication of the intersection of properties.Only those classes used by both classes will beused by CINT(A,B). Unlike inheritanceindirect use does not propagate along thevertices of the uses relation.

C D

A

E

BCINT

V W X

D

A@B

W

Figure 3.12: Class intersection and usesrelationships.

We now have two combination operationsCUNI and CINT among classes and we find acouple of measures including some of themeasures proposed by Chidamber et. al.holding the following condition

C-NOM(CUNI (A,B)) = C-NOM(A) + C-NOM(B) - C-NOM(CINT(A,B)),

where C-NOM is the number of methods in aclass. This equation is well known inprobability theory, describing a probabilistic

measure (Third Kolmogoroff axiom, seebelow).

3.5.4 The Empty Class

We now define the empty Class ∅ to be aclass with no properties, i. e. empty sets ofattributes and methods. Furthermore, theempty class may not inherit any property andno class inherits from ∅ . It is also not usedby any class and of course does not use anyclass.

Having defined an empty class we can say thattwo classes A and B are disjunct, i. e. theydon't have any property in common. It holds

CINT(A,B) = ∅

Another axiom for measures is the following:

u( ∅ )=0,

which again corresponds to probability. Thecorrespondence shall not lead to theassumption that software measures would inany way be measures of uncertainty in OO. Infact, one of the major properties of probabilityfunctions, the limitation to the Interval [0,1] isnot adhered by the measures in general and isnot our intention, too.

But the observation that measures incombination with the two operations describedhere (partly) are similar to probabilitymeasures, is useful.

With this support, we can derive additionalproperties of the preference relations inducedby the measures. These conclusions can bedrawn, because probability theory hasexamined the relations between qualitativeand quantitative probability. If these axiomaticsystems are considered carefully under thecircumstances of OO measurement, it comesup that these axioms can be adapted to theunlimited case.

3.6 Belief Structures

As we have shown above, measures which areadditive, assume an extensive structure. Theyalso can be used as an additive ratio scale.Measures which are not additive, can assumean extensive structure, too. Such measures area strong monotonic function of the additivemeasures. Non-additive measures, whichassume an extensive structure, can be used -under certain conditions- as a non-additiveratio scale. It should be mentioned here thatmeasures can assume an extensive structure

but cannot be used as a ratio scale. This is thecase if the combination rule is not meaningfulfor the admissible transformation of the ratioscale. The Measure MCC-V = |E| - |N| + 2 issuch a case.

In the object-oriented environment thebehavior of measures related to concatenationoperations is different. Many measures do notassume an extensive structure which has theconsequence that they cannot be used as an(additive) ratio scale. Other measures assumeidempotency, which implies, that they do notassume the Archimedian axiom, whichimplies no extensive structure, either.

Weak Positivity

ArchimedianAxiom

WeakCommutativity

WeakAssociativity

WeakMonotonicity

Extensive Structure

Figure 3.13: No Extensive Structure for themost object-oriented measures.

In order to discuss measurement structures inthe object-oriented area above the ordinalscale level, we consider qualitative andquantitative probabilities and belief structuresor belief functions.

3.6.1 Belief Functions

There exist a well known quantitativeapproach, the theory of belief functions, whichhas generated considerable interest in recentyears /SHAF76/, /SHAF87/. In this theory,belief may be interpreted as a generalization ofprobability. Also belief functions provide auseful and effective tool for the quantificationof subjective, personal judgments. It is theview of many researchers that humansfrequently reason in qualitative ratherquantitative terms /BHAT86/. A function ofbelief describes the belief in a hypothesis andthe belief in combination of hypotheses. Moreinformation’s about belief functions can befound in /SHAF76/, /BUER87/ and /WONG91

Firstly, we consider the Kolmogoroff axiomsand then as a generalization, the function ofbelief.

3.6.1.1 Kolmogoroff Axioms

It is important to mention that we treat theKolmogoroff axioms as (part) of arepresentation theorem. Put in another way,we shall attempt to treat the assignment ofprobabilities to events as a measurementproblem of the same fundamental character asthe measurement of, e.g. mass or length.

Typically, probabilities are considered in aninterval [0,1]. The approach of Kolmogoroffdescribes events as subsets in a probabilityspace /KRAN71/, p.200.

Definition 3.2: (Kolmogoroff Axioms (1933))Suppose that X is a non-empty set, that ℑ isan algebra of sets on , and that P is a functionfrom ℑ into the real numbers. The triple <X,ℑ , P> is a (finitely additive) probability spaceiff, for every A, B ∈ ℑ :

P(A) ≥ 0 (K2)P(X) = 1 (K2)If A ∩ B = Ø, => P (A ∪ B) = P(A) + P(B) (K3)

®Krantz et al. writes: Our plan, instead, is totreat Definition 3.2 as (part of) arepresentation theorem; specifically, weinquire into conditions under which anordering •≥ of ℑ has an order-preservingfunction P that satisfies Definition 3.2.Obviously, the ordering is to be interpretedempirically as meaning „qualitatively at leastas probable as“. Put another way, we shallattempt to treat the assignment ofprobabilities to events as a measurementproblem of the same fundamental character asthe measurement, e.g., mass or momentum.From this point of view, the debates about themeaning of probability are, in reality, aboutacceptable empirical methods to determine•≥. It is not evident why the measurement ofprobability should have been the focus ofmore philosophic controversy than themeasurement of mass, or length, or of anyother scientific significant attribute; but it hasbeen. We are not suggesting that thecontroversies over probability have beenjustified, but merely that other controversialissues in the theory of measurement may havebeen neglected to a degree.

On page 201, we find the followingstatements: Ellis point out that thedevelopment of a probability ordering is ..analogous to that of finding a thermometricproperty, which .. was the first step towardsdevising a temperature scale.The comparison between probability andtemperature may be illuminating in other

ways. The first thermometers were usefulmainly for comparing atmospherictemperatures. The air thermometers of theseventeenth century, for example, were notacceptable for comparing or measuring thetemperatures of small solid objects.Consequently, the early history ofthermometry, there were many things whichpossessed temperature which could not befitted into an objective temperature order.Similarly, then, we should not necessarilyexpect to find any single objective procedurecapable of ordering all propositions in respectof probability, even if we assume that allpropositions possesses probability. Rather, weshould expect here to be certain kinds ofpropositions that are much easier to fit into anobjective probability order than others.

We will see that certain measures have asimilar behavior related to concatenationoperations as probabilities. It is important tosay that objects of software are not probabilityevents. We consider the definition above inthe context of mathematically axioms and as arepresentation theorem. We consider theassignment of probabilities to events as ameasurement problem. The relationships donot base on probability events.

In the following, we give a generalization ofquantitative functions of probabilities, and thatis the function of belief and their relationshipto a qualitative belief. Then, these structure ofbelief will be modified, that we can apply thisaxiom system to object-oriented softwaremeasures.

3.6.2 Belief Functions of Dempster andShafer

The functions of belief by Dempster andShafer /SHAF76/ are a tool for the descriptionof uncertain knowledge. An detaileddiscussion of functions of belief can be foundin /BUER87/. The axiomatic of a function ofbelief is manly different in the third axiom ofthe Kolmogoroff axioms (KB3).

We now consider the function of belief.

Definition 3.3: (Function of Belief):Suppose X is a finite set, then a belief functionBel is a mapping from: 2X to the interval[0,1]. Then a function Bel: 2X -> [0,1]. is afunction of belief iff the following axiomshold:

Bel(∅ ) = 0 (B1)Bel(X) = 1 (B2)

Bel(A1 ∪ A2 ∪ .. ∪ An) ≥

I n≠ ⟨ ⟩∑0 1, ..

(-1)|I|+1 Bel Aii IεI (B3)

For two elements A, B ∈ 2X means B3:

Bel (A ∪ B) ≥ Bel(A) + Bel(B) - Bel (A ∩ B). (B4)®

Instead of the sign = with the Kolmogoroffaxioms we find here a greater or equal. Thebelief in the unification of two disjunct eventsA ∩ B = 0 can be greater than the sum ofbelief of the single results. Important for us isthe part: - Bel (A ∩ B), which shows usexactly the behavior of object-orientedsoftware measures.

The question is here what are theconsequences if we want to use such an object-oriented measure to predict costs ofmaintenance. The effort for maintenancewould be the sum of the maintenance of bothcomponents minus the effort of maintenancewhich is common in both components. Weshould mention here that the Function-PointMethod shows the same behavior. The reasonis that combining two projects to one project,we use, for example, input files only once.

3.6.3 Qualitative Belief

As we saw with the discussion of relationalsystems in measurement theory, we consideredan empirical and a numerical relationalsystem. Both were connected by ahomomorphism. The empirical relationalsystem describes qualitative conditions.Similar, we can formulate a qualitativebelief. We believe to an event A ∈ 2X not lessthan to an event B ∈ 2X, if

A •≥ B.

Let us consider the relation •≥ more in detail.Wong et al. /WONG91/, (See also: /BUER87/,p.38ff) showed the following theorem: There•> is defined as:

A •> B <=> A •≥ B ∧ ¬ (B •≥ A).

Theorem 3-1:Let X be a set, •≥ a preference relation on 2x.It exists a function of belief, whichcorresponds completely with •≥ , that means

A •≥ B <=> Bel(a) ≥ Bel(B),

if the following axioms are satisfied

∀ A, B ∈ 2X : A •≥ B ∨ B •≥ A, completeness (QB1)

∀ A, B, C ∈ 2X : A •≥ B ∧ B •≥ C => A •≥ C,transitivity (QB2)

∀ A, B ∈ 2X: A ⊇ B => A •≥ B, dominance (QB3)

∀ ( A ⊃ B, A ï C = 0): (A •> B => A ∪ C •> B ∪ C)partial monotonicity (QB4)

X •> 0 prevent triviality (QB5)®

It holds:

• Axiom QB1 is completeness, and• Axiom QB2 is transitivity. Both

required by a weak order.• Axiom QB3 is the dominance axiom,• Axiom QB4 is the partial monotonic

axiom, and• Axiom QB5 avoids triviality.

We illustrate this with some pictures.

3.6.3.1 Set of all Attributes and Methods

In order to illustrate the new axiom system,we introduce the sets of methods andattributes.

set of allattributes

and methods

x

a

f

h

c

M9

M6M7

M5

M1

finite subsets

……

set of classes

……

Caf

M5M9

Dcf

M5M6

Rhx

M1M7

ΓΓX

Set of all Attributes and Methods

Figure 3.14: Explanation of the sets X andthe set of classes.

The picture above shows the used sets for ourinvestigation. The left cloud shows the set ofall attributes and methods. The right cloudshows the set of classes, which structure theattributes and methods. The next pictureshows the axiom of partial monotonicity(QB4).

3.6.3.2 Axiom of Partial Monotonicty ofQualitative Belief

AM1M2M3

abc

M2M3

Bbc

A M1M2M3

B

abc

•>

A ⊃ B, A ∩ C = ∅ ⇒ (A •> B ⇒ A ∪ C •> B ∪ C)

M4M5

Cde

A ∪ C

M1M2M3

abc

M4M5

de

M2M3

bcde

M4M5

B ∪ C•>

Axiom of Partial Monotony of the Qualitative Belief

Figure 3.15: Partial monotonictiy QB4.

Assume we have a Class A consisting ofattributes and methods. Class consists of theattributes a, b, c and the methods M1, M2, andM3. Class B consists of the attributes b, c andthe methods M1 and M2. It follows that ClassB is a real subset of A. We write this as A ⊃B.

Furthermore, we have a third Class C,consisting of the attributes d, e, and themethods M4 and M5. We see, that Class Cdoes not have any attributes or methodscommon with Class A. The intersection of theboth Classes A and C is the empty set. Wewrite this as A ï C = Ø.

We now assume that we have an empiricalrelation •≥. We denote this relation as equallyor more difficult to maintain. Assuming A •≥B, what means Class A is equally or moredifficult to maintain than B, it follows that A∪ C is also equally or more difficult tomaintain than B ∪ C. We write this as A •≥ B=> A ∪ C •≥ B ∪ C. The Classes in Rows 2and 3 show this behavior. If a user has thisview of maintenance of classes then he has tolook for a Measure u which fulfills his view.We can write this as:

A •≥ B => A ∪ C •≥ B ∪ C <=>u(A) •≥ u(B) => u(A ∪ C) •≥ u(B ∪ C).

We call this a homomorphism related to theaxiom of partial monotonicty. It is importantto mention that the condition above only holdsin the direction of =>. The next pictureillustrates the dominance axiom QB3.

3.6.3.3 Dominance Axiom

A

M1

M2

M3

a

b

c

M2

M3

Bb

c

AM1

M2

M3B

a

b

c

•>

A ⊇ B => A •≥ B,

Dominance Axiom of Qualitative Belief

Figure 3.16: Dominance axiom.

The dominance axiom shows the following:Assume Class B is a subset of Class A. Then itfollows that Class A is equally or moredifficult to maintain than Class B. We writethis as: A ⊇ B => A •≥ B. This is anotherimportant criterion for an object-orientedsoftware measure. We now define theDeFinetti axioms.

3.6.4 DeFinetti Axioms

The DeFinetti axioms /ROBE79/, /BUER87/,/DEFI37/, /FETC95/, give necessary, but notsufficient conditions for the existence of arelation of belief. If these axioms are fulfilled,then a function of belief exists, whichcorresponds with the relation •≥ . It holds:

∀ A, B ∈ 2X : A •≥ B ∨ B •≥ A,completeness (F1)

∀ A, B, C ∈ 2X : A •≥ B ∧ B •≥ C => A •≥ C,transitivity (F2)

∀ A ∈ 2 X : A •≥ 0 (F3)

∀ ( A ï C = B ï C = 0): (A •> B <=> A ∪ C•> B ∪ C), monotonicity (F4)

X •> 0 prevents triviality (F5)®

Here, we see that the De Finetti axiom ofmonotonicity (F4) is stronger than partialmonotonicity (QB4) of the qualitative belief.We illustrate this with a picture.

•>

A ∩ C = B ∩ C = ∅ ⇒ (A •> B ⇔ A ∪ C •> B ∪ C)

AM1

M2

M3

ab

AM1

M2

M3

ab

BM4

M5

ac C

M6de

BM4

M5

ac

•>A ∪ C

M1

M2

M3

ab

M6

de

B ∪ C

M4

M5

acde

M6

Axiom of Monotonicity of DeFinetti

Figure 3.17: Axiom of Monotonicity of theDeFinetti axioms.

The axiom of partial monotonicity ofDeFinetti is stronger than the axiom of partialmonotonicity as discussed above. Assume, wehave three Classes A, B and C with attributesand methods. We also assume it holds that theClasses A and C, and B and C do not havecommon attributes and methods. We write thisas: A ï C = Ø, and B ï C=Ø. Both togetherwe write as: A ï C = B ï C=Ø.

We assume that Class A is equally or moredifficult to maintain than B (A •≥ B). If holdsA •≥ B then we expect that also holds: A ∪ C•≥ B ∪ C. We write the complete axiom as:

A •≥ B <=> A ∪ C •≥ B ∪ C.

This axiom holds for both directions. It isillustrated in the picture above in Rows 2 and3. We now apply the axiom systems above tothe object-oriented area.

3.7 Belief Function and De Finetti Axiomsin the Object-Oriented Environment

It should be made clear again, that softwaremeasures in the object-oriented area are notprobability measures. We do not interpret themeasurement values as probabilities and we donot limit the measurement values to [0, 1].Nevertheless, we believe, that it makes senseto describe the properties of some softwaremeasures with the structures, as presentedabove. Many measures in the object-orientedarea fulfill, with the exception of Bel(X)=1,the axioms of belief structures.

We now modify the axioms that we can applythem to object-oriented software measures.Doing this, we get, without using theextensive structure, statements of empiricalrelations, which are more than the properties

of the ordinal scale. The axioms of themodified function of belief u are the following:

Definition 3.4: (Modified Function of Belief)Let X be a countable set and ℑ the set of finitesubsets of X. A Measure u: ℑ -> ℜ is amodified function of belief iff

u(0) = 0 (MFB1)

∀ A ∈ ℑ : u(A) ≥ 0 (MFB2)

u(A1 ∪ A2 ∪ .. ∪ An) ≥

I n≠ ⟨ ⟩∑0 1, ..

(-1)|I|+1 u ( )Aii I∈I

(MFB3)

®

In the object-oriented environment the set Xrepresents the set of properties of classes. Aclass is then a finite subset of these properties.That means, the classes are elements of ℑ . Wenow modify the axioms for qualitative belief,too.

Definition 3.5: (Modified Relation ofBelief):Let •≥ a relation on ℑ , then •≥ is a modifiedrelation of belief iff,

∀ A, B ∈ ℑ : A •≥ B or B •≥ A (MRB1)

∀ A, B, C ∈ ℑ : A •≥ B and B •≥ C => A •≥ C, (MRB2)

∀ A ⊇ B => A •≥ B, dominance axiom (MRB3).

∀ (A ⊃ B, A |ï C = 0) => (A •> B => A ∪ C •> B ∪ C),partial monotonicity (MRB4),

∀ A ∈ ℑ : A •≥ 0 , Positivity (MRB5).

®

We can take over Theorem 3.1 for themodified structures of belief.

Theorem 3-2:It exist a modified function of believe, whichfulfills (1), (2), (3) of the modified function ofbelief (MFB1, MFB2, MFB3), such that

A •≥ B <=> u(A) ≥ u(B),

if •≥ fulfills the axioms of the modifiedrelation of belief (MRB1, MRB2, MRB3,MRB4, MRB5).®

We take over the proof from Wong et al./WONG91/. The modification has theconsequence that we have a no-upper

boundary of u. The normalization to theInterval [0,1] is the last step in the proof.Since X is countable infinite, it does not exista measurement value for X. We only considerfinite subsets of X, this holds for u and for •≥ .For this reason the complement Ac = X \ A ofan object is no element of Γ. For this reasonwe can not consider here a plausibilityfunction, which are additions for the functionof belief. The proof in /WONG91 does not usethe complement set.

Proof of the TheoremIn order to do not overload the paper, we referto the proof of the theorem to Fetcke/FETC95/.

3.8 Investigations of some Object-OrientedMeasures

We now apply the discussed concepts above tosome measures in the object-orientedenvironment. We describe them with theaxioms of the modified function of belief. Weconsider whether a measure fulfills the axiomsMFB1-MFB3. In the most cases the measuresfulfill the stronger condition

u(A ∪ B) = u(A) + u(B) - u(A ∩ B),

which is a sufficient condition for MFB3. Weillustrate the statement above with thefollowing picture.

Aa M1

M2

A Ba a

bM1M2

M1M3

A Ba a

bM1M2

M1M3

Ba M1

Bab

M1M3

Bab

M1M3

Unification and Intersection of Classes

M2

=

=

Unification

Intersection

Figure 3.18: Unification and Intersection ofClasses A and B.

The unification of Class A ∪ B and theintersection of Classes A ï B are shown in thepicture above. The discussed conditions aboveare implied by this condition. The conditionabove says that a measure which follows thecondition above is only additive if no commonattributes and methods are existing. That ismostly not the case in the object-orientedenvironment.

On the class level we investigate the measuresin the table below. We investigate whether themeasures fulfill the axioms of the modified

function of belief. If this is not the case, theaxioms of the modified relation of belief areinvestigated:

MRB1: Is always fulfilled by the properties of the real numbers

MRB2: Is always fulfilled by the properties of the real numbers

MRB3 is the Dominance Axiom,

MRB4 is the partial monotonicity axiom,

MRB5 is the Positivity axiom.

Following Theorem 3.2 a modified function ofbelief fulfills the axioms MRB1-MRB5.

Measure CBO

We consider the following example of theMeasure CBO. IT is defined as:

C-CBO is the number of classes that arecoupled with the Class C. Two classes arecoupled to each other if methods of one classmethods or instance variables of other classesuse. We illustrate this with an example.

In the picture below Class A is coupled withthe four Classes V, W, C, and D. It holds C-CBO(A) = 4.

V W

A

C D

Figure 3.19: Class A is coupled with fourother classes. Class A is used by the Classes Vand W and Class A uses itself the Classes Cand D. It holds CBO(A) = 4.

The behavior of this measure can be describedwith the class intersection. The modifiedaxioms of the function of belief are fulfilled, itholds for the Classes A and B.

CBO (Ø) = 0

For all A: CBO (A) ≥ 0

CBO (CUNI(A, B)) = CBO (A) + CBO (B) -CBO (CINT(A , B))

For the third axiom we need a furtherexample.

V W X

A B

C D E

Figure 3.20: CBO related to theconcatenation operations CUNI and CINT.

V W X

CUNI(A,B)

C D E

Figure 3.21: CBO related to theconcatenation operations CUNI and CINT.

W

CINT(A,B)

D

Figure 5.5: CBO related to the concatenationoperations CUNI and CINT.

It holds:

CBO (A) = 4CBO (B) = 4CBO (CINT(A,B)) = 2CBO (CUNI(A,B)) = 4 + 4 - 2 = 6.

In /FETC95/ more examples are presented.We now show an overview of the properties ofthe Measures of Chidamber et al.

4 Results

We now present the results of ourinvestigation. The Measure CBO is Couplingbetween Objects, LOC is the Measure lines-of-code for methods, NOC is the Number OfChildren, WMC is the Weighted MethodCount, Response For a Class, and LCOMa and

LCOMb are the Measures Lack of Cohesion ofMethods /CHID91/, CHID92/.

Measure G MRB3 MRB4 MRB5-------------------------------------------------------------------CBO Y Y Y YLOC Y Y Y YNOC Y Y Y YWMC Y Y Y YRFC Y Y Y YLCOMa N Y N YLCOMb N N N Y

Figure 4.22: The table shows the properties ofsome object-oriented measures related to theproperties of the modified Function of Belief(G) and the modified relations of belief(MRB3), (MRB4), and (MRB5).

The table of object-oriented measures aboveshows very clearly, that most of the measuresdo not assume an extensive structure. Anexception is the Measure LOC. However,considering the modified function of beliefand the relations of belief, we can characterizethe measures above the level of the ordinalscale. To characterize measures above theordinal scale level is very important becausewe can do not very much with ordinalnumbers. It means especially here, that wehave more sophisticated properties of object-oriented measures.

Other results of our investigation are thefollowing:

1. In order to get qualitative criteria for theuse of object-oriented measures, weintroduced qualitative conditions derivedfrom the function of belief.

2. In the area of object-oriented measures we

can define many concatenation operations,like CUNI and CINT. Concatenationoperations are useful to get moreinformation of the meaning of the numbersof measures above the ordinal scale level.

3. We demonstrated that object-oriented

measures mostly do not assume anextensive structure which blocks the way tothe ratio scale via the extensive structure.The reason is idempotency, which impliesthat the Archimedian axiom is notfulfilled.

4. We showed the consequences for object-

oriented techniques if the investigatedmeasures assume intersection andunification properties.

5. Considering the modified function of belief

and the qualitative relation of belief, we

can characterize the measures above thelevel of the ordinal scale. The partialmonotonicity axiom, the dominanceaxiom, and the axioms of DeFinetti areappropriate to give a qualitativecharacterization of object-oriented softwaremeasures.

5 Conclusion

Mostly, object-oriented measures do notassume an extensive structure. We showed,that in the area of object-oriented measures wecan find properties of idempotency in thecontext of the binary operations unificationand intersection of sets. The function of belief,qualitative belief, and the De Finetti axiomsare appropriate to give a qualitativecharacterization of object-oriented softwaremeasures above the ordinal scale level. Thispaper should be seen as a first step to analyzeobject-oriented measures by new measurementstructures.

6 Attachment: Foundations of Software Measurement

In this attachment we introduce basic conceptsof measurement theory and show theapplication to software measures. We use thetext of Krantz et al. /KRAN71/, Luce et al./LUCE90/ and Roberts /ROBE79/. Proofs ofthe theorems and a more detailed discussion ofmeasurement theory related to softwaremeasures can be found in /ZUSE91/,/ZUSE92/, /ZUSE92b/, /ZUSE94c/, and/BOLL93/. An application of measurementtheory to more than ninety intra-modularsoftware complexity measures can also befound in /ZUSE91/.

It should be mentioned here that it is a widelyspread misunderstanding that measurementtheory is only useful to determine the scaleslike nominal, ordinal, interval and ratio scale.This is more a side-effect of measurementtheory. The major advantage of measurementtheory lies in hypotheses about reality.

6.1 Basic Concepts of MeasurementTheory

First of all we want to introduce the notationof an empirical, a numerical relational systemand a scale. Let

A = (A, •≥≥, o)

be an empirical relational system, where A isa non-empty set of empirical objects, •> is anempirical relations on A and o a binaryoperation on A (Of course, there are morethan one relation and binary operationpossible).

According to Luce et al. /LUCE90/, p.270, weassume for an empirical relational system Athat there is a well-established empiricalinterpretation for the elements of A and foreach relation Si of A. We also assume thesame for the binary operations.

Let further

B = (ℜ , ≥≥, +)

be a formal relational system, where ℜ , arethe real numbers, ≥≥, a relation on B, and + aclosed binary operation on ℜ . (Of course,there are more than one relation and binaryoperations possible). We also include the casethat there are no relations or no operations.

The sign + means here the following: for aconcatenation of two Flowgraphs P1 o P2holds the following formula:

u(P1 o P2) = u(P1) + u(P2) ,

where u is a software measure and P1, P2ε P

A measure is a mapping u: A -> B such thatthe following holds for all P1, P2 ε A:

P1 •≥≥ P2 <=> u(P1) ≥≥ u(P2)and

u(a o b) = u(a) + u(b)

Then the Triple (A, B, u) is called a scale.According to this definition we see thatmeasurement assumes a homomorphism.

Given two relational system A and B we canask whether there exists a measure such that(A, B, u) is a scale. This problem is called therepresentation problem. If such a measureexists we can ask how uniquely the measure isdefined. This problem is called theuniqueness problem. The uniquenessproblem leads to the definition of scale typessuch as ordinal or ratio scale.

Let g: X ->Y and h: Y -> Z be mappings.Then hg denotes the composed mappinghg(x)=h(g(x)) for x ε X.

Definition 6.1: (AdmissibleTransformation):

Let (A, B, u ) be a scale. A mapping g: A -> Bis an admissible transformation iff (A, B, g )is also a scale.

Real scales are classified according to theadmissible transformations.

Name of the Scale Transformation g

Nominal Scale Any one to one gOrdinal Scale g: Strictly increasing

functionInterval Scale g(x) = a x + b, a > 0Ratio Scale g(x) = a x, a > 0Absolute Scale g(x) = x

Figure 6.1: Scale types of real scales. It is ahierarchy of scale types. The lowest one is thenominal scale and the highest one is theabsolute scale.

Meaningfulness

However, the major question for the user is:how does he know what scale type is assumedand what are the conditions for the use of ameasure on a certain scale level. Orequivalently, how does a measure and realitylook like which creates numbers which can betransformed by a certain admissibletransformation of scales.

Admissible transformations also lead to thedefinitions of meaningful statements/ROBE79/, p.58. A statement withmeasurement values is meaningful iff its truthor falsity value is invariant to admissibletransformations. Meaningfulness guaranteesthat the truth value of statements withmeasurement values is invariant to scaletransformations. For example if we say thatthe distance D1 is twice as long as distanceD2, then this statement is true or false nomatter whether length is measured in metersor yards. These problems are existing in thearea of software measures too. This is the caseif we want to make statements withmeasurement values for example after havingapplied statistical methods. We want toexplain this problem by a statement which wasgiven by Pressman /PRES92/ (Relation >) andsimilarly by Weyuker /WEYU88/.

Example 6.1 (Wholeness)

Let P1 and P2 be program bodies combined insome way to P1 o P2. Let u be a softwarecomplexity measure. Then the requirement forsoftware complexity by Pressman is

u(P1 o P2) > u(P1) + u(P2).

This statement is not meaningful for aninterval scale. If we apply the admissibletransformation of the interval scale g(x)=ax+b, then we get:

a u(P1 o P2) + b > a u(P1) + b + a u(P2) + b,

for all a>0 and for all b ε ℜ . Hence, the truthor falsity of the statement is not invariant tothis type of admissible transformation. Hencethe statement is meaningful for a ratio scale.

We see that meaningfulness depends onadmissible transformations. The admissibletransformations depend on the relationalsystems under consideration. Hence it isimportant to study the conditions whichshould hold on the relational systems in orderto have a certain class of admissibletransformations or equivalently to have acertain scale type.

In Bollmann and Zuse /BOLL93/ and Zuse/ZUSE94a/ we showed that wholeness is apseudo property without any empiricalmeaning. We also showed that wholenessleads to non-additive ratio scales.

6.2 Ordinal and Ratio Scale

We now introduce the conditions for the use ofsoftware measures as an ordinal and a ratioscale. Firstly, we consider the conditions ofthe ordinal scale.

6.2.1 Ordinal Scale

In order to describe a measure as an ordinalscale we introduce the weak order which is abinary relation that is transitive and complete:

P •≥≥ P', P' •≥≥ P'' => P •≥≥ P'' transitivityP •≥≥ P' or P' •≥≥ P completeness(connectedness),for all P, P', P'' ε P, where P is the set offlowgraphs (•≥≥ is a binary empirical relation,like equal or more complex).

In /ROBE79/, p.110, we find the followingtheorem which we can be applied directly toflowgraphs.

Theorem 6.1:Suppose (P, •≥≥) is an empirical relationalsystem, where P is a non-empty countable setof flowgraphs and where •≥≥ is a binaryrelation on P. Then there exists a function u: P-> ℜ , with

P •≥≥ P' <=> u(P) ≥≥ u (P')

for all P, P' ε P, iff •≥≥ is a weak order. If sucha homomorphism exists, then

((P,•≥≥),(ℜ , ≥≥), u))

is an ordinal scale.

6.2.2 Ratio Scale

In order to come to the ratio scale therelational system (P, •≥≥) has to be extended to(P, •≥≥, o). We want to introduce the followingnotation for P, P'ε P: P ≈ P' iff P •≥ P', and P' •≥ P, P •> P' iff P •≥ P', and not P' •≥ P,where •≥ is the weak order and means equallyor more complex, •> means more complex,and ≈ means equally complex.

Theorem 6.2 /KRAN71/, p.74:Let P be a non empty set, •≥ is a binaryrelation on P, and o a closed binary operationon P. Then (P, •≥, o) is a closed extensivestructure iff there exists a real-valued functionon P such that for all a, b ε P

(1) a •≥≥ b <=> u(a) ≥≥ u (b)and

(2) u(a o b) = u (a) + u (b)

Another function u' satisfies (1) and (2) iffthere exists >0 such that

u'(a) = u(a).

The statement u' (a) = u(a) gives theadmissible transformation for an additive ratioscale. We see that Theorem 6.2 gives usconditions for the additive ratio scale.

In Zuse /ZUSE91/, p.57 an extensivestructure, as proposed by Bollmann /BOLL84/,is presented.

Definition 6.2: (Extensive Structure):Let P be a non-empty set, •≥≥ binary relationon P, and o a closed binary operation on P.The relational system (P, •≥≥, o ) is anextensive structure if and only if thefollowing axioms hold for all P1,.,P4 ε P.

A1': (P,•≥≥ ) is a weak order

A2': P1 o (P2 o P3 ) ≈ (P1 o P2 ) o P3,axiom of weak associativity

A3': P1 o P2 ≈ P2 o P1, axiom of weakcommutativity

A4': P1 •≥≥ P2 => P1 o P3 •≥≥ P2 o P3axiom of weak monotonicity

A5': If P1 •> P2 then for any P3,P4 thereexists a natural number n, such that nP1 o P3•> nP2 o P4, Archimedian Axiom®

The axioms of the extensive structure describeempirical conditions related to concatenationoperations of objects. The axiom of positivity:P o P’ •> P, is also an axiom of the extensivestructure.

6.3 Consequences of the ExtensiveStructure

We summarize the consequences of anextensive structure.

• An extensive structure is assumed by anadditive Measure u.

• An extensive structure is also assumed byevery Measure u’, that is a strictlymonotonic function f of an additiveMeasure u. It holds: u’ = f u.

• An additive Measure u leads to theadditive ratio scale.

• A Measure u’, which is not additive, canbe used as a non-additive ratio scale, if thecombination rule is meaningful for theratio scale.

• If the empirical conditions A1’-A5’ arefulfilled in reality, then the Theorem of theextensive structure says, that an additivemeasure exists.

• Because the condition of the extensivestructure are empirically, the extensivestructure gives an qualitative interpretationof a measure.

6.4 Measurement Theory and SoftwareMeasures

We now show very briefly how measurementtheory can be applied to software complexitymeasures. We will illustrate this with theMeasures of McCabe. We specialize thegeneral measurement theory approach forsoftware complexity. We consider theempirical relational system (P , •≥≥) for theordinal scale and (P , •≥≥, o) for the ratio scale,where P is the set of flowgraphs, •≥≥ the binaryrelation equal or more complex than, and o isa binary operation.

In measurement theory a concatenationoperation is defined as:

A x A -> A.

where A is the set of flowgraphs. As binaryoperations we consider here the sequentialcombination BSEQ for flowgraphs.

=>

P1 P1

P2 P2

Figure6.2: The binary operation BSEQ=P1 oP2 of two arbitrary flowgraphs P1 and P2, andthe sequential concatenation operation of astructured chart.

6.4.1 Application of Measurement Theoryto the Measure of McCabe

Firstly, we choose the Measures of McCabe/ZUSE91/, p.151, with

MCC-V=|E| - |N| + 2 , and

MCC-V2=|E| - |N| + 1

to demonstrate our method. McCabe derived asoftware complexity measure from graphtheory using the definition of the cyclomaticnumber. McCabe interpreted the cyclomaticnumber as the "minimum number of paths" inthe flowgraph. He argued that the minimumnumber of paths determines the complexity(Called by McCabe: cyclomatic complexity) ofthe program: The overall strategy will be tomeasure the complexity of a program bycomputing the number of linearly independentpaths v(G), control the "size" of programs bysetting an upper limit to v(G) (instead of usingjust physical size), and use the cyclomaticcomplexity as the basis for a testingmethodology.

The cyclomatic number is only a value of amathematical function. Considering the Triple(A, B, u) for a scale, only the part (B,) is used,but measurement considers always the Triple(A, B, u) which includes the empiricalrelational system A. However, interpreting thecyclomatic number as the complexity of aflowgraph gives this number an empiricalinterpretation. Having an empiricalinterpretation of the numbers (cyclomaticcomplexity) the use of measurement theory isjustified. We consider the empirical relationalsystem (P, •≥≥) for the ordinal scale and (P, •≥≥,o) for the ratio scale, where P is the set offlowgraphs, o is the sequential combinationBSEQ of flowgraphs as defined in Figure 6.1,

and MCC-V2: is the additive Measure MCC-V2=|E| - |N| + 1 of McCabe with

MCC-V2(P1 o P2) = MCC-V2(P1) + MCC-V2(P2).

This combination rule is meaningful for theadmissible transformation of a ratio scale.

6.4.1.1 The Measure of McCabe as anOrdinal Scale

The Measure MCC-V2 can be used as anordinal scale if the empirical ranking ordercorresponds with the ranking order of theMeasure of McCabe. The Measure MCC-V=|E|-|N|+2 of McCabe is a strictly monotonictransformation of the Measure MCC-V2. Astrictly monotonic function is the admissibletransformation of the ordinal scale, it does notchange the ranking order.

6.4.1.2 The Measures of McCabe as aRatio scale

In order to give the conditions for the use ofthe Measure MCC-V2 as a ratio scale we useTheorem 6.2. If o is the sequentialcombination BSEQ of flowgraphs, ifcomplexity is transitive and complete and ifthe Measure MCC-V2 is an ordinal scale then

(P, •≥≥, o)

is a closed extensive structure. In this case

((P, •≥≥, o), (ℜ , ≥≥, +), MCC-V2),

where MCC-V2=|E| - |N| + 1, is an additiveratio scale. The Measure MCC-V2 is a strictlymonotonic transformation of: MCC-V. Put inother words: the Measure MCC-V2=|E| - |N| +1can be used as a ratio scale because it isadditive related to the concatenation operationBSEQ.

6.4.1.3 The Measure of McCabe as anAbsolute Scale

There is a confusing situation in literatureabout the absolute scale. It is not true that theabsolute scale is described by counting. Wenow show the conditions for the use of theMeasure of McCabe as an absolute scale. Veryoften people say that the Measure of McCabemeasures the cyclomatic number and that is anabsolute scale. That is wrong, because we cantransform the cyclomatic number by anadmissible transformation. We can say that we

have twelve independent path, but we also cansay that we have one dozen independent paths.

In order to characterize the Measure ofMcCabe as an absolute scale, we have tointroduce an additional concatenationoperation BALT. Above, we introduced thesequential concatenation operation BSEQ,additionally we introduce the concatenationoperation BALT, which is defined as:

AAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAAA

AAAAAAAAAAAAAAAAAAAA

Concatenation Operations BSEQ and BALT

P1

P2

P1

P2

P1 P2=>

BSEQBALT

AAAAAAAAAAAAAAAA

AAAA

AAAAAAAAAAAA

AAA

Figure 6.3: Concatenation operations BSEQand BALT, where two Flowgraphs P1 and P2are combined to a new Flowgraph BSEQ = P1o P2 or BALT = P1 • P2, with P1, P2 ∈ P.

In order to come to the absolute scale weconsider the following empirical relationalsystem:

A = (P, •≥, o, •),

where P is the set of flowgraphs, •≥ anempirical relation, like equally or moredifficult to maintain, o is the sequentialconcatenation operation BSEQ and • theconcatenation operation BALT. We considerthe Measure MCC-V2 of McCabe which isdefined as:

MCC-V2 (P) = |E|- |N| + 1.

For the sequential concatenation operationBSEQ = P1 o P2 the combination rule is:

MCC-V2 (P1 o P2) =MCC-V2 (P1) + MCC-V2(P2).

It is easy to see that the Measure MCC-V2 isadditive related to the concatenation operationBSEQ. The combination rule for theconcatenation operation BALT = P1 • P2 is:

MCC-V2 (P1 • P2) =MCC-V2(P1) + MCC-V2 (P2) + 1.

We now consider whether both combinationrules are meaningful related to admissibletransformation the ratio scale. It is easy to seethat the combination rule for theconcatenation operation BSEQ is meaningful

related to the admissible transformation of theratio scale. We illustrate this here:

a MCC-V2 (P1 o P2) = a MCC-V2 (P1) + aMCC-V2(P2).

We transform each measurement value withthe admissible transformation of the ratioscale (a>0). It is easy to see that thecombination rule is invariant to the admissibletransformation of the ratio scale.

We now consider the combination rule for theconcatenation operation BALT and apply theadmissible transformation of the ratio scale.:

a MCC-V2 (P1 • P2) = a MCC-V2(P1) + aMCC-V2 (P2) + 1.

It is easy to see that the statement above is notinvariant to the admissible transformation ofthe ratio scale (a>0). The statement above isinvariant for a=1, and that is the admissibletransformation of the absolute scale.

This shows that the Measure MCC-V2 can beused as an absolute scale if we consider thefollowing empirical (A) and numerical (B)relational systems:

A = (P,.•≥, o, •), and B= (R, ≥, +, MCC-V2(P1) + a MCC-V2 (P2))

and the Measure MCC-V2 To use a measureas an absolute scale depends on the behaviorof the concatenation operations related to theadmissible transformations of the ratio scale.If one of the both combination rules are notinvariant to the admissible transformation ofthe ratio scale, then we have an absolute scale(without any proof).

6.5 Concatenation Rules and IndependenceConditions

Another important criteria for softwaremeasures are the independence conditionswhich are based on concatenation rules/ZUSE92/. Let us assume that ((A, •≥≥),(ℜ , ≥≥),u) is an ordinal scale. We want to discuss thequestion whether there exists a binaryoperation • such that

u(P1 o P2) = u(P1) • u(P2)

for all P1, P2 ε A. We denote • as acombination rule. The formula above isidentical with the formula

µ(P1 o P2) = f (µ(P1), µ(P2)).

The answer is given in the followingtheorems.

Theorem C1: There exists such a • iff P1≈ P2=> P1 o P ≈ P2 o P, and P1 ≈ P2 => P o P1 ≈P o P2, for all P1, P2, P ε P

Theorem C2:There exists such a • iff P1 ≈ P2 <=> P1 o P ≈P2 o P, and P1 ≈ P2 <=> P o P1 ≈ P o P2, forall P1, P2, P ε P

Theorem C3: There exists such a • iff P1 •≥P2 => P1 o P •≥ P2 o P, and P1 •≥ P2 => P oP1 •≥ P o P2, for all P1, P2, P ε P

Theorem C4: There exists such a • iff P1 •≥P2 <=> P1 o P •≥ P2 o P, and P1 •≥ P2 <=> Po P1 •≥ P o P2, for all P1, P2, P ε P

The condition C1-C4 are hierarchical ordered,that means C4 implies C3, C2, and C3, C2imply C1. The independence conditions arevery important in the context of prediction andvalidation of measures. For more informationsee /ZUSE92/, and /ZUSE94a/.

6.6 Non-Additive Ratio Scales

Above, it was shown that the extensivestructure leads to the additive ratio scale. Thequestion is whether non-additive ratio scalesare also possible. Remember, that wholenesswas defined as:

u(P1 o P2) > u(P1) + u(P2),

where P1, P2 ∈ P. We also showed that thestatement of wholeness is meaningful for theadmissible transformation of the ratio scale.The question is what type of Measure isassumed a non-additive combination rulewhich is meaningful for the non-additive ratioscale. Such a measure is of the type

u’ = ub,

with b>0. An additive Measure u has thefollowing combination rule:

u(P1 o P2) = u(P1) + u(P2),

where P1, P2 ∈ P. It also holds u = u’1/b. If weinsert this function in the additivecombination rule, we get:

u’(P1 o P2) = (u’(P1)1/b + u’(P2)1/b)b,

with b>0. This combination rule is meaningfulfor the ratio scale. Put in other words: AMeasure u’ = ub, where Measure u assumes anextensive structure and is additive, can be usedas a non-additive ratio scale. The basicCOCOMO-Model has such a combinationrule. Taking the Measure MCC-V2= |E| - |N| +1, which is additive related to theconcatenation operation BSEQ, the MeasureMCC-V2’ = MCC-V2b, with b>0, creates anon-additive ratio scale.

6.7 Validation and Prediction

If we have two ratio scales, one of the measureM and the other one of the external variableV, then the only one function which ispossible between two ratio scales is thefollowing formula:

V(P) = a Mb.

with a,b>0. This formula has to be validated ifwe want to use a measure, which assumes aratio scale, as a predictor for an externalvariable C, which can be also used as a ratioscale. The formula above is known as thebasic COCOMO-Model /BOEH81/. For moreinformation’s see Bollmann et al. /BOLL93/and Zuse /ZUSE94a/.

7 References

/BASI84/ Basili, V.; Perricone, Barry T.: Software Errorsand Complexity: An Empirical Investigation.Communications of the ACM, Volume 27, No. 1, January1984, pp. 42-52.

/BOLL93/ Bollmann-Sdorra, P.; Zuse, H.: PredictionModels and Software Complexity Measures from aMeasurement Theoretic View. Proceedings of the 3rdInternational Software Quality Conference, Lake Tahoe,Nevada, October 4-7, 1993.

/BOOC91/ Booch, G.: Object-Oriented Design withApplications. Benjamin/Cummings, 1991.

/BUER87/ Bürger, Hans-Christopf: AxiomatischeBeschreibung von Glaubensfunktionen. Diploma Thesis,TU-Berlin, Dezember 1987.

/CHID94/ Chidamber, Shyam, R.; Kemerer, Chris, F.:A Metrics Suite for Object Oriented Design. IEEETransactions on Software Engineering, Volume 20, No. 6,June 1994, pp. 476-493.

/CHUR95/ Churcher, Neville, I.; Shepperd, Martin, J.:Comments on "A Metrics Suite for Object Oriented Design".IEEE Transactions on Software Engineering, Vol. 21, No. 3,March 1995, pp. 1-3.

/FETC95/ Fetcke, Thomas: Software Metriken bei derObject-orientierten Programmierung. Diploma thesis,Gesellschaft für Mathematik und Datenverarbeitung(GMD), St. Augustin, and TU-Berlin, 1995.

/KRAN71/ Krantz, David H.; Luce, R. Duncan; Suppes;Patrick; Tversky, Amos: Foundations of Measurement -

Additive and Polynominal Representation, Academic Press,Volume 1, 1971

/LUCE90/ Luce, R. Duncan; Krantz, David H.; Suppes;Patrick; Tversky, Amos: Foundations of Measurement.Volume 3, Academic Press, 1990

/ROBE79/ Roberts, Fred S.: Measurement Theory withApplications to Decisionmaking, Utility, and the SocialSciences. Encyclopedia of Mathematics and its ApplicationsAddison Wesley Publishing Company, 1979.

/SHAF76/ Shafer, Glenn: A Mathematical Theory ofEvidence. Princeton University Press, 1976.

/SHAF87/ Shafer, Glenn: Belief Functions and PossibilityMeasures. In Analysis of Fuzzy Information, Volume 1,Mathematics and Logic, J.C. Bezdek, Ed. Boca Raton, FL,CRC Press, 1987, pp. 51-84.

/WEYU88/ Weyuker, Elaine J.: Evaluating SoftwareComplexity Measures. IEEE Transactions of SoftwareEngineering Volume 14, No. 9, Sept. 88.

/WONG91/ Wong, S., K., M.; Yao, Y., Y.; Bollmann-Sdorra, P.; Bürger, H.,C.: Axiomatization of QunatitativeBelief Structure. IEEE Transaction on Systems, Man andCybernatics, Volume 21, No. 4, July/August 1991.

/ZUSE89/ Zuse, Horst; Bollmann, P.: Using MeasurementTheory to Describe the Properties and Scales of StaticSoftware Complexity Metrics. SIGPLAN Notices, Volume24, No. 8, pp.23-33, August 89.

/ZUSE91/ Zuse, Horst: Software Complexity: Measuresand Methods. DeGruyter Publisher 1991, Berlin, New York,605 pages, 498 figures.

/ZUSE92/ Zuse, Horst; Bollmann-Sdorra, Peter:Measurement Theory and Software Measures. In:Workshops in Computing: T.Denvir, R.Herman andR.Whitty (Eds.): Proceedings of the BCS-FACS Workshopon Formal Aspects of Measurement, South Bank University,London, May 5, 1991. Series Edited by Professor C.J.Rijsbergen. ISBN 3-540-19788-5. Springer Verlag LondonLtd, Springer House, 8 Alexandra Road, Wimbledon,London SW19 7JZ, UK, 1992.

/ZUSE94a/ Zuse, Horst: Software ComplexityMetrics/Analysis. Marciniak, John, J. (Editor-in-Chief):Encyclopedia of Software Engineering, Volume I, JohnWiley & Sons, Inc. 1994, pp. 131-166.

/ZUSE94b/ Zuse, Horst: Software Measurement - AnOverview. Technical Paper, TU-Berlin, FR5-3, 1994.

/ZUSE94c/ Zuse, Horst: Foundations of the Validation ofObject-Oriented Software Measures. In: Theorie und Praxisder Softwaremessung (Dumke, R.; Zuse, H. (Editors),Deutsche Universitätsverlag DUV, Gabler - Vieweg -Westdeutscher Verlag, 1994, pp. 136-214.

About the Author:

Horst Zuse received his B.S. degree inelectrical engineering from the TechnischeUniversität of Berlin, Germany, in 1970, theDiploma degree in electrical engineering fromthe Technische Universität in 1973, and thePh.D. Degree in computer science from theTechnische Universität of Berlin in 1985.Since 1975 he is senior research scientist withthe Technische Universität Berlin. Hisresearch interests are information retrievalsystems, software engineering, softwaremetrics and the measurement of "complexity"

and "quality" of software during the softwarelife-cycle. From 1987 to 1988 he was for oneyear with IBM Thomas J. Watson Research inYorktown Heights. His research work therewas software metrics, too. In 1991 hepublished the book: Software Complexity -Measures and Methods (De GruyterPublisher). From 1989 till 1992 he was withthe ESPRIT II Project 2384 METKIT (Metric-Educational- Toolkit) of the EuropeanCommission. Since 1990 he gives severaltimes a year seminars about software metricsfor people of the industry within the scope ofDECollege and ORACLE. He also gave manypresentations and seminars about softwaremeasurement on conferences in US andCanada. Now, his research interests arevalidation of software metrics, evaluation ofcost estimation and prediction models,application of software metrics in the wholesoftware life-cycle and standardization ofsoftware measures. From August 1, 1994 toDecember 31, 1994 he is invited as aresearcher by the Gesellschaft für Mathematikund Datenverarbeitung (GMD) in St.Augustin in Germany.