<!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>Verification of Good Design Style of UML Models</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Bogumiła Hnatkowska</string-name>
          <email>Bogumila.Hnatkowska@pwr.wroc.pl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Applied Informatics, Wrocław University of Technology</institution>
          ,
          <addr-line>Wybrzeże Wyspiańskiego 27, 50-370 Wrocław</addr-line>
          ,
          <country country="PL">Poland</country>
        </aff>
      </contrib-group>
      <fpage>83</fpage>
      <lpage>90</lpage>
      <abstract>
        <p>Software architecture, and its behavior can be expressed as UML models. Models of complex systems can be also complex and hard to read they may consists of hundreds of artifacts. Analysis of such complicated models is very difficult. Applying design guidelines make this process easier. Design guidelines consist of some rules, and constraints that should be applied during models construction. They increase readability of models, and in consequence assure higher quality of the final product. The paper presents Model Verificator - the tool for checking UML models against a given design standard. The tool works as a plug-in to Rational Rose. The guidelines take the form of XML file compliant with some DTD. Verification is done fully automatically. The tool also enables correction of checked models.</p>
      </abstract>
      <kwd-group>
        <kwd>UML models</kwd>
        <kwd>verification</kwd>
        <kwd>design guidelines</kwd>
        <kwd>good style</kwd>
        <kwd>quality assurance</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>Software development process results with many kind of artifacts. Beside a source
code, system models are the most important artifacts built during system construction.
UML is the most popular modeling language today, and UML models are used for
presenting structure and behavior of the software product.</p>
      <p>
        Models of a complex system can be also complex and hard to read – they may
consists of hundreds of model elements. Model quality may be improved by applying
different standards. Standardized documents characterize similar appearance and
structure. Therefore they are more readable and understandable. The rules and
constraints, associated with “document style”, which should be applied by software
engineers during model construction are usually gathered in design guidelines document
also called design standard. The positive impact of using modeling conventions is
obvious and was experimentally proven, e.g. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>
        Verification of a system model against a given design standard can be done in two
