<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Proposal for Improving the UML Abstract Syntax</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Dan Chiorean, Vladiela Petras ̧cu, Ioana Chiorean Babes ̧-Bolyai University</institution>
          ,
          <addr-line>Cluj-Napoca</addr-line>
          ,
          <country country="RO">Romania</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>-Different types of consistency of UML models have been described in the literature. The consistency of UML models with the UML static semantics, usually referred as wellformedness, and the consistency between different versions of the same model are among the most cited. The UML models' well-formedness is a precondition for any other kind of consistency, being described by means of the UML abstract syntax. Unfortunately, this abstract syntax specification is bogus. As a consequence, checking UML models' consistency is not a natural practice, as it should be. Beginning with 2000, there have been several papers reporting this state of facts, but without any visible consequences on the state of practice. In this paper, the authors propose a new approach (including specification techniques and a process) meant to overcome this specification drawback. Our proposal is based on a long practice of improving the specification of UML Well-Formedness Rules in the OCLE tool. Index Terms-UML model consistency, UML abstract syntax, Well-Formedness Rules</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>
        The purpose and relevance of the abstract syntax
specification of MOF-based metamodels are explicitly mentioned in all
OMG documents and acknowledged by the entire community
of modelers. As stated in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], “The abstract syntax defines
the set of UML modeling concepts, their attributes and their
relationships, as well as the rules for combining these concepts
to construct partial or complete UML models.” The same
document claims that “Relative to UML 1, this revision of
UML has been enhanced with significantly more precise
definitions of its abstract syntax rules and semantics, a more
modular language structure, and a greatly improved capability
for modeling large-scale systems.” Unfortunately, the state of
facts does not live up to these claims. The paper [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] proposed
by Wilke and Demuth at the OCL 2011 Workshop is a relevant
proof of this, through both its title and contents, even though
it has been written before [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. The errors identified within
the abstract syntax specification and the solutions proposed
for some of them concern all UML and MOF releases, with
no exception (see [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] - [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]). Although there have
been enhancements in the abstract syntax specification from
one version of the standards to the other, things could and
should be seriously improved given the fact that: the reported
errors, except compilation errors, have not been eliminated
yet, new errors have emerged, the reading and analysis of
the UML 2.x specification is much more tedious compared to
its 1.x version. Thus, the understanding of a single 2.x
wellformedness rule (WFR) generally requires a detailed analysis
of several class diagrams and additional operations (AOs).
The fact that the standard abstract syntax specifications fail
to reach a stable and correct version is symptomatic and
triggers the necessity of a change of attitude in writing such
specifications. The approach proposed here is driven by the
paramount importance of a complete, non-ambiguous informal
specification, accompanied by relevant examples and by the
need of a thorough validation of all specifications, based on
adequate test cases. The technical aspects concerning the OCL
specifications reported by previous papers, as well as the need
of a testing-oriented OCL specification (meant to support an
efficient error detection and diagnosis [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]) are also considered.
      </p>
      <p>Within the abstract syntax specification, the role of the
informal (natural language) descriptions is twofold. On the one
side, they are used for detailing the structure described by class
diagrams, by providing additional information concerning the
concepts, attributes and associations involved. On the other,
they describe the constraints that should be fulfilled by the
modeling concepts, as well as the additional operations used
for querying the model or needed in the specification of
WFRs. This second role influences both the design of OCL
specifications and their validation.</p>
      <p>Unlike previous work on the topic, this paper introduces
a natural approach concerning the specification of a static
semantics. Although the term “approach” may seem a bit
pretentious, we claim it is the most adequate, since it refers to
a process in which the involvement of the OMG standards’
authors is a must. The gaps and ambiguities residing in
the standard specifications cannot be fixed in absence of
their authors or in the absence of an explicit, unequivocal
description, due to the risk of altering the original intentions.
Our proposal takes into account the major differences among
the 2.x and 1.x versions of the UML standard.</p>
      <p>
        The reading of the UML 2.x specifications is more
demanding and tedious as compared to the 1.x versions. This
is due to the fact that most of the concepts are progressively
described in several packages, their understanding requiring
the investigation of various diagrams and associated textual
descriptions [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The amount of newly-introduced concepts
and their dispersed presentation are a strong argument towards
the adoption of a complete, rigorous and clear description
style, as proposed by this paper.
      </p>
      <p>II. UML 2.X ABSTRACT SYNTAX - FROM GOALS TO</p>
      <p>STATE OF FACTS</p>
      <p>
        The primary purpose of an abstract syntax definition is
that of providing a complete, non-ambiguous and rigorous
description of a modeling language. These requirements are
mandatory for both the correct understanding and consistent
use of the modeling language, and for enabling conformance
verifications of user-models against it. Failure to fulfill these
requirements triggers inability to fully validate models and
the risk to encounter different interpretations of the same
specifications. Moreover, it compromises the chance to ensure
a safe and predictable model transfer among tools, as required
by [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]: “One of the primary goals of UML is to advance the
state of the industry by enabling object visual modeling tool
interoperability. However, to enable meaningful exchange of
model information between tools, agreement on semantics and
notation is required.”
      </p>
      <p>
        Modeling languages share far more commonalities than
differences with programming languages. Therefore, similar
to programs, compilability is a mandatory requirement on
models as well. However, the similarity among the two types
of languages does not only involve compilability. Similar
to programs, models should be executable, and the results
should conform to the requirements [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. The formal model
specifications should be preceded by informal equivalents. The
informal description should be complete and non-ambiguous,
since, according to Kristen Nygaard “Programming is
understanding”. Therefore modeling, similar to programming,
cannot be imagined in the absence of a thorough problem
understanding. Mathematical proofs of specifications’ correctness
are only seldom realized; testing remains therefore the best
alternative, at least in the current context. Similar to program
development, ensuring model compilability is mandatory only
at some key points of model development (usually, prior to
transforming the models or prior to performing simulations).
Such a requirement is best captured in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]: “ during model
editing, the model will frequently be syntactically incorrect,
and the tool needs to be able to allow for syntactical
incorrectness in this mode.”. Thus, it is easy to understand the
reason why the static semantics is described exclusively by
means of invariants (WFRs), without pre/post-conditions, as
promoted by Design by Contract. Despite this, some of the
additional operations encountered in UML have preconditions.
We judge this practice as right and useful, since the additional
operations are not employed exclusively in the specification
of invariants. An AO being targeted to model navigation, the
fulfillment of its precondition guarantees that its evaluation is
meaningful, while the fulfillment of its postcondition ensures
the correctness of the evaluation results. As regarding the result
of a model compilability check, this should provide more
than a simple yes/no message. In case of non-compilability,
it is essential to be provided with meaningful information
enabling efficient error diagnosing and allowing a real-time
model adjustment.
      </p>
      <p>The informal specifications included in the UML 2.x
documents (for both WFRs and AOs) fail to comply with the quality
requirements mentioned in the beginning of this section.
This is a high-priority issue, in our view. In the last UML
specification, 2.5, WFRs are compilable - a step forward
compared to the previous specification, 2.4.1. However, the
runtime testing and debugging issues are much more tedious
than the compilability ones, as unanimously acknowledged by
software developers. An important cause of the existing errors
is the inappropriate informal specification. We will deal with
these issues in Section 5 of this paper.</p>
    </sec>
    <sec id="sec-2">
      <title>III. RELATED WORK</title>
      <p>Beginning with 2000, several papers have focused on the
specification and usage of WFRs. In the following, we
summarize the ones considered to be the closest to our approach.</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], the authors have given a first quasi-exhaustive
analysis of the WFRs specified in UML 1.3. The work has
focused on the Foundation::Core package (31 classes and
27 associations) that has been specified in USE, in order
to check the corresponding 43 WFRs. Also, 28 Additional
Operations were tested. Errors have been found in 39 out
of 71 tested expressions. Four categories of errors have been
identified: syntax errors, minor inconsistencies, type checking
errors, and general problems. The paper was the first to draw
an alarm with respect to the quality of the UML WFRs
specifications. The following statement worth mentioned: “For
future work we plan to extend the analysis to the complete
UML metamodel including all of its wellformedness rules
and making it available in USE. This might not only be
useful for improving the state of the standard but also implies
another very nice application: in principle, any UML model
can be checked for conformance to the UML standard.”. In
[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], authors from the same research team present a similar
analysis performed with USE, this time for the UML 2.0
Superstructure.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], the second published paper on this topic, the authors
claim having tested the entire set of WFRs specified in the
context of the UML 1.3 metamodel. They report 450 errors
of three kinds: non-accessible elements, empty names, and
miscellanea. The proposed solutions for fixing the reported
problems seem a bit bizarre. Namely, they suggest to “Take
the empty names into account in every rule of the metamodel
(296 errors). Consider access and contents as two different
concepts (138 errors). Avoid two opposite association ends
with the same name (18 errors)”.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], the authors present two techniques for checking UML
models. One, implemented in Rational Rose, that enables to
navigate and check the contents of the UML metamodel by
means of an appropriate VBA specification, and the other
by means of OCL AOs and WFRs. Some AOs and WFRs
are analyzed both with respect to the identified bugs to the
actions undertaken for correcting them. In [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], the same
authors analyze different kinds of errors identified in the
OCL specification. The focus is on proposing “good practices”
meant to support “a correct, clear and efficient specification”.
      </p>
      <p>
        The consistency among the formal and informal specifications,
