<!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>The Analysis of UML State Machine Formal Checkitrg M e t h o d s</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Gundars Alksnis</string-name>
          <email>galksnis@cs</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dcpartrnerrt of Applied Cornputer Science, Riga Techrrical University</institution>
          ,
          <addr-line>Mcza icla 1/3, Riga, LV-1048</addr-line>
          ,
          <country country="LV">Latvia</country>
        </aff>
      </contrib-group>
      <fpage>131</fpage>
      <lpage>136</lpage>
      <abstract>
        <p>Thc purposc of this paper is to discuss currcnt trends of such UML statc mactrine model chccking rnethods, where model checkirrg is perforrrred by translation into formal notations. Formal methods have shown their advantages for functional requircments' inconsistency checking and their climirration at early stages of development and for cnrichirrg graphical notations to reveal vaguerress and inaccuracics as discussed in this paper.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        UML state rnachines, rnodel checking, forrnal notations and
The design of system models and their modeling is widely used practice at the
early stages of software devclopment life cycle. Models provide better
understanding of proposed system and allow making correct decisions concerning the
implcmentation. For such purposes, thc diagrams, which are bascd on some
graphical notations, are uscd most common. To enablc communication bctween
developers, model diagrams have particular (standardizcd) underlying
graphicai nol,al,ions.Among srtch graphical notalions is Unified Modeling Language
(UML) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Additionally, thc model driven dcvelopment approach has becn put
forward to cnable crcation, validation and transfer of syntactically and
semantically completc models, such that the source code generation can be automated
and hidden from devclopers, thus, promoting modcls as thc main artifact of
software development.
      </p>
      <p>Howcvcr, currently availablc tools arc mostly immature in a sense,that
generated code rnust be ma,nuallyrefined to irnplernent algorithms and systenr
behavior conccived by the devcloper. The most essential barrier to implement model
driven devclopment vision is incomplete syntax and semantics of such graphical
tcchnologies, which can yield to inconsistent interpretations evcn at thc initial
stagcs of system dcsign.</p>
      <p>Eveu crtrrent UML 2.0 specification allows semanticallv incompletc model
specifications for use in scena,rio"UML-As-Sketch", and trends show that this
situation will remain such also in the future. This means, that UML models can
and will be designed both formally and informally. The only requiremcnt is that
formal UML semantics must bc a subset of thc full UML semantics.</p>
      <p>On the other hand, therc are tools, which provide automated code generation
(usually only framework) directly from UML models, and vice versa. However,
code gencratcd in this nanner, either rnust be nranually rcfined with algorithms
that UML modeling tools cannot expresscxplicitly or the generated code is not
sufficientlv effective fbr production.</p>
      <p>Ncverthcless, to rlrakc confidence about correctuess of clcsigncclrnoclel and
gencrated codc (even partial), thcre must be done additional checks,which arc
in higher abstraction lcvels than codc in high level programming languages.
Namely, model checking must be carricd out, to check whether particular model
is semantically completc and self-consistent. Such chccks, for example, can be
done with the help of formal mcthods. Wherewith, therc is a need for translation
of gra,phicalnotations into some forrnal specification notation, which after.walds
is analyzcd and executcd in the appropriate tools.</p>
      <p>This is evcn more important for system's dynamic or behaui,oralmod,elqwhen
developer needsassurance,that the model exprcssesproposed system's bchavior
appropriatcly. For such cases,therc arc devclopcd methods and their supporting
tools, thc brief survey and analysis of which is discussedin this paper.</p>
      <p>The paper discussescurrcnt trcnds of such UML state machine model
checking mcthods, whcre modcls arc translated into formal notations. The
comparative analysis of four such formal model checking methods is given. Finally, thc
paper concludcs with thc outline of current possibilities for formal model
chccking of UML state machine models with the help of formal methods.</p>
    </sec>
    <sec id="sec-2">
      <title>Motivation</title>
      <p>Formal model checking has proved to have a number of benefits, which gives