ways: manually or automatically. Usually it is done manually using techniques like
audits, walkthroughs or inspections. The paper presents an idea of automatic
verification of UML model(s) against design style guidelines. The idea was proven by
implementing Model Verificator tool [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Model Verificator works as a plug-in to
Rational Rose and checks models built within it. The usability of the tool was checked
during Software System Design courses at Wrocław University of Technology.
      </p>
      <p>
        The author found only one tool for automatic evaluation of modeling rules and
design guidelines [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. This tool uses the OCL for expressing modeling rules. The
OCL is used in many tools, e.g. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], for checking inter and intra-consistency of
UML models. As the solutions usual are opened, OCL could be also used in them for
formulating constraints for modeling style. Rational Rose does not support the OCL
directly. Existing Oclarity plug-in for Rose is commercial. So a person, who wants to
use the OCL for checking the design style of UML models prepared in Rational Rose,
needs to export the model to xml format (using e.g. Unisys plug-in) and then to and
check such model in an OCL tool.
      </p>
      <p>The role of design style guidelines is explained in Section 2. Section 3 presents
assumptions about verification tool and the tool itself. Results of usability testing of
Model Verificator are shown in Section 4. Some concluding remarks are gathered in
Section 5.</p>
    </sec>
    <sec id="sec-2">
      <title>2 Design Style Guidelines</title>
      <p>
        Style guidelines are used in many areas of software engineering, e.g. human interface
design (human interface guidelines) or coding (programming style). Programming
style (coding standards, coding conventions) is defined as a set of ”conventions for
writing source code in certain programming language” [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. These conventions have
a form of very practical hints that tell programmers how to code some elements of the
program or what programming techniques to use. An example of such a popular
coding style is the document ”Java Coding Conventions” [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], available free from the
Internet. Human interface guidelines are used to provide a consistent look and feel.
They embody good practices in interface design and increase the consistency between
screens [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>
        RUP methodology recommends to prepare project-specific guidelines [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Design
guidelines are listed among the others (e.g. programming guidelines, or test
guidelines). Project specific guidelines provide prescriptive guidance on how to perform a
certain activity or a set of activities in the context of the project. Project specific
guidelines are appropriate whenever there are project-specific standards that must be
followed, or good practices that need to be communicated [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>Within the paper the understanding of design guidelines is limited to the second
meaning (standards or good practices that need to be followed and communicated).
Design style guidelines play the same role as other kind of guidelines, but they focus
other issues. They do not concern the source code, or user interface, but artifacts like
specifications, models, etc.</p>
      <p>Design style guidelines usually take a form of paper documents written in informal
language. In such case the verification if an artifact fulfil the rules, included in design
guidelines, must be done manually.</p>
      <p>
        Design guidelines can be also used for templates. A template is defined as a
predefined structure for an artifact [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Within Rational Rose there are many predefined
system model templates, prepared for a given technology (e.g. J2EE, VB6) or
methodology (e.g. RUP). An exemplary system model created with RUP template is
presented in Fig. 1. This model template defines the introductory model structure. The
structure is divided into views and models, defined in RUP. There are 5 views and 6
models. There are some exemplary elements placed in different packages of model
structure. The elements are commented with notes explaining their role.
      </p>
      <p>The author's experiences show that templates are helpful, but not sufficient to
preserve the uniform model structure. The template doesn’t ensure the model as a
whole is complete, their elements, e.g. models, are built according to the used
methodology and called according to accepted naming convention. That was the rationale
for elaborating the tool that was able to automatically check the models against some,
user defined, modeling rules.
Model Verificator tool analyses Rational Rose models. The analysis is done in order
to check the conformance of a model to some style guidelines. These guidelines are
described as a set of rules written in a text file. Rules are written in a special language,
presented in subsection 3.3.</p>
      <p>
        The important feature of the solution is the ability of creating own style guidelines,
suited for a given purpose. This concept follows the idea of Codespector tool [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
Codespector aims to verify java source code against a certain coding standard,
expressed with a specially designed CLR language.
      </p>
      <p>The verification tool should be user friendly. The usage of the tool should be as
easy as possible, and should not require knowledge about additional languages or
technologies. Therefore the tool works as a plug-in to Rational Rose. Decision is more
legitimate as the tool verificates models built within Rational Rose.</p>
      <sec id="sec-2-1">
        <title>3.2 Verification Scope</title>
        <p>The language, used for expressing modeling rules should be flexible enough:
- to set a naming convention for particular model elements,
- to set a proper structure of a model,
- to define right places for particular model elements,
- to define stereotypes that may be used in different places within model
structure,
- to define allowed types of used diagrams,
- to define allowed multiplicity for particular model elements, e.g. at least one
class diagram.</p>
        <p>These requirements were formulated after analyzing of students’ projects and
catching on the most often appearing mistakes. They were defined from the point of
view of a person who has to read, understand and check many models prepared by
different design teams. In such situation the things like colors and shapes are of minor
importance. The most important is to find elements of the same type in the same
places in different models.</p>
        <p>Model structure is strictly defined by RUP template. Different model elements
should be carefully placed within the system model structure. This treats both to
individual elements of UML language (e.g. system actors should be placed in
Usecase model/Actors package), and UML diagrams (e.g. each use-case realization
should be described by class and sequence diagrams).</p>
        <p>Some modeling rules, written informally, which the author would like to express in
the language, are presented below. All rules concern the contents of Analysis Model,
defined by RUP.</p>
        <p>Rule 1. The analysis model should contain two class diagrams, first named
"Architecture Overview – Packages”, and second named "Key Abstractions".
Rule 2. The analysis model could be divided into packages (zero or more).
Rule 4. Each package could contain either use-case realization or analysis classes,
and class diagrams.</p>
        <p>Rule 5. Use-case realizations could contain only class diagrams (zero or more),
sequence diagrams (zero or more), and at least one class diagram which name begins
with Traces.</p>
        <p>Rule 6. Analysis class should
&lt;&lt;boundary&gt;&gt;, &lt;&lt;entity&gt;&gt;.</p>
        <p>have one of stereotypes:
&lt;&lt;control&gt;&gt;,
Rule 7. The names’ of class diagrams that are used to show traces from previous
models, should begin with Traces.
Rule 8. The class diagrams showing the traces are allowed in: the root of Analysis
Model, and use-case realizations.</p>
      </sec>
      <sec id="sec-2-2">
        <title>3.3 Rules Language Definition</title>
        <p>The guidelines contain a set of rules stored in a text file. These guidelines have a form
of Extensible Markup Language (XML) while rules definition language has the form
of Document Type Definition (DTD). DTD constrains the proper structure of XML
file. A part of DTD is shown on Listing 1.</p>
        <p>
          Listing 1. A part of guidelines language definition, [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ].
        </p>
        <p>&lt;!ELEMENT Guide (Model+)&gt;
&lt;!ELEMENT Model (Package| Any)&gt;
&lt;!ELEMENT Package ((Package| Class| UseCase| Diagram|</p>
        <p>Component| Node)*| Any)&gt;
&lt;!ELEMENT Class ((Class| Diagram)*| Any)&gt;
&lt;!ELEMENT UseCase (Diagram)*&gt;
&lt;!ELEMENT Diagram EMPTY&gt;
…
&lt;!ATTLIST Model name CDATA #IMPLIED&gt;
&lt;!ATTLIST Package name CDATA "*" stereotype CDATA #IMPLIED count
CDATA "1"&gt;
&lt;!ATTLIST Diagram
type ( ActD| ClaD| ColD| ComD| DepD| SeqD| StaD| UseD)
#REQUIRED name CDATA "*" count CDATA "1"&gt;
…</p>
        <p>Diagram is the only obligatory model element. There are eight diagrams
enumerated (all that may be constructed within Rational Rose). Other model elements
are optional.</p>
        <p>CDATA was chosen as a domain for most of language elements. The elements
may have some attributes defined, i.e. name, number or stereotype. The name of a
concrete element may contain wildcards, e.g. ‘?’ or ‘*’. The star sign (‘*”) is a default
name for each element. Stereotypes may be defined or may be omitted in guidelines
definition. DTD defines the default multiplicity for any kind of language element, e.g.
it is defined as 1 for a package.</p>
        <p>Exemplary definition of style guidelines is presented on Listing 2.</p>
        <p>Listing 2. Exemplary style guidelines.
&lt;Guide&gt;
&lt;Model name="Use-Case Model"&gt;
&lt;Package name="Use Case View"&gt;
&lt;Package name="Use-Case Model"&gt;
&lt;Package name="Actors"&gt;</p>
        <p>&lt;Class stereotype="Actor" count="1..n"&gt; &lt;/Class&gt;
&lt;/Package&gt;
&lt;Package name="Use Cases"&gt;
&lt;UseCase name="?*UC" count="1..n"&gt; &lt;Any&gt;&lt;/Any&gt;
&lt;/UseCase&gt;
&lt;/Package&gt;
&lt;/Package&gt;
&lt;Diagram type="UseD" name="Main"&gt;&lt;/Diagram&gt;
&lt;/Package&gt;
&lt;/Model&gt;
&lt;/Guide&gt;</p>
        <p>Tag &lt;Guide&gt; is an obligatory start element. Use-Case Model is the only allowed
model within system model. This model should contain two packages (Actors and Use
Cases), and one use-case diagram named Main. Use Case package should contain at
least one actor of any name. Use Cases package should contain at least one use-case,
which name must be conformant to the “?*UC” pattern. A given use case may be
described by any number of elements.</p>
      </sec>
      <sec id="sec-2-3">
        <title>3.4 Tool Usage Example</title>
        <p>As is mention above, Model Verificator was implemented as a plug-in to Rational
Rose. Usage of the tool is very easy. In order to verify a model of a system against
given design guidelines it is enough to chose Execute Verification option from Tools
menu (see Fig. 2) and select a file with style guidelines. The tool automatically checks
conformance of the model with style guidelines.</p>
        <p>Exemplary results of verification of an model, created with RUP template (see Fig.
1), against the guidelines presented on Listing 1 are shown on Fig. 2.</p>
        <p>As it is easy to notice the model lacks with use-cases and has many elements not
defined in the guidelines, e.g. Business Use-Case Model or Logical View.</p>
        <p>As the tool implementation was limited to two Rational Rose views, i.e. Use-Case
View and Logical View some violations of guidelines constraints were not recognized
(Component and Deployment Views are not defined in guidelines).</p>
        <p>There is a possibility to save verification report into a file or to perform some
corrective actions. The correction is quite simple. It removes redundant or adds
lacking elements to the model.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4. Usability Testing of Model Verificator</title>
      <p>Before Model Verificator was implemented, recommendations about the proper
model structure were formulated informally and communicated to students orally
during the course. Students applied these recommendations in different degree.</p>
      <p>In order to check Model Verificator usability, the author has prepared the file with
design guidelines. The design guidelines consist of above 100 rules of different
granularity. For example, all the rules, presented in section 3.2 are included in the
guidelines.</p>
      <p>The students were divided into two groups:
- the base group that applied the tool for verification of models,
- the control group that had prepared models, basing only on informal design
recommendations.</p>
      <p>The base group consisted of 8 teams (8 models to be checked), and the control
group consisted of 4 teams. The author asked the students from base group for
enumerating the most important mistakes, that were found by Model Verificator, and
next corrected by the students. The students reported the following kinds of grievous
errors:
usage of improper diagram within a given context, e.g. the usage of use-case
diagram for presenting the logical structure of the system;
- placement of model elements in wrong places (inconsistent with
methodology), e.g. definition of business actors in Object Business Model or business
workers in Business Use-Case Model;
- lack of required artifacts, e.g. lack of diagrams showing traces relationship to
previous models.</p>
      <p>The students from the base group managed with correction of reported mistakes,
and in result they prepared models that satisfy all rules in design guidelines.</p>
      <p>The models, prepared by students from the control group, were checked by the
author. The errors, reported by the tool were the same kind like those, submitted by
students. The number of reported errors oscillated from dozen to tens. For the worst
model the tool reported above 70 violations (of 7 types) of design rules.</p>
    </sec>
    <sec id="sec-4">
      <title>5. Conclusions</title>
      <p>The paper presents an idea of automatic verification of UML models against design
guidelines. The idea was proven by implementing Model Verificator tool. The tool
works as a plug-in to Rational Rose. The rules of the standard are written in the
special language. The guidelines take the form of XML file compliant with some
DTD. Verification is done fully automatically. The tool also enables correction of
models (deleting existing or introducing needed elements).</p>
      <p>The idea isn’t new – the same concept was the base of many tools checking source
code conformance to a given coding standard. The fact that the Model Verificator
works directly on Rational Rose models and need not their exporting to any other
format is the novelty of the presented solution. The same guidelines may be reused for
many projects. There may exists many guidelines in the same time.</p>
      <p>The tool may be evaluated from two perspectives, i.e. design guidelines users, and
design guidelines developers. The usability of the tool, from the users’ point of view,
was checked and confirmed by students of Wrocław University of Technology. The
students reported the following advantages of the solution:
- better knowledge of used methodology, and produced models;
- increased readability, maintainability, and understandability of the models;
- improved communication between team members.</p>
      <p>The main observed disadvantage is insufficient feedback information about wrong
written elements, reported by the tool.</p>
      <p>The author acted as a design guidelines developer. The language, used for writing
modeling rules is easy and understandable (especially for computer science
specialists). The only drawback is that the language does not offer the possibility for
expression of recursive structure of the model, i.e. when the same rules should be applied
recursive inside the model. In such situation all the rules need to be written once
again. The guidelines documents are rather long, for example that one prepared for
the purpose of the course has 160 lines (almost 7KB).</p>
      <p>As the tool is helpful for its users in creation “well-formed” models its usage will
be obligatory. Implementation of Model Verificator will be extended to include also
Implementation and Deployment Models.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Chiorean</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pasca</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carcu</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Botiza</surname>
          </string-name>
          , Ch.,
          <string-name>
            <surname>Moldovan</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Ensuring UML models consistency using the OCL Environment. 6th International Conference on the Unified Modelling Language - the Language and its applications</article-title>
          . San Francisco. Available at: http://i12www.ira.uka.de/~baar/oclworkshopUml03/papers/06_ensuring_
          <article-title>uml_model_consis tency</article-title>
          .
          <source>pdf</source>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Farkas</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hein</surname>
          </string-name>
          , Ch.,
          <string-name>
            <surname>Ritter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Automatic Evaluation of Modelling Rules and Design Guidelines. The 2nd Worksop - From code centric to model centric software engineering: Practices, Implications and ROI</article-title>
          . Spain. Available at: http://www.esi.es/modelware/ c2m/docum/papers/PAPER2-
          <article-title>ModellingRules-and-</article-title>
          <string-name>
            <surname>Guidelines</surname>
          </string-name>
          .pdf (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Hnatkowska</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Walkowiak</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Consistency checking of USDP models, In: Understanding and usage of dependency relationships</article-title>
          .
          <source>International Workshop Consistency Problems in UML-based Software Development</source>
          , Oficyna Wydawnicza PWroc (
          <year>2004</year>
          )
          <fpage>59</fpage>
          -
          <lpage>70</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Jadach</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hnatkowska</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Codespector - A Tool for Increasing Source Code Quality</article-title>
          . In: Zieliński,
          <string-name>
            <given-names>K.</given-names>
            ,
            <surname>Szmuc</surname>
          </string-name>
          <string-name>
            <surname>T</surname>
          </string-name>
          . (eds):
          <article-title>Software engineering: evolution and emerging technologies</article-title>
          , IOS Press, Vol.
          <volume>130</volume>
          . (
          <year>2005</year>
          )
          <fpage>124</fpage>
          -
          <lpage>134</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Lange</surname>
            ,
            <given-names>Ch.F.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>DuBois</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chaudron</surname>
            ,
            <given-names>M.R.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Demeyer</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Experimentally Investigating the Effectiveness and Effort of Modeling Conventions for the UML</article-title>
          .
          <source>External research report. Technische Universiteit Eindhoven</source>
          . Available at: http://library.tue.nl/csp/dare/ LinkToRepository.csp?recordnumber=
          <volume>610229</volume>
          (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Muskała</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>UML model verification against design style standards, Master Thesis; the work supervised by Bogumila Hnatkowska</article-title>
          , Wroclaw University of Technology (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Rational</given-names>
            <surname>Unified</surname>
          </string-name>
          <string-name>
            <surname>Process</surname>
          </string-name>
          ,
          <source>IMB Corp</source>
          .
          <year>1987</year>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. UsabilityNet:
          <article-title>Tools and methods</article-title>
          . Available at: http://www.usabilitynet.org/tools.htm
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Sun</given-names>
            <surname>Microsystems</surname>
          </string-name>
          , Inc.,
          <article-title>Code Conventions for the Java Programming Language</article-title>
          . Available at http://java.sun.com/docs/codeconv
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>10.The Free Dictionary. Available at: http://encylopedia.thefreedictionary.com</mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>