2 CORRECTNESS OF UML
DIAGRAMS
When we develop software through Model DrivenAr-
chitecture (MDA) (Warmer et al., 2003), many kinds
of “models” are created in each phase of development,
e.g., “requirement analysis”, “external design”, “in-
ternal design”, and “implementation” phases. These
models are usually expressed in the form of UML di-
agrams. Since UML 2.x provides us with thirteen dif-
ferent kinds of diagrams, we have to deal with a vari-
ety of model forms in MDA-based development.
Before discussing the correctness of a set of UML
models, we first need to reveal the relationships be-
tween these diagrams.
2.1 The Relationships between UML
Diagrams
Among the above thirteen diagrams, “state machine”,
“activity”, and “sequence” diagrams compose one of
the most important set of UML diagrams to represent
the behavioral aspect of a system, since these dia-
grams respectively depict the behavior of objects in
different ways, that is, as the behavior of individual
objects, as the flow of process performed by these ob-
jects, and as the interactions between these objects. In
order to construct a system appropriately that reflects
a given set of UML models expressed in the form of
these three kinds of diagrams, there must be no con-
flicts not only within each model, but also between
the models.
However, few criteria are defined for evaluating
the conflicts between UML models. Therefore, we
first have to define the “relationships” between UML
models. Supposing we are given a set of UML mod-
els depicted by the above three kinds of diagrams,
which represents the behavioral aspect of a system,
it must include all the objects composing the system.
These objects show the different forms according to
in which diagram they appear. Therefore, the rela-
tionships between arbitrary two models expressed in
the form of different diagrams cannot be simply iden-
tified by comparing them. In order to identify the re-
lationships between the above three kinds of models,
we first reveal how an object acts in each diagram.
In a state machine diagram, a diagram itself repre-
sents an object, and the behavior of an single object is
depicted as state transitions. On the other hand, an ac-
tivity and sequence diagrams usually include multiple
objects which behave independently. In a sequence
diagram, an object occurs as a “lifeline”, while no ex-
plicit object occurs in an activity diagram. An object
occurs in two possible forms in an activity diagram,
that is, as an object flow between activities, or as an
actor of an activity.
As shown above, even though an object is a com-
mon element between these three diagrams, its behav-
ior is differently expressed within them. Therefore,
we need more common measures that exist within all
of them. One of the convenient measures is a method
invocation, since it occurs explicitly within these di-
agrams. In a state machine diagram, it is associated
with a state transition, which is referred to as an “ac-
tion” of the transition. It also occurs in an activity
diagram as an “activity” or “action”, or as a “mes-
sage” exchanged between lifelines in a sequence dia-
gram. By using the method invocation as a common
measure, the behavior of an object in the three differ-
ent diagrams is represented commonly as an order of
method invocations.
In order to define the relationships between these
diagram types using the method invocations, sev-
eral assumptions are taken into account in this pa-
per, which seem acceptable in software development.
Firstly, the state of each object is determined by a set
of values assigned to the instance variables of the ob-
ject. Secondly, the above instance variables can be
updated only by the methods of the object to which
the variables belong. This means all the instance vari-
ables are fully encapsulated. Thirdly, each lifeline,
activity, and action mentioned above is definitely as-
sociated with an object.
These assumptions suggest that each time a mes-
sage is received by a lifeline, or an activity/action is
performed in a sequence or activity diagram respec-
tively, the associated object makes a state transition
in the way as specified in the state machine model for
the object. These state transitions divide each life-
line of a sequence diagram into the zones associated
with the states. On the other hand, there seems to be
no way to divide an activity diagram by the states,
since unlike a sequence diagram, an activity diagram
is not partitioned by each object unless we use “swim
lanes”. Therefore, in order to divide an activity di-
agram into the zones like a sequence diagram, it is
a good practice to reorganize an activity diagram by
aligning activities and actions along the objects that
perform them. In doing so, we can divide an activ-
ity diagram into the zones like a sequence diagram.
Since the state for each zone is taken from a state ma-
chine diagram, we refer to the states in an activity or
sequence diagram as the “injected state”, and the pro-
cess to identify the state as the “state injection”.
Assuming all the activity and sequence diagrams
included in the currently focused set are divided into
such zones, the above three kinds of UML models,
that is, the models depicted by UML state machine,
ICSOFT2012-7thInternationalConferenceonSoftwareParadigmTrends
248