detailcd vicw about the systcm bcing implcmented at thc stagesof systcm analysis
and design. For example, modcl checking allows to:
o validate behavior at the initial stages of system's design;
o Reveal and eliminate functional requrements errors before implementation;
o Obtain (automatically generate) formally "executable" model specification
(i.e. systcm's prototypc);
o Validate consisl,encvand complel,enessof model specificat,ion,and more.</p>
      <p>To make model checking effect,iveand automated, model formal synt,ax and
serna'trticsmust be defined. Otherwise, rnodel carr be viewed only as a, sketch,
and inconsistenciesand contradictions must bc validated manually by using
devcloper's knowledge.</p>
      <p>Thc most important thing in modcl checking is that models allow systcm
analysis at high abstraction levcls, where nondeterministic and parallel actions
may take placc. Thus, cxecutable codc generation from the model and checking
of such code may not always give expected results. Developer must not only
analyzecach modcl's node interconnectionswith other nodes, but also. and more</p>
      <p>TheAnalysis of UML StateMachine Formal CheckingMethods I 33
importantly, look at thc model as a whole and evcn in conncction with other
models, where thc same artifact is viewed from differcnt aspects or viewpoints.</p>
      <p>It is especially important in modeling system's behavior. Even if the model
reflects system's bchavior in tirne, usually it is shown in the fbrrn of static
diagram. If such models arc '(cxccuted" before they arc transformed into code, it
is possible l,o reveal some deficiencies,which may show up only in t,hemn-time,
but not in thc compile-time.</p>
      <p>
        The ncxt scction discussesin dctail the possibilities of chccking system's
behavior from UML state machines [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ],which are basedon David Harcl statecharts
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and cxtended with objcct oriented propcrtics.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Comparative Methods</title>
    </sec>
    <sec id="sec-4">
      <title>Analysis of Formal Model Checking</title>
      <p>As the subjcct for comparison and analysis, we chose four formal model checking
methods (approachcs), which providc mcans of translating statc machine models
into formal notations for actual model checking. The mcthods are the following:
a Fernd,ndez-Tovalrewrite logic ;
o Zhao graph transformation ;
O Knapp-Merz Hugo/ RT tool;
a Sekerinski-Ztrob abstract machine notation and B;</p>
      <p>This decision is based solely on a variety of implementation forms. The only
common thing among chosen methods is that they formalize UML state machine
notation by transfbrming models into fbrmal specifications with which fbrmal
modcl chccking is performcd. From the implementation viewpoint, thcsc methods
are complctely independcnt from each other. There are many othcr methods
available, but thc sclection for this rcsearch was bascd on the degree of involvcd
formal mcthods and notations.</p>
      <p>Jos6 Luis Fern6ndez Alem6n and Ambrosio 'foval Alvarez propose UML
metamodel based method, which formalizes UML state machine diagrams in
rewrite logic [ ]. To accomplis]r t]ris, they apply rewrite logic and the
specification language Maudc.</p>
      <p>
        Yu Zhao with colleagues [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] suggcst to perform transformation and chccking
of models in Pctri nets. The motivation for selecting Petri nets formalism is that
it allows comprchensive and automated modcl checking.
      </p>
      <p>
        Alcxander Knapp and Stephan Merz propose model chccking approach bascd