the clearness of OCL expressions, the fact that evaluating OCL
specifications instead of only compiling them is imperative, are
among the proposed and exemplified practices. The paper [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
is focused on describing OCL specification patterns intended
to support a specification style targeted at an easier model
debugging. In [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], the focus is on the similarities between
programming and modeling languages. The paper emphasizes
the fact that, in the context of the model-driven paradigms,
producing compilable models is a must, not an option.
      </p>
      <p>
        [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] is focused on the study of UML 2.3 Superstructure
WFRs. As acknowledged by its authors, there are many
similarities between the topic and results reported in this paper
and those of [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The differences concerns the metamodels
(UML 2.3 in this last analysed paper and UML 2.0 in the
previous case) and the tools employed (Dresden OCL toolkit
in the last paper and USE in the other).
      </p>
      <p>The common feature of papers published by the teams from
Bremen and Dresden is their focus on the compilation phase.</p>
      <p>As regarding the papers published by our team, the analysis
overpasses the mere compilation. The runtime results and their
conformance to the informal specifications are also considered.</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], the authors present coherence rules grouped on
metamodel elements and diagrams. Although the idea looks
nice, there are some drawbacks. Firstly, the rules are presented
exclusively in an informal manner (in spoken language);
moreover, for some rules the semantics is not clear enough.
      </p>
      <p>Secondly, there are no comments about incorrect rules and
about authors’ proposal for improving the existent semantics.</p>
      <p>
        Finally, in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and in some other papers on the same topic,
A. Egyed presents ”an approach for quickly, correctly, and
automatically deciding when to evaluate consistency rules.” As
the title of the paper suggests, the author’s work is focused
on doing an automated quick evaluation. In the experience
presented, only 24 rule were evaluated - some being WFRs
and others defined by model designers. There are no mentions
about the correctness of the evaluated rules. From this point
of view, the approach is significantly different from ours.
      </p>
      <p>
        However, the author is convinced about the importance of
consistency checking in case of UML models.
3) The formal specifications of WFRs must be
testingoriented [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Accomplishment of this requirement
supports an easy error diagnosing of models that do not
comply with the WFRs in question.
4) Choosing the appropriate context for the specification
of WFRs that refer to features of several metaclasses is
also an important issue [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
5) For both efficiency and clarity, the use of OCL
specifi
      </p>
      <p>cation patterns is recommended, whenever the case.
