Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Quantitative approaches in object-oriented software engineering
Nội dung xem thử
Mô tả chi tiết
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
Back Cover
Measures of software internal attributes have been extensively used to help software managers, customers and
users to characterize, assess and improve the quality of software products. The introduction of object-oriented (OO)
software provides powerful design mechanisms with which to do this, and new technologies—e.g., OO frameworks,
OO analysis/design patterns, OO architectures and OO components—that take advantage of these design
mechanisms have been proposed in order to improve software engineering productivity and software quality. To
better understand the impact of these technologies on products developed using them, the quality of these products
must be assessed using software product measures.
This book gives a comprehensive description of four areas of quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics validation and process management.
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
Quantitative Approaches in Object-Oriented Software
Engineering
Fernando Brito e Abreu
Geert Poels
Houari A. Sahraoui
Horst Zuse
HPS
HERMES PENTON SCIENCE
First published in 2001 by Hermes Science Publications, Paris
First published in 2002 by Hermes Penton Ltd
Derived from L'Objet, Quantitative Approaches in Object-oriented Software
Engineering, Vol. 7, no. 4.
Apart from any fair dealing for the purposes of research or private study, or criticism or review, as
permitted under the Copyright, Designs and Patents Act 1988, this publication may only be reproduced,
stored or transmitted, in any form or by any means, with the prior permission in writing of the publishers, or
in the case of reprographic reproduction in accordance with the terms and licences issued by the CLA.
Enquiries concerning reproduction outside these terms should be sent to the publishers at the
undermentioned address:
Hermes Penton Science
120 Pentonville Road
London N1 9JN
Copyright © 2001 Hermes Science Publications
Copyright © 2002 Hermes Penton Ltd
The right of Fernando Brito e Abreu, Geert Poels, Houari A. Sahraoui and Horst Zuse to be identified as
the editors of this work has been asserted by them in accordance with the Copyright, Designs and Patents
Act 1988.
British Library Cataloguing in Publication Data
A CIP record for this book is available from the British Library.
1-9039-9627-9
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
Foreword
Software internal attributes have been extensively used to help software managers, customers and users
to characterize, assess, and improve the quality of software products. Many large software companies
have adopted software measures intensively to increase their understanding of how (and how much)
software internal attributes affect the overall software quality. Estimation models based on software
measures have successfully been used to perform risk analysis and to assess software maintainability,
reusability and reliability. However, most measurement efforts have focused on, what we call today,
"legacy technology".
The OO paradigm provides more powerful design mechanisms. Much work has yet to be done to
investigate analytically and/or empirically the relationships between OO design mechanisms, e.g.,
inheritance, polymorphism, encapsulation, usage, etc., and different aspects of software quality, e.g.,
modularity, modifiability, understandability, extensibility, reliability, reusability, etc. Furthermore, new
technologies, e.g., OO frameworks, OO Analysis/Design patterns, OO architectures, OO components,
which take advantage of OO design mechanisms have been proposed in order to improve software
engineering productivity and software quality. However, to better understand the pros and cons of these
technologies for products developed by using them we must be able to assess the quality of such products
via adequate software product measures.
A quick look at the literature shows that the work done in the field of quantitative approaches in objectoriented software engineering covers a wide range of topics For this publication, four of them were
selected: metrics collection, quality assessment, metrics validation and process management. These four
items were identified as key topics during the series of QAOOSE (Quantitative Approaches in ObjectOriented Software Engineering) workshops from which this publication is derived.
The first contribution, "A Formal Approach to Building a Polymorphism Metric", proposes a metric that
provides an objective and precise mechanism to detect and quantify dynamic polymorphism. This metric is
defined using a rigorous formalization of the polymorphism and is validated theoretically.
The second, "A Merit Factor Driven Approach to the Modularization of Object-Oriented Systems", presents
a quantitative approach for the modularization of object-oriented systems. This approach aims at finding
the optimal number of modules using a modularization merit factor and clustering the classes according to
this number.
The third, "Object-relational Database Metrics", is devoted to the definition and the validation of a suite of
metrics for object-relational databases. The definition and the validation (theoretical and empirical) follow
a rigorous methodology.
The fourth, "Measuring Event-based Object-oriented Conceptual Models", introduces a suite of metrics
that covers two important fields of object-oriented technology, namely the early stages of development
and dynamic aspects of the design. A first empirical validation of the metrics is presented to show their
usefulness.
The fifth, "Class Cohesion as Predictor of Changeability: An Empirical Study", describes an investigation
on the possibility to use the cohesion metrics as indicators for one of the important quality characteristics,
namely the changeability. Although the results didn't demonstrate an evidence of relationship, the authors
showed that the problem is related to the definition of the cohesion metrics.
The sixth paper, "Building Quality Estimation Models with Fuzzy Threshold Values", proposes an approach
for building and using software quality estimation models. This approach is based on a fuzzy logic-based
learning algorithm. The main objective is to circumvent one of the major problems with the existing,
namely the use of precise metric thresholds values.
There are many people to thank for their efforts in the production of this publication, including the external
reviewers and specially Bernard Coulange, Guido Dedene, Teade Punter, and Franck Xia for their good
work.
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
Fernando Brito e Abreu
FCT/UNL & INESC, Lisboa, Portugal
Geert Poels
Vlekho Business School, Brussels, Belgique
Houari A. Sahraoui
IRO, Montréal, Canada
Horst Zuse
Technische Universität Berlin, Allemagne
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
Chapter 1: A Formal Approach to Building a
Polymorphism Metric
Claudia Pons, Lifia, Universidad Nacional de La Plata,
Argentina, Brazil
Luis Olsina, GIDIS, Facultad de Ingeniería, UNLPam,
Argentina, Brazil
1 Introduction
Object-oriented (O-O) software engineers need a better understanding of the desirable and non-desirable
characteristics of O-O systems design, and their effect on the quality factor. These properties must
represent those characteristics that lead to more understandable, analyzable, extensible and ultimately
maintainable software products.
The key issues related to the quality assessment of O-O systems are:
It is necessary to determine the desirable and non-desirable characteristics of systems;
There must be a formal definition of these characteristics;
It is necessary to provide mechanisms to detect and quantify the presence of these characteristics;
These mechanisms must be formal and objective.
Although quality is not easy to evaluate since it is a complex concept integrated by different characteristics
(as efficiency, maintainability, among others), several properties that make for good O-O design have
been recognized and widely accepted by the community. Traditional metrics are often quite applicable to
OO, but traditional metric suites are not sufficient to measure all OO-specific properties. So, at least, the
traditional metric suites must be extended by including new measures (e.g. for polymorphism) to make
them useful for measuring OO software. This problem is due to the presence of additional properties that
are inherent to the O-O paradigm, such as abstraction, inheritance and polymorphism. These new
concepts are vital for the construction of reusable, flexible and adaptable software products and they must
be taken into consideration by O-O software quality metrics.
The applicability problem of traditional techniques has been analyzed in the works of Chidamber and
Kemerer [CHI 94], Tegarden et al [TEG 92] and Wilde and Huitt [WIL 92] among others. Special metrics
for O-O systems have been investigated; see for example the works of Chen and Lu [CHE 93], Kim et al
[KIM 94] and Li and Henry [LI 93]. There are numerous proposals addressing the assessment of traditional
properties into O-O systems; for example the work of Poulin [POU 97], Briand et al [BRI 97], Price and
Demurjian [PRI 97], Benlarbi [BEN 97]. But less work has been done in the field of specific O-O properties;
see for example the works of Bansiya [BAN 97] [BAN 99] [BAN 99], Benlarbi and Melo [BEN 99], Abreu
and Carapuça [ABR 94] and Zuse [ZUS 98].
An additional problem is that many of the currently available metrics can be applied only when the product
is finished or almost finished, since data is taken from the implementation, so the problems of weakness in
quality are detected too late. It is desirable to have a tool that uses information coming from the first stages
of the development process (i.e. requirement analysis phases); this would give developers the opportunity
to evaluate early and improve the quality of the product in the development process.
In this paper, new metrics to measure the quality of an O-O design are defined. These metrics are applied
to the conceptual model of a system expressed in the unified modeling language [UML 99], thus permitting
an early analysis of the system quality. Although we agree that both the traditional and the specific O-O
properties or attributes should be analyzed in assessing the quality of O-O design, our purposes are not to
define a complete quality evaluation mechanism (in the sense that it considers every system
characteristic), but only to characterize some aspects of the polymorphism attribute.
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
The polymorphism concept can be considered to be one of the key concepts in determining the quality of
an O-O design. Regarding the literature, e.g., Benlarbi and Melo [BEN 99], different kinds of polymorphism
have been classified, namely: pure, static, and dynamic ones. For instance, considering the latter, for two
methods to be polymorphic, they need to have the same name and signature (parameter types and return
type) and also the same effects (changing the state of the receiver in the same way and raising the same
messages to other objects in the system). Dynamic binding allows one to substitute objects that are
polymorphic for each other at run-time. This substitutability is a key concept in O-O systems. Polymorphic
systems have several advantages. They simplify the definition of clients, since so long as a client only uses
the polymorphic interface, it can substitute an instance of one class for another instance of a class that has
the same interface at run-time, because all instances behave the same way.
We formally define the dynamic polymorphism concept, giving foundations for its detection and
quantification. Thus, the polymorphism measure should be combined with the measures of the rest of the
properties (such as coupling, cohesion, entropy, etc) with the aim of determining the total quality of the
system. However, this metrics combination task is beyond the scope of this work.
The structure of this paper is as follows: in the next section, we introduce the M&D-theory, an approach for
giving formal semantics to the UML model. In Section 3, we give a formal definition of polymorphism. We
define a polymorphism metric and examples in Sections 4 and 5. In the following sections, a conceptual
framework for validation is introduced as well as the theoretical validation for that metric suites.
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
2 The formal domain
We first introduce the M&D-theory, a proposal for giving formal semantics to the Unified Modeling
Language. The basic idea behind this formalization is the definition of a semantic domain integrating both
the model level and the data level. In this way, both static aspects and dynamic aspects of either the
model or the modeled system can be described within a first order formal framework.
The entities defined by the M&D-theory are classified in two disjoint sets: modeling entities and modeled
entities. Modeling entities correspond to concrete syntax of the UML, such as Classes or StateMachine. In
contrast, modeled entities, such as Object or Link represent run-time information, i.e. instances of classes
and processes running on a concrete system.
2.1 Structure of the theory
The M&D-theory is a first-order order-sorted dynamic logic theory consisting of three sub-theories: M&Dtheory = UML-theory + SYS-theory + JOINT-theory
Note A first-order order-sorted dynamic logic theory Th consists of a signature S that defines the
language of the theory, and a set of S-axiomas f : Th = (S, f ). A signature S consists of a set of
sort symbols S, a partial order relation between sorts =, a set F of function symbols, a set P of
predicate symbols, and a set A of Action symbols: S = ((S, =), F, P, A).
The language of the theory intentionally follows the notation of the UML metamodel [UML 99] and the
Object Constraint Language OCL [UML 99].
2.1.1 The sub theory UML-theory
The theory describes modeling entities (i.e. models). In the UML, Class Diagrams model the structural
aspects of the system. Classes and relationships between them, such as Generalizations, Aggregations
and Associations constitute Class Diagrams. On the other hand, the dynamic part of the system is
modeled by Sequence and Collaboration diagrams that describe the behavior of a group of instances in
terms of message sendings, and by State Machines that show the intra-object dynamics in terms of state
transitions.
Modeling entities are related to other modeling entities. Consider for example the association between
Class and StateMachine by the relation labeled 'behavior'. This association indicates that StateMachines
can be used for the definition of the behavior of the instances of a Class. Other example is given by the
relation existing between StateMachine and State, which specifies that a StateMachine is composed of a
set of States. It is important to formally define how the different UML diagrams are related to one another,
to be able to maintain the consistency of the model. Moreover, it is important to specify the effect of
modifications of these diagrams, showing what is the impact on other diagrams, if a modification to one
diagram is made.
The theory consists of a signature UML = ((SUML,=),F UML,P UML,A UML) and a formula f UML over UML:
The set SUML contains sort symbols representing modeling elements, such as Class and StateMachine.
The order relation between sorts allows for the hierarchical specification of the elements. The sets of
symbols FUML and PUML define functions and predicates on modeling entities.
The set AUML consists of action symbols representing evolution of specifications over their life cycle. One
of the most common forms of evolution involves structural changes such as the extension of an existing
specification by addition of new classes of objects or the addition of attributes to the original classes of
objects. On the other hand, evolution at this level might reflect not only structural changes but also
behavioral changes of the specified objects. Behavioral changes are reflected for example in the
modification of sequence diagrams and state machines.
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
The formula f UML is the conjunction of two disjoint sets of formulas, f s and f D of static and dynamic
formulas respectively. The former consists of first-order formulas which have to be valid in every state the
system goes through (they are invariants or static properties or well-formedness rules of models). These
rules are used to perform schema analysis and to report possible schema design errors. The latter
consists of modal formulas defining the semantics of actions, that is to say, the evolution of models.
2.1.2 The sub-theory SYS-theory
This theory describes the modeled entities (i.e. data and process). The elements in the data level are
basically instances (data value and objects) and messages. At the data level a system is viewed as a set
of related objects collaborating concurrently. Objects communicate with each other through messages
that are stored in semi-public places called mailboxes. Each object has a mailbox where other objects can
leave messages.
Modeled entities are related to other modeled entities. For example the relationship named 'slot', between
Object and AttributeLink, denotes the connection between an Object and the values of its attributes.
The theory consists of a signature SYS= ((S SYS,=), F SYS, PSYS, ASYS) and a formula SYS over SYS:
The set SSYS contains sort symbols representing the data in the system and its relationships, such as
objects, links, messages, etc. The sets of symbols FSYS and PSYS define functions and predicates on data.
The set ASYS consists of action symbols representing evolution of data at run time, such as object state
changes. The formula SYS is the conjunction of two disjoint sets of formulas, s and D of static and
dynamic formulas respectively. The former consists of first-order formulas which have to be valid in every
state the system goes through (they are invariants or static properties or well-formedness rules of data),
whereas the latter consists of modal formulas defining the semantics of actions, that is to say the possible
evolution of the data.
2.1.3 The sub-theory JOINT-theory
This part of the theory describes the connection between model and data levels. Modeling entities are
related to modeled entities. There is a special relationship among some modeled entities with their
corresponding modeling entity. This relationship denotes "instantiation", for example, an Object is an
instance of a Class, whereas Links are instances of Associations.
Finally, f JOINT is a formula constructed in the extended language SM&D, and thus it can express at the
same time data properties (e.g. behavioral properties of objects), model properties (e.g. properties about
the specification of the system) and properties relating both aspects. Figures 1 and 2 show a sample of the
M&D-theory. More details of the theory can be found in [PON 99a] and [PON 99b].
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
Figure 1: Sample of the M&D-theory
Figure 2: Sample of the M&D-theory
2.2 Advantages of integration
The integration of modeling entities and modeled entities into a single formalism allows us to express both
static and dynamic aspects of either the model or the modeled system within a first order framework. The
validity problem (i.e. given a sentence f of the logic, to decide whether f is valid) is less complex for firstorder formalisms than for higher order formalisms. The four different dimensions: static aspects of
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
models, static aspects of data, dynamic aspects of models, dynamic aspects of data, are highlighted in
Figures 1 and 2. The integrated formalism is suitable for the definition of a variety of properties of O-O
systems, structural properties as well as behavioral properties.
The logic allows us to define structural properties such as: depth of class hierarchy, size of class interface,
number and type of associations between classes, etc. These properties can be expressed because
classes, associations, generalization, etc are first-class citizens in the logic. On the other hand, instances
and their behavior are also first-class citizens of the logic; as a consequence, it is possible to define
behavioral properties such as pre/post conditions of operations, equivalence of behavior, among others.
2.3 Using the M&D-theory to formalize an O-O model
We formally define the semantics of the UML using a two-step approach:
interpretation (or translation) of the UML to the M&D-theory;
semantics interpretation of the M&D-theory, as follows:
UML-constructions translation M&D-theory semantics Semantics-domain
The semantics mapping Sem is the composition of both steps. The first step converts an UML model
instance to the modal logic theory, the conversion provides a set of formulas that serves as an
intermediate description for the meaning of the UML model instance. The key components of this step are
rules for mapping the graphic notation onto the formal kernel model. The second step is the formal
interpretation of this set of formulae. The semantics domain where dynamic logic formulas are interpreted
is the set of transition systems. A transition system, U = (SU,wo,mU), is a set of possible worlds or states
with a set of transition relations on worlds; For details about semantics of dynamic logic, see [HAR 00] and
[WIE 98]. Formally, let S=( (S, =), F, P, A) be a first-order dynamic logic signature and let SN=( (S, =), FN,
PN) be the non-updatable part of S. Let U =( A,mU) be a SN-algebra, providing a domain for the
interpretation of static terms.
Formulas of the language are interpreted on Kripke-frames U = (SU,wo,mU), where:
SU is the set of states. Each state wS U is a function that maps terms to the algebra
w0S U is the initial state.
mU associates each action a to a binary relation called the input/output relation of a : m U(a )S U
x SU
The domain for states is an heterogeneous algebra (a SN-algebra) whose elements are both model
elements (such as classes) and data elements (such as objects). The interpretation of a term t in a state w
given v (written as intw(t)) is defined in the usual way. The satisfaction of a closed formula in a structure U
and a state w is defined as follows:
U,w |= (t1=t2) iff intw(t1)= intw(t2)
U,w |= ¬f iff not(U,w|=f )
U,w |= f iff U,w |=f and U,w |=
U,w |= [a]f iff w', if (w,w')m U(a ), then U,w'|=f .
A model for a specification sp=(S,F,P,A, f ) is a structure U such that U,w0|=f .
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
3 Formal definition of polymorphism
In this section, we give a rigorous definition of polymorphism in the framework of the M&D-theory. Definitions of
the polymorphism concept can be read in [WOO 97]. Let M be an UML model of an O-O system. Let U be the
formal semantics of that model, i.e. U =Sem(M).
Definition 1: polymorphic methods
For two methods to be polymorphic, they need to have the same name and signature (parameter types and
return type) and also the same effects (changing the state of the receiver in the same way and raising the same
messages to other objects in the system).
Let m be a method name. Let C1 and C2 be two classes existing in the model M.
The methods named m are polymorphic in C1 and C2 in the model U if the following formula holds:
Where the predicate Polymorphic is defined as follows:
Def 1.1
m:Name C 1,C2:Class *
Polymorphic(m,C1,C2) m 1,m2 *
( m1C 1.operationsm 2C 2.operations
m1.name=mm 2.name=m
hasSameSignature(m 1,m2)
hasSameBehavior(m,C 1,C2) )
The formula above states that operations named m, belonging to classes C1 and C2 respectively, are
polymorphic if they have both the same signature and behavior.
The predicate hasSameSignature applied on two methods is true if both methods have the same signature (i.e.
name and parameters). It is defined in the M&D-theory as follows:
Def 1.2
b,b':BehavioralFeatures *
hasSameSignature(b,b') (b.name= b'.name
areEquivalent(b.parameters, b'.parameters) )
Where areEquivalent is defined as follows:
Def 1.3
areEquivalent(,)=true
areEquivalent(p:ps, )=false
areEquivalent(,p:ps)=false
areEquivalent(p1:ps,p2:ps')=equivalent(p1,p2)areEquivalent(ps,ps')
Quantitative Approaches in Object-Oriented Software
Engineering
by Fernando Brito e Abreu, Geert Poels,
Houari A. Sahraoui and Horst Zuse (eds)
ISBN:1903996279
Kogan Page © 2003 (130 pages)
This book gives a comprehensive description of four areas of
quantitative approaches in object-oriented software
engineering: metrics collection, quality assessment; metrics
validation and process management.
Table of Contents
Quantitative Approaches in Object-Oriented Software Engineering
Foreword
Chapter 1 - A Formal Approach to Building a Polymorphism Metric
Chapter 2 -
A Merit Factor Driven Approach to the Modularization of ObjectOriented Systems
Chapter 3 - Object-Relational Database Metrics
Chapter 4 - Measuring Event-Based Object-Oriented Conceptual Models
Chapter 5 - Class Cohesion as Predictor of Changeability—An Empirical Study
Chapter 6 - Building Quality Estimation Models with Fuzzy Threshold Values
Index
List of Figures
List of Tables
List of Examples
wheredenotes the empty sequence and p:ps denotes a non-empty sequence made up from a head (denoted
by p) and a tail (denoted by ps).
And finally, the predicate equivalent is applied on two single parameters determining their equivalence:
Def 1.4
p 1,p2:Parameter * equivalent(p1,p2)(p 1.defaultValue=p2.defaultValue
p1.kind= p2.kindp 1.type=p2.type)
Two methods named m have the same behavior in C1 and C2 if they are indistinguishable (see Figure 3) i.e., for
every two objects o1 and o2 (being o1 instance of C1 and o2 instance of C2); the effect of executing o.m is the
same as the effect of executing o.m, where o.m denotes that object o receives and execute the method named
m. The predicate is defined as follows:
Figure 3: Commutativity of polymorphic methods
Def 1.5
U,w |= hasSameBehavior(m,C1,C2) iff
o:Object * o.classifier=C 1 then
w 1 * (w,w1) m U(o.m) then
w',w' 1 * ( (w,w') m U(o.migrates(C2))
(w',w' 1) m U(o.m)(w' 1,w1) m U(o. migrates(C1)) )
That is to say, the diagram in Figure 3 commutes, where the action o.migrates(C) represents that object o
switches its class to C (see definition 1.6).
Def 1.6