on rclations between different UML diagram types [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Namely, they take into
account connections bctween UML state machine diagrams and UML intcraction
(i.e., collaboration and scquence) diagrams. They have dcveloped lool Hugo/RT,
which allows verifying if two models are consistent.
      </p>
      <p>
        The la-st of the reviewed methods is proposed bv Emil Sekerinski and Rafik
Zurob.In it, thc statechart diagrams are translated into Abstract Machine
Notation (AMN) of B method [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Although they are speaking about statecharts
Method
      </p>
      <p>Fernandez-Toval</p>
      <p>Zhao</p>
      <p>Knapp-Merz
Rewritelogic /</p>
      <p>Maude</p>
      <p>Graph
transformationsand</p>
      <p>Petrinets</p>
      <p>Hugo/RT</p>
      <p>Yes</p>
      <p>Sekerinski</p>
      <p>Zurob
AMN and B
method /iState</p>
      <p>Yes
Underlying
theory / tool
Has support
for static
semantic
Has support
for dynamic
semantic
Model can
be executed
UsesUML
metamodel
Automatic
output of
model
errors</p>
      <p>Can
generate
source code</p>
      <p>Yes
Yes</p>
      <p>No
Only for checking
of static semantics</p>
      <p>Yes
N o
Yes
N o</p>
      <p>Panly
(only for static
semantics)</p>
      <p>Partly
(mustusePetrinet
debugging)</p>
      <p>Partly Partly
Yes (by translatinginto (by translating</p>
      <p>Javacode) into code)
In any tool which Yes Yes
supportsexecution (for demonstration (asfinal product
of Petrinetmodels ouroosesonlv) code)</p>
      <p>Yes</p>
      <p>Partly
(only for static
semantic)</p>
      <p>Yes
(for demonstration
pumosesonly)</p>
      <p>Partly
(only for static
semantic)</p>
      <p>Yes
Yes
in Harel's notation, but taking into account the origins of UML statc machine
diagrarrts,ttreir method can be modified for application to UML state rnachines.</p>
      <p>Summary of reviewed methods is givcn in Table 1. First column lists
comparative propcrties and thc rest of columns contain property values for each
method. Chosen comparison characteristics are based on scmantics (both, static
and dynamic) handling and analysis of model checking results.</p>
      <p>Revicw of the mcthods revealcd, that thc main problem to handle, is the
formalization level of UML state machine operational semantics (mathematical
foundat,ion for inl,erpretation and execution sequence),which is not fully defined
by UML designers. This mcans, that fbnnalization may be different f?orn one
method to another and thus made incompatible, and lead to different
interpretations, espccially in thc aspect of cxccution.</p>
      <p>Possiblc solution to this problem could be thc translation of UML state
machinesirrto hiera,rchicalfinite state autorna,ta,H.owever, it doesnot provide mea,ns
for description of some esscntialUML state machine properties, for cxample,
activitics, input and otttpttt actions, finishing evenl,sand transit,ions,historical and
branching pseudostates,and adaptation of them arc not trivial.</p>
      <p>All reviewed mcthods supports checking of static semantics-thcy can give
answer to whcther modcl is complcte-with cntry, initial state, intermcdiate
states and final state and exit, but cannot give answer whether it is logical.
Checking of dynamic semantics is allowcd in methods with executable formal
specifications.</p>
      <p>TheAnalysis of UML StateMachine Formal Checking Methods</p>
      <p>The purpose of checking of dynamic semantics is to clarify, whether model
clcments are well connected. This is accomplished by selection of appropriate
formal notation,, as in Zhao's method, where formalization in Pctri nets and tool
availability enables morc throughout model checking. Model exccution is
cxploratiort of rnodel state space. Becausc statc space can be infinite, rnodel
execution strategies (espccially for nondeterministic and concurrent states) dctermine
whcther results will bc adcquatc.</p>
      <p>However, all reviewed mcthods havc common characteristic. Namely, they all
are bascd orr UML rnetarnodel, which cnables easerrefineurentsof the method,
when UML state machine metamodel definition change.Additionally, metamodel
inconsistenciesand missing definitions must be corrected.</p>
      <p>Howcver formal or automatcd model checking may be, inevitably, thcrc arc
situations in which decisions must bc made by the model developer.
Nevertheless, his or hcr dccision may largely depend on information about current model
and lurther refinement. Fbr such cases,the tool must output appropriate model
checking results. All reviewed methods output inconsistenciesof model static
semantics, nonethclcss,model behavior correctncssand inconsistency elimination
is solely on developers' compctcnce and intuition.</p>
      <p>Finally, in the context of model driven development, comprehensivc codc
gcneration from the modcl is essentialstep, which gives confidcncc that
transfbrmation is perfbrrned wittr strict rules and that code indeed reflects developed
modcl. Unfortunately, in revicwcd methods this step is still immaturc, if
supportcd at all. The result is whether inefficient from run-time vicwpoint
(KnappMerz's method) or define restrictions against model properties and programming
languagcs (Sekerinski-Zurob's mcthod).
4</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>In this paper wc outlined selection of formal model checking methods, the main
distinction of which is their usc of model translations into formal notations and
fbrmal specification languages particularly, with the aim to utilize advantages
of formal specifications in rccovery of inconsistencies and their eliminations.
The paper outlined main problcms developer must deal with when UML state
machinc diagram model checking is performed.</p>
      <p>The common conclusion is that there are many different methods available,
but none of them covers all aspects of bchavioral model checking-cach has its
own advantages and disadvantages. Howcvcr, the most notable shortcoming is
that current UML specification is not fully formalized, which, in turn, makes
method creators do their own formalization, which may differ from othcr
formalization approaches,though slightly.</p>
      <p>This topic is also important in the context of model driven development,
whcre models are supposed to be the main artifact of system's dcsign. In fact,
the more elaborated tools developers will havc the more high-level abstraction
chccks they will be able to perform, thc more precise models will be developed
and generated code will be more effective.</p>
      <p>
        This research was conducted as part of ongoing research for implementation
of framework for Modcl Driven Architecture extension with formal methods [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
In this UML metamodel based fiamework the fbrmal specification languages
are used lbr Platlbrm Independent IVIodeltransfbrmations and refinements into
Piatforrn Specific Models.
      </p>
      <p>The common conclusion is that the modcl checking still is mainly guided
by thc developer, and for automatically generated code to be fully optimized
for particular modcl, therc is the nccd for further rescarch. In addition, formal
methods are subject to critique for their large learning curve and missing effective
tool support; howevcr, formal methods applications has proved as advantageous
in functional requirement inconsistency checking and their elimination at early
stages of system's devclopment, and for cnriching graphical notations to revcal
vagucness and inaccuracies, as was discussed in this paper.</p>
      <p>Thi,s work has been partlg supported by the European Soci,al Fund w,ithi,n the
Nati,onal Programme "Support for the carry'ing out doctoral studg program's and
post-doctoral researches"project "Support for the deuelopment of doctoral studi,es
at Ri,ga Techni,cal Un'iuers,itg".</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>1. OMG: Unified Modeli,ng Language. //Internet: http: I lwww.urnl.org/</mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Darr</given-names>
            <surname>Pilone</surname>
          </string-name>
          , Neil Pitman:
          <article-title>UML 2.0 i,n u, Nutshell. A Desktop Quick Refere,nce.</article-title>
          <string-name>
            <surname>O'Reilly Mcdia</surname>
            ,
            <given-names>Inc.</given-names>
          </string-name>
          , USA, California,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. David Harel:
          <article-title>on visual Formal'isms</article-title>
          .
          <source>Communicatiorrs of thc ACM</source>
          , volume
          <volume>31</volume>
          , number 5, May
          <year>1988</year>
          , pp.
          <fpage>514</fpage>
          -
          <lpage>b30</lpage>
          . f flnternet: http: / /doi.acm.
          <source>org/ 10.1145I 4241I</source>
          .
          <fpage>42414</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Jos6</given-names>
            <surname>Luis</surname>
          </string-name>
          <string-name>
            <surname>Fern6ndez</surname>
          </string-name>
          , Ambrosio Toval:
          <article-title>Can Intuition Become Rigorous? Foundations for UML Model Verification Tools</article-title>
          .
          <source>Proceedings of thc l1th International Symposium on Software Rcliability Enginccring (ISSRE</source>
          <year>2000</year>
          ), IEEE Press,
          <year>2000</year>
          , p p .
          <volume>3 4 4 3 5 5 .</volume>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Yu</given-names>
            <surname>Zhao</surname>
          </string-name>
          et al.:
          <article-title>Towards Formal Verification of UML D'iagrams Based on Graph Transfortnati,on</article-title>
          .
          <source>Proceedings of thc E-Commerce Technology For Dynamic EBusiness Intcrnational Confcrence, Volurnc</source>
          <volume>00</volume>
          , IEEE Computer Socicty, Washirrgton, DC, usA,
          <year>2004</year>
          , pp.
          <fpage>180</fpage>
          <lpage>187</lpage>
          . f frnternct: http://dx.doi.org/10.1109/cECEAST.
          <year>2004</year>
          .70
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Alcxandcr</given-names>
            <surname>Knapp</surname>
          </string-name>
          , Stephan Merz:
          <article-title>Model checki.ng and code generati,ort for \JML state rnachi'nes and collaborations</article-title>
          . D.
          <string-name>
            <surname>Hancberg</surname>
          </string-name>
          , G. Schellhorn, and W. Reif, editclrs, 5th Worl&lt;
          <article-title>shop on Tools for Systern Desigrr and Verification</article-title>
          ,
          <source>Technical Report 2002-17</source>
          ,Institut fur Informatik, Universitat Augsburg,
          <year>2002</year>
          , pp.
          <fpage>bg</fpage>
          -
          <lpage>64</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Errtil</given-names>
            <surname>Sekerirrski</surname>
          </string-name>
          , Rafik Zurob: Tfanslati,ng statecharts to B.
          <string-name>
            <surname>M. J. Butler</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <string-name>
            <surname>Petrc</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          K. Sere, editors,
          <source>3rd International Confercnce on Integrated Formal Methods (IFM)</source>
          ,
          <source>Lecturc Notes in cornputer science</source>
          , springer-verlag,
          <year>May 2002</year>
          , pp.
          <fpage>r28</fpage>
          -
          <lpage>144</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Gurrdars</given-names>
            <surname>Alksnis</surname>
          </string-name>
          :
          <article-title>Forrnal Methods and Model Transfo,rrrtation Framework for MDA</article-title>
          .
          <source>Proceedings of the 1st Intcrnational Workshop on Formal Models (WFM'06)</source>
          , Dusan Kolar arrd Alcxandcr Meduna (Eds.),
          <source>Ostrava: MARQ</source>
          ,
          <year>2006</year>
          , pp.
          <fpage>87</fpage>
          <lpage>97</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>