6) Indented and syntax highlighted OCL expressions
enable an easier lecture of specifications. Prefixing the
formal specifications with a short informal description
of requirements (similar to comments in programming)
is useful, as well.
7) The WFRs which are specified in an informal
manner exclusively should be complemented by relevant
examples of their fulfillment or failure to be fulfilled,
possibly accompanied by an overview of how the
authors imagine the validation process. Obeying to this
requirement allows a better understanding of the rules
and provides support in finding appropriate specification
and validation solutions.</p>
      <p>Except for the forth recommendation, which seems to be
obeyed by almost all specifications of the UML, all the others
are not met. As illustrated in the following, taking them into
account will help in increasing the quality of the standard
specifications.</p>
      <p>V. ANALYZING IMPORT RELATIONSHIPS ON UML</p>
      <p>NAMESPACES</p>
      <p>The import in a namespace of elements from different
namespaces is one of the most important relationships in
both programming and modeling languages offering modular
IV. THE PROPOSED APPROACH FOR SPECIFYING THE development support. This allows the imported elements to</p>
      <p>ABSTRACT SYNTAX be directly referred by their name or by an alias, whenever
The state of facts in specifying the abstract syntax of UML, there is no name conflict among the imported elements and
together with a thorough analysis of the published literature on the elements belonging to the namespace which performs the
the topic allow us to argue that a significant amount of all the import. In case of conflict, the use of a qualified name is
existing specification errors are due to failure in obeying to a mandatory. The programming languages come with clear
specnumber of elementary requirements, validated by the software ifications concerning the import relationship. Thus, we argue
engineering practice. Given our experience in the field, we that any differences in the import rules specified for UML
propose conforming to the following rules when specifying and MOF compared to the programming languages should be
the abstract syntax of UML/MOF. clearly justified. Even more, examples are needed to illustrate
1) A complete and non-ambiguous informal equivalent of the manner in which various cases tolerated by modeling
all OCL specifications (both WFRs and AOs) is the languages can be coded in a programming language (direct
first and the most important of these rules. Moreover, engineering) or the reverse (reverse engineering). Otherwise,
there should exist a full conformance among the in- the support offered by modeling languages to the MDA, MDE
formal specification and its formal correspondent. It and MDD paradigms remains only in statements.
would be helpful if the informal specification would Similar to programming languages, the UML allows two
be accompanied (possibly in an attached document) by types of import:
examples illustrating cases of validation and invalidation 1) explicit, by defining an individual import
relationof each rule, as well as exceptional cases that may arise ship for each imported element (which should be a
throughout the evaluation of AOs. PackageableElement). Such an import relationship
2) Runtime validation of formal specifications on signifi- is modeled by the ElementImport concept (direct
cant data sets (models) is mandatory. Mere compilability descendent of DirectedRelationship), that has
is not enough. two attributes: visibility and alias. Graphically,
ElementImport is represented by a “a dashed arrow
with an open arrowhead from the importing namespace
to the imported element. The keyword import is
shown near the dashed arrow if the visibility is public,
otherwise the keyword access is shown to indicate
private visibility. If an element import has an alias, this
is used in lieu of the name of the imported element. The
aliased name may be shown after or below the keyword
import.”
2) implicit, by means of an import relationship among
the importing namespace and the imported package.
“Conceptually, a package import is equivalent to
having an element import to each individual member of
the imported namespace, unless there is already a
separately-defined element import.” Similar to the case
of an element import, this relationship is modeled by
the PackageImport metaclass, having an analogous
graphical representation. It “is shown using a dashed
arrow with an open arrowhead from the importing package
to the imported package. A keyword is shown near the
dashed arrow to identify which kind of package import
that is intended. The predefined keywords are import
for a public package import, and access for a private
package import.”</p>
      <p>The concepts involved in the import relationships and their
interconnections are illustrated in Figure 1. Even if not
explicitly stated, the set importedMember is needed when
computing the set of potential servers of a model element or
when checking if an element is legally imported.</p>
      <p>In the following, we will analyze the formal OCL
specifications (and their informal descriptions) regarding the
import relationship defined between a Namespace and a
PackageableElement or a Package.</p>
      <p>In the Namespace context, the AO
getNamesOfMember() previously specified in the
NamedElement context “is overridden to take account of
importing. It gives back the set of names that an element
would have in an importing namespace, either because it is
owned; or if not owned, then imported individually; or if not
individually, then from a package.”</p>
      <p>In our opinion, the last part of the second phrase (marked by
the underlined words) is a bit confusing. A clearer and more
explicit statement (at least for a non-native speaker) could be:
either because it is owned, or imported individually or by a
package import.</p>
      <p>Following, there is the corresponding OCL specification, as
provided in the standard.
qualified name outside the owner package. That is why, at the
Namespace : : getNamesOfMember ( e l e m e n t : NamedElement ) : S t r i n g [ 0 . . ∗ ] ; beginning of this section, we have emphasized the necessity of
getNamesOfMember = an explicit description of the rationale behind certain decisions.
tihf ens e Slfe t. {owe lneemdMe nemt.bnear−m&gt;e}i n c l u d e s ( e l e m e n t ) Secondly, it is easy to notice that the formal
specificae l s e l e t e l e m e n t I m p o r t s : Set ( E l e m e n t I m p o r t )= s e l f . e l e m e n t I m p o r t tion does not comply with the informal one, since only the
i f e−l &gt;ems ee nlet Ic mt(peoir |tse−i&gt;. nimotpEomr tpetdyE( )le m e n t = e l e m e n t ) i n visibilities of elementImport and packageImport are
then e l e m e n t I m p o r t s−&gt;c o l l e c t ( e l | e l . getName ( ) ) considered, without taking into account the visibility of the
e l s e s e l f . packageImport−&gt;s e l e c t ( p i |
p i . i m p o r t e d P a c k a g e . v i s i b l e M e m b e r s ()−&gt; i n c l u d e s ( e l e m e n t ) ) element itself (irrespective if it being owned by the package,
−&gt;c o l l e c t ( p i | p i . i m p o r t e d P a c k a g e . getNamesOfMember ( imported individually or by means of a package import).
Moree n d i f e l e m e n t ))−&gt; a s S e t over, the authors of the OMG specification say nothing with
e n d i f respect to what happens in particular cases, such as the one in
which the same element is imported both individually (with</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], the type returned by the observer defined is writ- visibility = VisibilityKind::private) and by
ten as String[0..*], notation not accepted in OCL 2.4 means of a packageImport with visibility =
(the current specification [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]) and previous specifications. VisibilityKind::public. In this case, evaluating the
The AO visibleMembers(), used by composition in specification above, makesVisible will be evaluated to
the above specification is bogus, as we will prove in the true, even if it is stated that the individual import has priority
following. As a consequence, the result returned by the AO compared to package import.
getNamesOfMember() will be incorrect in some cases. In order to exemplify our reasoning, let us consider the
      </p>
      <p>
        In the Package context, the query visibleMembers() model shown in Figure 2. As illustrated there, between
identifies those members of a Package that can be accessed packages P2 and P1 there is an &lt;&lt;import&gt;&gt; relationship.
outside it. The specification provided for the AO visibleMem- The package P1 owns the class A having visibility
bers() in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] is: = VisibilityKind::private. In the context of the
body : member−&gt;s e l e c t (m|m. o c l I s K i n d O f ( P a c k a g e a b l e E l e m e n t ) P1 package, we are interested to see if el = A is visible
and sc eollfl e. cmta(koecslVAissTiybpl ee ((mP)a) −ck&gt;a g e a b l e E l e m e n t))−&gt; a s S e t ( ) outside its owning package. The class A is a member
of P1, so we have to evaluate the makesVisible()
Analysing figure 12.1 Packages, pp. 29 from [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] AO. P1.ownedMember-&gt;includes(A), therefore
we wonder why the OMG has not proposed: makesVisible() = true. Thus, due to the
self.packagedElement-&gt;select(pe | packageImport relationship, A is added to the P2
self.makesVisible(pe)). In this case, the condition namespace and can be accessed by name, in case there are
oclIsKindOf(PackageableElement), the cast at no name collisions between A and other elements of the
PackageableElement, and the conversion asSet are P2 namespace. This result is incorrect, since the element in
redundant. question has private visibility.
      </p>
      <p>The query makesVisible() specified itself in the Thirdly, when the element is imported in the package
Package context, “defines whether a Package makes an by packageImport, the result returned will be wrong
element visible outside itself. Elements with no visibility and if the visibility of the element transmitted by parameter
elements with public visibility are made visible.”. (el) is VisibilityKind::private. A sample situation
Package : : m a k e s V i s i b l e ( e l : Namespaces : : NamedElement ) : Boolean ; is illustrated in Figure 3. In the package P2, the private
pre : s e l f . member−&gt;i n c l u d e s ( e l ) class A is imported by the importPackage relationship
m −a−ke stVh eis ieblleem=e n t i s i n t h e package stereotyped &lt;&lt;import&gt;&gt;. In P3, private class A is
im( ownedMember−&gt;i n c l u d e s ( e l ) ) or ported by means of the importPackage relationship, also
−(−e l ei mt e nist I mi mp oprotr−t &gt;eds e il ne cdti v( iedi u| aeil l. yv i wsii tbhi l iptuyb l=i c v i s i b i l i t y stereotyped &lt;&lt;import&gt;&gt;, between P3 and P2. In the OCL
V i s i b i l i t y K i n d : : p u b l i c)−&gt; c o l l e c t ( i m p o r t e d E l e m e n t . oclAsType ( specification of Package::makesVisible (see above),
−− i t NisamiemdpEoler mteednt)t)h−r &gt;ouignhc l uad epsac(keal g) e) owri t h p u b l i c v i s i b i l i t y this corresponds to the OCL expression following the second
( packageImport−&gt;s e l e c t ( p i | p i . v i s i b i l i t y = or (imported through a package with public visibility). Similar
pVii.siimb iploirttyeKd Pinadc k: a: gpeu.bml iecm)−be&gt;r−c&gt;oilnl ec lcut d( epsi |( e l ))−&gt;notEmpty ( ) ) to the previous case, the result is wrong, due to the visibility
of class A.</p>
      <p>As regarding this specification, there are some things we Concluding, we notice that even though the
would like to analyze. makesVisible() AO is compilable, its returned results do</p>
      <p>Firstly, the informal specification states that “Elements not fully comply with the informal specification. Even more,
with no visibility and elements with public visibility are the usefulness of elements with no visibility has not been
made visible.” As no explanation is offered regarding why explained and taken into account in the formal specification.
elements with no visibility are visible outside the package, Apart of these, there could be particular cases, like those
this requirement seems strange to us. Especially since in pro- mentioned above, when the results are debatable.
gramming languages (Java, for instance) only public members A possible solution would be to include in the precondition
of a package can be explicitly exported or referred by their the restriction regarding the visibility of el.</p>
      <p>Since we have no idea about the semantics of
el.visibility.oclIsUndefined in this case,
and due to other particular cases, our opinion is that the first
thing to do is to clarify the informal specification.</p>
      <p>
        In a namespace, a NamedElement is valid if it is
distinguishable from any other element owned by the
namespace [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. The WFR checking this requirement uses the
AO isDistinguishableFrom(p1,p2). This operation
is firstly defined within the NamedElement context, and
redefined in the BehavioralFeature context. As stated
in the [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] (pp. 73), “...By default, two named elements are
distinguishable if (a) they have unrelated types or (b) they have
related types but different names.”
c o n t e x t NamedElement : : i s D i s t i n g u i s h a b l e F r o m ( n : NamedElement ,
      </p>
      <p>ns : Namespace ) : Boolean
def : i s D i s t i n g u i s h a b l e F r o m ( n : NamedElement ,</p>
      <p>ns : Namespace ) : Boolean =
i f s e l f . o c l I s K i n d O f ( n . oclType ) or</p>
      <p>n . o c l I s K i n d O f ( s e l f . oclType )
then ns . getNamesOfMember ( s e l f )−&gt; i n t e r s e c t i o n (</p>
      <p>ns . getNamesOfMember ( n))−&gt;isEmpty ( )
e l s e t r u e
e n d i f</p>
      <p>The formal specification fully complies with the informal
requirements. However, stating that two elements having
unrelated types are distinguishable could cause unpleasant
situations, such as the one in which a package contains both a class
and an enumeration having the same name (e.g Test). In this
case, enumeration.oclIsKindOf(class.oclType)
and class.oclIsKindOf(enumeration.oclType)
are always evaluated to false, irrespective of the
enumeration instance of the metaclass Enumeration
and class instance of the metaclass Class (see
Figures 4 and 5). By consequence, the type of an attribute
testKind:Test belonging to a different class of the same
package is uncertain. This is due to the fact that we cannot
distinguish between these two types having the same name. In
order to fix this bug, the simplest solution would be to remove
“part a)” from the above requirements. However, the best
decision would be to provide a clearer specification, including
suggestive examples of models with both distinguishable and
not distinguishable named elements.</p>
      <p>The visibleMembers() AO analyzed at the beginning
of this section is used by composition in computing the set of
elements imported in a namespace.</p>
      <p>“The importedMember property is derived from the
ElementImports and the PackageImports.”
importedMember = s e l f . e l e m e n t I m p o r t . importedElement−&gt;a s S e t ( )
−&gt;union ( s e l f . p a c k a g e I m p o r t . importedPackage−&gt;c o l l e c t ( p |
p . v i s i b l e M e m b e r s ())−&gt; a s S e t ( ) )</p>
      <p>Here, the drawback is due to previously-discussed
visibleMembers(). Another problem is that both in case
of a direct elementImport and packageImport, we
have to consider also the elements having visibility
= VisibilityKind::private and marked with the
stereotype &lt;&lt;access&gt;&gt;, not only those marked with
&lt;&lt;import&gt;&gt;. That is why, the importedMember in the P3
namespace of Figure 6, will return Set{A, C, B, D, E},
so the visibleMembers() has a negative influence by
means of &lt;&lt;access&gt;&gt; packageImport also.</p>
      <p>Since in case of name-clashes the imported elements can
be referred only by means of their qualifiedName, let us
take a short look at the derived attribute qualifiedName,
specified in the NamedElement metaclass. In the standard it
is stated that this attribute “is constructed from the names of
the containing namespaces starting at the root of the hierarchy
and ending with the name of the NamedElement itself.” The
specification of the qualifiedName():String AO is:
body :
i f s e l f . name&lt;&gt;n u l l and s e l f . a l l N a m e s p a c e s()−&gt; s e l e c t ( ns |</p>
      <p>ns . name= n u l l)−&gt;isEmpty ( )
then s e l f . a l l N a m e s p a c e s()−&gt; i t e r a t e ( ns : Namespace ;
agg : S t r i n g = s e l f . name |
ns . name . c o n c a t ( s e l f . s e p a r a t o r ( ) ) . c o n c a t ( agg ) )
e l s e n u l l
e n d i f
.
5
.</p>
      <p>T
h
e</p>
      <p>C
l
a
s
s
e
s
d
i
a
g
r
a
m
o
f
t
h
e</p>
      <p>
        C
o
n
s
tr
u
c
t
s
p
a
c
k
a
g
e
f
r
o
m
[
        <xref ref-type="bibr" rid="ref11">1
1</xref>
        ],
      </p>
      <p>F
g
u
r
e
1
1
P2
iv a
A
&lt;
&lt;
p
r
t
e
&gt;
&gt;
P
1
C
&lt;
&lt;
p
r
iv
a
t
e
&gt;
&gt;</p>
      <p>B
&lt;
&lt;
imp
o
rt
&gt;
&gt;
&lt;
&lt;
a
c
c
e
s
s
&gt;
&gt;</p>
      <p>P
3
&lt;
&lt;
a
c
c
e
s
s
&gt;
&gt;
&lt;
&lt;
imp
o
rt
&gt;
&gt;
While this specification is
compilable
and</p>
      <p>roughly
correct, there
can
arise a little
problem, because
empty String is not forbidden as a name value, and
self.’’-&gt;notEmpty() = true, the value computed
for qualifiedName in such cases, is meaningless. That is
why, such cases must be forbidden. More general, we consider
that rules similar to those applied in programming languages
must be used in modeling language as well.</p>
      <p>The aspects analyzed in this section prove that, even in
simple cases, the specifications must be realized carefully,
not in a superficial manner. The reccomendations made in the
previous section must be taken into acount.</p>
    </sec>
    <sec id="sec-3">
      <title>VI. CONCLUSIONS</title>
      <p>The purpose of this paper has been to propose a change of
attitude with respect to the definition of the UML’s abstract
syntax, expected to positively affect the quality of the standard
specifications. This improvement is a “sine qua non” condition
for attaining the target of model-driven technologies and
paradigms.</p>
      <p>
        Our proposal is argued by means of meaningful examples
taken from the latest UML specification [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. The first
requirement to be accomplished concerns the quality of the
informal specifications: they have to be complete, accurate and
clear. Once this precondition is accomplished, the associated
postcondition is that the formal OCL specifications must
fully conform to their informal equivalents. Our experience
has proved that this conformance is achievable through an
iterative process. The results obtained by evaluating the formal
specifications must be compared to the informal ones and
should trigger a synchronization among the two, if needed.
This is an important contribution through which the OCL
specifications may increase the quality of abstract syntax
definitions, in general.
      </p>
      <p>
        Another important message is that the mere compilability
of formal specifications does not value much if these
specifications are not validated on comprehensive models.
Technical aspects related to the particularities of the specification
language and the support that the formal specification style
brings in achieving compilable models are important as well.
In this respect, we recommend the adoption of a
testingoriented specification style, as introduced in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>Apart from the advice related to the specification style, all
the others have been validated in Software Engineering. That
is why, noticing that so much good specification practice has
not been considered comes as an unpleasant surprise.</p>
      <p>Achieving a good specification of MOF-based languages
is a tedious process, requiring a quality feedback both from
scientists and users. Our intent has been to make a first step,
by proposing a set of “good practices” to be considered in the
process, as well as a number of examples supporting our
proposal. Hoping that our proposals will be analyzed, improved
and extended by the OMG and thus a better abstract syntax
specification will support a more efficient and widespread
usage of modeling languages.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Bauerdick</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gogolla</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gutsche</surname>
          </string-name>
          , F. -
          <source>Detecting OCL Traps in the UML 2.0 Superstructure: An Experience Report</source>
          . - In
          <string-name>
            <surname>Baar</surname>
          </string-name>
          , T.,
          <string-name>
            <surname>Strohmeier</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Moreira</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mellor</surname>
          </string-name>
          , S.J., eds.:
          <article-title>UML 2004 - The Unified Modelling Language</article-title>
          . Volume
          <volume>3273</volume>
          of Lecture Notes in Computer Science., Springer Berlin / Heidelberg (
          <year>2004</year>
          ) pp.
          <fpage>188</fpage>
          -
          <lpage>196</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Fabian</given-names>
            <surname>Bttner</surname>
          </string-name>
          and Martin Gogolla - On
          <source>Generalization and Overriding in UML 2</source>
          .0 -
          <string-name>
            <surname>in</surname>
            <given-names>UML</given-names>
          </string-name>
          '
          <year>2004</year>
          <article-title>Modeling Languages and Applications</article-title>
          .
          <source>UML'2004 Satellite Activities</source>
          , Springer 2004
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Chiorean</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carcu</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pasca</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Botiza</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chiorean</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Moldovan</surname>
          </string-name>
          , S. - UML Model Checking in Studia Informatica vol XLVII (
          <year>2002</year>
          ) pp.
          <fpage>71</fpage>
          -
          <lpage>88</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>D.</given-names>
            <surname>Chiorean</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A</given-names>
            <surname>Carcu</surname>
          </string-name>
          ,
          <string-name>
            <surname>C Botiza</surname>
          </string-name>
          , etc.
          <source>Ensuring UML models consistency using the OCL environment - Electronic Notes in Theoretical Computer Science - ENTCS/102</source>
          ,
          <year>2004</year>
          , pag.
          <fpage>99</fpage>
          -
          <lpage>110</lpage>
          , http://dx.doi.org/10.1016/j.entcs.
          <year>2003</year>
          .
          <volume>09</volume>
          .005
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.</given-names>
            <surname>Chiorean</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Petrascu</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Ober.</surname>
          </string-name>
          <article-title>Testing-Oriented Improvements of OCL Specification Patterns</article-title>
          .
          <source>In Proceedings of the 2010 IEEE International Conference on Automation, Quality and Testing, Robotics - AQTR</source>
          . Volume II, pp.
          <fpage>143</fpage>
          -
          <lpage>148</lpage>
          . IEEE Computer Society, 2010
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>D.</given-names>
            <surname>Chiorean</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Petrascu</surname>
          </string-name>
          .
          <article-title>Towards a Conceptual Framework Supporting Model Compilability</article-title>
          .
          <source>In Proceedings of the Workshop on OCL and Textual Modelling (OCL</source>
          <year>2010</year>
          ). Volume
          <volume>36</volume>
          (
          <year>2010</year>
          ), ECEASST
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Alexander</given-names>
            <surname>Egyed</surname>
          </string-name>
          ,
          <article-title>Automatically Detecting and Tracking Inconsistencies in Software Design Models</article-title>
          ,
          <source>In IEEE Transactions on Software Engineering</source>
          , vol.
          <volume>37</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>188</fpage>
          -
          <lpage>204</lpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J. M.</given-names>
            <surname>Fuentes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Quintana</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Llorens</surname>
          </string-name>
          , G. Genova,
          <string-name>
            <given-names>R. Prieto</given-names>
            <surname>Diaz</surname>
          </string-name>
          .
          <article-title>Errors in the UML metamodel</article-title>
          ?
          <source>ACM SIGSOFT Software Engineering Notes</source>
          <volume>28</volume>
          (
          <issue>6</issue>
          ):
          <fpage>3</fpage>
          -
          <lpage>3</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Hugues</given-names>
            <surname>Malgouyres</surname>
          </string-name>
          ,
          <string-name>
            <surname>Jean-Pierre</surname>
          </string-name>
          Seuma-Vidal, Gilles Motet,
          <source>Regles de coherence UML 2.0 - Version 1</source>
          .
          <fpage>1</fpage>
          - INSA - Toulouse, online at: http: //www.lesia.insa-toulouse.fr/UML/CoherenceUML v1 1
          <fpage>100605</fpage>
          .pdf
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Michael</given-names>
            <surname>Moors - Consistency Checking</surname>
          </string-name>
          ; Rose Architect, Spring Issue,
          <year>April 2000</year>
          , http://www.therationaledge.com/rosearchitect/mag/index.html
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>Object</given-names>
            <surname>Management Group (OMG) - OMG Unified Modeling</surname>
          </string-name>
          <article-title>Language (OMG UML) Version 2</article-title>
          .5,
          <year>2015</year>
          , http://www.omg.org/spec/UML/2.5/PDF
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>Object</given-names>
            <surname>Management Group (OMG</surname>
          </string-name>
          )
          <article-title>- Object Constraint Language version 2</article-title>
          .4 - formal/2014-02-03, http://www.omg.org/spec/OCL/2.4
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>M.</given-names>
            <surname>Richters</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gogolla</surname>
          </string-name>
          .
          <article-title>Validating UML models and OCL constraints</article-title>
          . In Evans et al. (eds.),
          <source>UML 2000 The Unified Modeling Language. Advancing the Standard: Third International Conference Proceedings. Lecture Notes in Computer Science</source>
          <year>1939</year>
          , pp.
          <fpage>265</fpage>
          -
          <lpage>277</lpage>
          . Springer,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>Claas</given-names>
            <surname>Wilke</surname>
          </string-name>
          and
          <article-title>Birgit Demuth - UML is still inconsistent! How to improve OCL Constraints in the UML 2.3 Superstructure -</article-title>
          paper proposed at: OCL 2011 Workshop
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>