Fulltext01 PDF
Fulltext01 PDF
Final thesis
Emil Fridell
LIU-IDA/LITH-EX-A—12/031—SE
2012-06-12
Final Thesis
Emil Fridell
LIU-IDA/LITH-EX-A—12/031—SE
2012-06-12
1 Introduction 2
1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Purpose and Objective . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Thesis Overview . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Technologies 5
2.1 UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 ArCon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Rhapsody . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Eclipse and Papyrus . . . . . . . . . . . . . . . . . . . . . . . 7
3 Software Architecture 9
3.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 Drawbacks and Problems Today . . . . . . . . . . . . . . . . 9
3.3 Using UML to Define Architectural Rules . . . . . . . . . . . 11
3.3.1 Building Blocks for Compliance Checking . . . . . . . 12
3.3.2 Rules Translation . . . . . . . . . . . . . . . . . . . . . 14
4 ArCon Extension 18
4.1 Motivation and Requirements . . . . . . . . . . . . . . . . . . 18
4.1.1 Open-Source Tool Support . . . . . . . . . . . . . . . 18
4.1.2 Eclipse and Papyrus . . . . . . . . . . . . . . . . . . . 19
4.2 Implementation Overview . . . . . . . . . . . . . . . . . . . . 20
4.3 XMI Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3.1 Reading the XMI File . . . . . . . . . . . . . . . . . . 21
4.3.2 Translating Tree Nodes . . . . . . . . . . . . . . . . . 22
4.3.3 Translator Design . . . . . . . . . . . . . . . . . . . . 24
4.3.4 Main Translation Loop . . . . . . . . . . . . . . . . . . 25
4.3.5 Connecting References . . . . . . . . . . . . . . . . . . 26
4.4 Eclipse Plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.4.1 Finding Models to Check . . . . . . . . . . . . . . . . 28
4.4.2 Finding ArCon Executable Path . . . . . . . . . . . . 28
CONTENTS
5 User Guide 31
5.1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.1.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . 31
5.1.2 Plugin Interface . . . . . . . . . . . . . . . . . . . . . . 32
5.2 Model Examples . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.2.1 Example1 . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.2.2 Example2 . . . . . . . . . . . . . . . . . . . . . . . . . 35
6 Method Evaluation 36
6.1 Earlier Study . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.2 Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.3 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
vi
List of Figures
6.1 Conditional Rule. Left diagram shows the class hierarchy and
right shows the allowed association paths. . . . . . . . . . . . 39
6.2 Possible syntax for Class Instance reference. . . . . . . . . . . 44
Introduction
This chapter is the introduction to a master thesis project (30 credit points)
final report examined at the Department of Computer and Information Sci-
ence (IDA) at Linköping University. The thesis is the final part of a 5 year
degree leading to a Master of Computer Science and Engineering. The thesis
work has been performed at Combitech AB in Linköping. Combitech AB1
is a software consultancy company with expertise in information security,
systems integration, communications, mechanics, systems security, systems
development and logistics.
1.1 Background
In software development there is often an architectural model defined by
the architect which describes the system in a high level with rules that the
realizing system model must full-fill. ArCon (Architectural Conformance
Checker) is a tool that checks a Unified Modeling Language (UML) model
against defined rules in another UML model. The ArCon tool can be used
to automate the validation between the architectural rules and the system
model. The rules are modelled in a subset of UML where the UML con-
structs have been rendered a different meaning than what is prescribed by
the standard.
ArCon can read out the architectural rules, and then based on these re-
view a system/software-model and identify deviations from the rules. This
can save a large amount of manual review work and also assist in the trans-
fer of architectural knowledge to the developer through the architectural
model and by means of an automatic audit that can be applied more or less
continuously during the work.
1 For more information about Combitech AB, please visit www.combitech.se
1.2. PURPOSE AND OBJECTIVE
1.3 Limitations
Because of the limited time within a thesis project, the main focus was to
support only one Open-Source modeling tool. To make future support for
other modeling tools easier, the solution to support the Open-Source tool
was to be made as generic as possible. The best case scenario was identified
as a solution that enables support for other modeling tools even if that was
not a direct requirement, that would be tested or validated.
3
CHAPTER 1. INTRODUCTION
4
Chapter 2
Technologies
This chapter will present the different technologies applied in this thesis.
The purpose is to give a basic description of the chosen systems and stan-
dards to readers who are not familiar with them. If the reader is already
familiar with a system or standard described in this chapter, then the section
may be skipped entirely.
2.1 UML
This section will give a basic informal description of what Unified Modeling
Language (UML) is, see homepage1 or community forum2 for specific details
and answers.
UML is a standardized general-purpose modeling language in the field
of object-oriented software engineering. The standard is managed, and was
created, by the Object Management Group (OMG). It was first added to the
list of OMG adopted technologies in 1997, and has since become a widely
used and recognized industry standard for modeling software-intensive sys-
tems. [12]
A basic informal overview3 of UML is: ,,The Unified Modeling Lan-
guage (UML) is used to specify, visualize, modify, construct and document
the artifacts of an object-oriented software-intensive system under devel-
opment. UML offers a standard way to visualize a system’s architectural
blueprints, including elements such as: activities, actors, business processes,
database schemas, (logical) components, programming language, statements
and reusable software components.
UML combines techniques from data modeling (entity relationship di-
agrams), business modeling (work flows), object modeling, and component
1 http://www.uml.org/, April 2012
2 http://www.uml-forum.com/FAQ.htm, April 2012
3 http://en.wikipedia.org/wiki/Unified Modeling Language, April 2012
CHAPTER 2. TECHNOLOGIES
modeling. It can be used with all processes, throughout the software develop-
ment life cycle, and across different implementation technologies. UML has
synthesized the notations of the Booch method, the Object-modeling tech-
nique (OMT) and Object-oriented software engineering (OOSE) by fusing
them into a single, common and widely usable modeling language. UML
aims to be a standard modeling language which can model concurrent and
distributed systems. UML is a de facto industry standard, and is evolving
under the auspices of the Object Management Group (OMG).
UML models may be automatically transformed to other representations
(e.g. Java) by means of QVT-like transformation languages. UML is exten-
sible, with two mechanisms for customization: profiles and stereotypes.” An
example of an UML class diagram can be seen in Figure2.1.
2.2 ArCon
This section will explain what ArCon (Architecture Conformance Checker)
is.
It was first developed by Anders Mattsson at Combitech AB to be used
as proof of concept for their proposed approach to model architectural design
rules and check the conformance of these rules against a system realization
model (called system model) with tools. ArCon is the tool, designed to be
used, to automate the validation between the architectural rules and the
system model. The rules are modelled in a subset of UML where the UML
constructs have been rendered a different meaning than what is prescribed by
the standard. (More information about ArCon’s architectural rules syntax
is provided later in 3.3.2 on page 14)
ArCon can read out the architectural rules, and then based on these
review a system/software-model and identify deviations from the rules, and
report these deviations. The idea is that it can save a large amount of manual
review work and also assisting in the transfer of architectural knowledge to
the developer through the architectural model and by means of automatic
audit that can be applied more or less continuously during the work.
The first version of ArCon could read and check UML models only from
6
2.3. RHAPSODY
projects defined in the Rational Rhapsody modeling tool (see Section 2.3 on
page 7 for more info about Rhapsody).
ArCon is an Open-Source project which is available, at the time of writ-
ing, at http://code.google.com/a/eclipselabs.org/p/arcon/4 .
2.3 Rhapsody
Rational Rhapsody, also referred as Rhapsody in this report, is known as
IBM Rational Rhapsody after it became an IBM Rational product follow-
ing the acquisition of Telelogic AB in 2008. Rhapsody5 , a modeling envi-
ronment based on UML, is a visual development environment for systems
engineers and software developers creating real-time or embedded systems
and software. Rational Rhapsody uses graphical models to generate soft-
ware applications in various languages including C, C++, Ada, Java and
C#.
Rational Rhapsody aims to help diverse teams collaborate to under-
stand and elaborate requirements, abstract complexity visually using in-
dustry standard languages (UML, SysML, AUTOSAR, DoDAF, MODAF,
UPDM), validate functionality early in development, and automate delivery
of high quality products.
7
CHAPTER 2. TECHNOLOGIES
MBD and MDSD tools. It also offers a very advanced support of UML
profiles that enables users to define editors for DSLs based on the UML 2
standard and its extension mechanisms. The main feature of Papyrus re-
garding this latter point is a set of very powerful customization mechanisms
which can be leveraged to create user-defined Papyrus perspectives and give
it the same look and feel as a native DSL editor.
8
Chapter 3
Software Architecture
This chapter will explain why software architecture and specially architec-
ture rules are used today, why this is a topic that is of interest for this thesis
and lastly how the proposed method to define architectural design rules,
which ArCon checks, is designed.
3.1 Motivation
Software Architecture allows for early assessment of and design for quality
attributes of a software system, and it plays a critical role in current software
development [13]. A primary role of the architecture is to capture the archi-
tectural design decisions [5], and its derived design rules. In many projects
within Model-Driven Development (MDD), UML models are the first arte-
facts to systematically represent a software architecture [7]. One of these
important artefacts of the software architecture is the architecture rules.
In this report, the meaning of architectural design rules is rules (including
constraints), defined by the architect, to be followed in the detailed design
of a system. The architectural design rules are typically an abstraction of
the software design with no or very little detail specification on the imple-
mented system [10]. To make sure the system follows the design decisions
and rules, verification and validation of the rules against the implemented
system model becomes important.
10
3.3. USING UML TO DEFINE ARCHITECTURAL RULES
The thoughts behind this also validate the other researchers request to be
able to define, edit and validate the architecture rules in an easy way. It
has also been said that the architecture of a software system is a critical
artefact in the software life-cycle and should be evaluated as early as possible
[8, 4]. The architecture should also be checked continuously during the
development to ensure the system follows the architectural design at all
important milestones. Given the methods currently available and the related
issues, while architecture is recognized as important, the authors were led
to believe that better tools to define, manage and verify the architectural
rules are needed.
• Similarity
Both the architecture rules and the system implementation can be
modelled using UML. This allows both models to be modelled using
the same tools that both the architect and developers are familiar with.
• Rule Validation
Tools can validate and check the architecture rules which reduce the
eruptions and enhance the quality of the design. Changing the model
becomes easier and less expensive because less time is needed to check
and validate the new design and rules.
11
CHAPTER 3. SOFTWARE ARCHITECTURE
that would have been needed to make sure the rules and the imple-
mented system maintain consistent.
Artefacts All four blocks can be seen as artefacts within the proposed
solution, where the fourth artefact is ArCon itself and its regulations. The
other three artefacts are divided into two main artefacts and one sub-
artefact. The main artefacts are the architectural rules model and the
system model. The architectural rules model defines the rules which the
system model must follow. This architectural model is defined in UML
using a different syntax than the standard, later described in Section 3.3.2.
The system model is the software’s realization, and it is also defined in UML
but it follows the standard UML specification. Following the standard is a
12
3.3. USING UML TO DEFINE ARCHITECTURAL RULES
13
CHAPTER 3. SOFTWARE ARCHITECTURE
14
Table 1. Definition of transformations between constructs in the architectural rules
model and constraints on stereotypes in the system model
Transformation Example
Architectural rules model System model stereotypes
T1: A class named C1 with the
stereotype M1 is transformed into a <<Package>> UML::Package
stereotype named C1 extending the Sensor_Pkg
meta-class M1 unless
transformation number T3 below UML::Class
applies. If M1 is undefined then
“Class” is assumed Sensor
<<stereotype>>
Sensor_Pkg
<<stereotype>>
Sensor
ArCon Extension
This chapter explains the thoughts and process of the work to extend ArCon
with support for Open-Source modeling tools.
19
CHAPTER 4. ARCON EXTENSION
ArCon from within Eclipse. The plugin’s main purpose is to allow the user
to launch the ArCon executable from the Eclipse editor, with the desired
models and visualize the results. The ArCon executable has no knowledge
about the plugin, which is required to prevent coupling to specific tools.
Its only communication is handled through the standard input and output
channels, and the plugin serves as the adapter to connect to these channels.
The main idea is that other modeling tools should be able to connect to
ArCon, with minimal effort, in the same way.
20
4.3. XMI IMPORT
Language (XML). It can be used for any metadata whose metamodel can be
expressed in Meta-Object Facility (MOF). The most common use of XMI is
as an interchange format for UML models, although it can also be used for
serialization of models of other languages (metamodels).
The main argument for using XMI as import functionality is that XMI
is an international standard, ISO/IEC 19503:2005 Information technology -
XML Metadata Interchange (XMI). Using a standard that is independent on
the modeling tool avoids the problem where ArCon is too tightly connected
to the tool it checks the models for. This was the main problem for the
first version of ArCon where it could only read models by connecting to
the Rhapsody API. Since XMI is a known standard, other modeling tools
can use the extended ArCon as long as they support the XMI standard.
With a complete XMI import function, any UML model that is exported to
XMI standard format can be read by ArCon. Then, to get fully integrated
support, the other modeling tools need only to integrate the call to launch
ArCon and read its result. In Papyrus case, this would be the plugin for the
Eclipse IDE.
3. Boost library was already used within the ArCon project, and thus no
extra dependencies are needed unlike using another XML parser tool.
Boost reads the XMI file and translate it into a tree structure where the
nodes contain the XML tags and values according to the schema4 , summa-
rized below.
3 http://www.boost.org/, April 2012
4 http://www.boost.org/doc/libs/1 47 0/doc/html/boost propertytree/parsers.html
#boost propertytree.parsers.xml parser, April 2012
21
CHAPTER 4. ARCON EXTENSION
22
4.3. XMI IMPORT
Given a current translator that does not know how to translate a node,
which in this case is a BaseNode, then the call stack will go all the way
down to the visitor manager. In Figure 4.2 the call chains can be visualized
by following the inheritance and association down to the Visitor Manager.
5 see UML specification for the specification of packedElements
23
CHAPTER 4. ARCON EXTENSION
The visitor manager will then recognize the BaseNode and change the active
translator and delegate the translation of the BaseNode to another translator
which can translate it. If no such translator can be found a ‘No Translation’
error is reported instead.
• BaseTranslator
BaseTranslator is the main translator, also called visitor manager or
translator manager, and is responsible for translating the entire tree.
There exists only one BaseTranslator and all SubTranslators are con-
nected to the BaseTranslator. BaseTranslator is a translator man-
ager which only delegates work to its SubTranslators by recognizing
BaseNodes and letting the responsible SubTranslator do the actual
translation.
• SubTranslator
Each SubTranslator is responsible for the translation of one specific
class of ArCon’s meta model classes. The SubTranslators can inherit
from another SubTranslator in the same way as the meta model classes
inherit from each other. The inheritance enables the SubTranslators to
ask their baseClass for translation if the node contains values, defined
by the baseClass of the meta model class, that the SubTranslator is
responsible for translating. This call stack can go all the way back to
the BaseTranslator if no baseClass can translate the given node. The
BaseTranslator can then see if the node is another element owned by
above element, typically packedElement, and then delegate the trans-
lation to another SubTranslator, which is responsible for translating
that particularly element.
• ITranslator
Interface shared by all translators. Defines some basic function calls
that all translators need to supply.
• IBaseTranslator
Interface for BaseTranslator which contains function calls that only
the visitor manager should implement.
• ISubTranslator
Interface for SubTranslators which contains some code for connecting
to a BaseTranslator in a proper way. All new visitors should have
ISubTranslator as one of its inherited classes.
24
4.3. XMI IMPORT
Figure 4.3: An overview of the translator interface layout, and the classes
implementing them. Classes denoted with “I” at the beginning are inter-
faces.
• SubTranslator template
Template class that has some comfort methods to create new Sub-
Translators.
25
CHAPTER 4. ARCON EXTENSION
17. ...
18. }
19. }
26
4.4. ECLIPSE PLUGIN
• Find out which two models the user actually wants to check confor-
mance on when launching ArCon using the plugin. The main problem
being that only one model is visible in the editor so how can the other,
related, model be found without having to ask the user every time.
• The plugin only works as a front end for the ArCon executable and
thereby it should be easy to update the plugin with new updates for
ArCon. The plugin and ArCon executable do not share the same
development platform and as a result ArCon itself can not be compiled
into the plugin.
• The executable could be packaged into the plugin, but it was recog-
nized as unnecessary to also have to update the plugin each time the
ArCon executable would be updated. Consequently the plugin and
executable had to be separated. The plugin would still have to call
the executable and receive its result.
• When introducing the XMI import functionality ArCon got the re-
quirement to support two different ways to read UML models. One
27
CHAPTER 4. ARCON EXTENSION
for reading from Rhapsody projects and one for reading from an XMI
file. At execution ArCon has to know which way to read the models.
This was addressed by letting the input parameters to the executable
tell ArCon which reading method that is supposed to be used. The
plugin has to supply these parameters when calling the executable.
The obstacles and functionality requirements described were addressed
according to the description provided in the following subsections within
this section, 4.4.
28
4.4. ECLIPSE PLUGIN
Figure 4.4: Flowchart over the retrieving of the related model to an active
model.
29
CHAPTER 4. ARCON EXTENSION
The ArCon plugin will supply all parameters when launching the ArCon
executable. The model paths are retrieved using the method described in
Section 4.4.1. Debug settings are set to default 1=Only Errors, but it can
be changed manually from the plugin’s preference page within Eclipse. The
settings in the preferences page are visualized in Figure 5.2 on page 33.
30
Chapter 5
User Guide
This chapter will show new users how to get started with the ArCon plugin
and how to check conformance, using ArCon, on models created by Papyrus
in the Eclipse editor.
Install Eclipse Download and install Eclipse IDE from the Eclipse home-
page1 . Start Eclipse using the eclipse executable.
When all steps are completed then restart Eclipse. The plugin should
now be running and UML models can be created using the Papyrus modeling
tool.
• Run ArCon
Calls the ArCon executable and checks the conformance on the active
model and its related architecture rules or system model.
The active model is considered to be the UML model currently visible
in the editor. If the plugin is launched for the first time then the user
will be asked for the path to the ArCon executable. Supply the path
to ArCon 1.5, or newer compliant version, if asked to do so. The user
may also be asked to supply the related model if the related model
is not obvious from the plugin’s point of view, see Section 4.4.1 for
details on how ArConPlugin finds the related model.
• Setup related system/architecture model...
Menu item to explicitly define or change which model is related to
the currently active model. Using this option will override the soft
detection, like naming convention, and always use the specified model
as related model.
An important note is that the related model may not be the same for
both models, which means both the architecture and system model
may not have each other as related model. This behaviour is inten-
tional since there is no guarantee that an active system model may
always be refereed to from the architecture model. The reason is there
may be several system models that use the same architecture rules,
and the architecture model can only have one related model. All the
system models can still have the same architecture model as their re-
lated model.
• ArCon Preferences
Menu item to change settings for the plugin. On the preference page
32
5.2. MODEL EXAMPLES
the user can change the path to the ArCon executable which is most
often changed if the ArCon executable is moved in the file system or
another version is supposed to be used instead. Other settings like De-
bug level or naming convention can also be changed on the preference
page. More detailed description about the usage of the Debug level
settings can be found in Section 4.4.3. The settings presented on the
preference page can be seen in Figure 5.2.
33
CHAPTER 5. USER GUIDE
5.2.1 Example1
The example, shown in Figure 5.3, shows how the architectural rules can
be used to constrain which types of classes a package may contain. The
architectural rules model contains two classes, Sensor and Sensor Pkg, which
have the stereotypes <<Class>> and <<Package>>. Between the classes is
an association of the type composition drawn. The composition multiplicity
has the value [0..infinity], defined by the ’* ’.
The rules and constrains defined by the architectural rules model in the
example are the following:
1. A package with stereotype <<Sensor Pkg>> may contain any number
of classes with stereotype <<Sensor>>.
2. No other elements are allowed in a <<Sensor Pkg>> package.
The first rule is defined according to the T8 tranformation rule, see Table
1. The second rule is applied because of the general rule by ArCon that
nothing that is not explicitly allowed is allowed.
The stereotypes on the classes, in the architectural rules model, define the
element types that the translated stereotypes are to be applied to, in the sys-
tem model. In this example it is realized by the Sensor class with stereotype
<<Class>> being transformed to a stereotype named <<Sensor>> which can
be applied to classes, and the Sensor Pkg class with stereotype <<Package>>
being transformed to a stereotype named <<Sensor Pkg>> which can be ap-
plied to packages.
On the system model it can be observed that these constructs exists in
the form of a package named Sensors which has the stereotype <<Sensor Pkg>>
34
5.2. MODEL EXAMPLES
and two classes, Temperature Sensor and Pressure Sensor, with the stereo-
type <<Sensor>>. Because of the multiplicity value [0..infinity] there are
allowed to exist more than one type of <<Sensor>> classes within the pack-
age, and as such the two different sensor classes are allowed.
5.2.2 Example2
In Example2, shown in Figure 5.4, it can be observed how the system model
can violate the defined architectural rules.
Figure 5.4: An example how architectural rules can be violated in the system
model.
Figure 5.5: Example how a validation report given by ArCon looks like. An
error has been marked with a red box.
35
Chapter 6
Method Evaluation
This chapter will go into how the method to model architecture rules, de-
scribed in Section 3.3, works in practice by looking into two case studies.
First the result from an earlier study, performed by the authors of ArCon,
is summarized. Later the case study performed within this thesis project is
presented and last some reflections are reported.
The project was implemented using the modeling tool Rhapsody (version
4.x) from Telelogic [Telelogic Rhapsody modeling], with all code generated
from UML models in the tool, using C++ as the action code language. The
size of their software platform was approximately 350,000 eLOC in C++ and
the effort to develop it was about 100 person years over a 24 month period.
The architecture was documented partly in the system model and partly in
one manually written document. The system model contained a high-level
package structure and a framework of classes supporting the architectural
design rules. The document contained the architectural design rules. The
researchers had first-hand knowledge of the architecture, since the primary
author of the article was the technical manager of the project, responsible
for work practices and tools. The architecture was, however, developed by
two other persons acting as architects. The study was, according to the au-
thors, conducted by a systematic walkthrough reviewing the rules from the
architectural document in several iterations, gradually transforming them
to modeling constructs according to the proposed approach.
The authors of the article stated some questions to be evaluated in the
study.
1. To what extent could the specified rules be modeled?
2. Were there certain kinds of rules that could not be modeled and if not,
why not?
These questions are very interesting since they give a very basic answer
to how applicable the approach is to model architectural rules. In their
study they had 66 rules to be defined and of these 66 rules only 8 could
not be modeled. All these eight rules were considered to be of the type
where the developers were supposed to exercise judgement, which made
them inherently impossible to formalize.
At the end of the article the authors stated that although the approach
has only been tested on one system, two factors suggest that the results
should, to a large extent, be transferable to other systems and organizations
in the embedded software domain.
1. The defined transformations are based on raising the general modeling
constructs of UML to the meta-model level, not on the specific needs
of the system used for the test.
2. It is a real-world embedded system of significant size with functionality
quite common in this domain.
The authors also state that more practical studies are needed to better
evaluate the implications when adopting the method in different domains.
37
CHAPTER 6. METHOD EVALUATION
The selected project was an active industrial project within the Saab
JAS Gripen product, which is a fighter air plane. The evaluated system
model was a SysML model created in Rational Rhapsody 7.6.1. The project
is of type software engineering with a lot of diagrams and elements on the
behavioural constructs of UML/SysML. This made the project interesting
since ArCon’s earlier studies have been performed on architecture rules ex-
isting within the static side of UML with Structural constructs, and more
specifically the class diagrams. A document containing guidelines and mod-
eling rules for the project was available and served as a base for the architec-
ture rules. Using the document together with a few project representatives
a few core architecture rules and problems were identified, by the Saab
stakeholders, to be evaluated whether they can be automatically checked by
ArCon.
During a workshop the identified rules were discussed to find out which
were feasible targets for ArCon. The rules were graded with three types:
• Working Rules graded by this type could be checked in the current
implementation of ArCon, version 1.5.
• Possible These rules can be checked in a near future if ArCon receives
a small update.
38
6.2. CASE STUDY
• Conditional Rules
Many rules were conditional, meaning a certain structural pattern or
other type of pattern had to occur for the rule to be applicable. This
rule matching was contrary to how ArCon matched rules by identi-
fying stereotypes and applying the rules on the elements using the
stereotypes. An example where stereotypes were used, but still had
a conditional rule, was that a block with a specific stereotype could
only have associations navigable either to it or from it, not both di-
rections. This could be fixed by specifically splitting the blocks into
two stereotypes, <<To>> or <<From>>, but the stakeholders wanted to
avoid changes of the current stereotypes as much as possible.
Another example was that a Block, of a specific stereotype, can only
have associations to other Blocks of the same type and on the same
hierarchy level. The example is visualized in Figure 6.1, and as can
be observed the associations can only be called on the same hierarchy
level or to a top level. Using stereotypes, in this context, offers little
flexibility, and if the rules would have been implemented with the
available version of ArCon, version 1.5, all levels in the hierarchy would
have to be stereotyped in the architectural rules model. Not only
would it lead to unnecessarily many stereotypes but it also requires the
architect to explicitly know the class hierarchy on the system model.
A knowledge some may say the architect should not, or can not, have
beforehand. The architectural model would also have to be updated
if the hierarchy would be extended during development or in a future
update.
Figure 6.1: Conditional Rule. Left diagram shows the class hierarchy and
right shows the allowed association paths.
39
CHAPTER 6. METHOD EVALUATION
• Naming Convention
ArCon contains a basic naming convention mechanism for stereotypes
but it lacks a proper regular expression method. Some of the naming
rules, requested in the case-study, were constrains on string length,
upper- or lower-case on different parts of the string, word separation
with underscore, affixes from a list of allowed words, enumerations and
name relations to diagrams.
Due to administrative complications the case-study could not be finished
within the timeframe of this thesis. Regardless, the workshop gave insight
on ArCon’s potential and its current issues. These insights are presented in
the next section, Section 6.3.
40
6.3. ANALYSIS
6.3 Analysis
In this section the insights and reflections received during the case-study,
and from reading the results from the first case-study performed by the Ar-
Con authors, are presented. If no explicit definition is present, the case-study
is referring to the case-study performed within this thesis that is presented
in Section 6.2.
The two different case-studies show how different the results can become
when performed on two widely different software projects. The first case-
study, performed by the authors of ArCon, was performed on a software
projects where rules on the static structure and outline, such as classes
and their relationships, of the system was a main goal of the architecture
conformance. On the other hand the second case-study was on a project
that had no earlier knowledge of ArCon, and its methods to define and
constrain architectural design rules. Therefore the rules to be checked, which
were requested by the project owners, had no pre-condition to what ArCon
was created for. As a result the case-study, performed in this thesis, was
interesting because it showed how ArCon performs in a project for which it
has not been tailored for, contrary to the first case-study.
41
CHAPTER 6. METHOD EVALUATION
in this case study are also the creators of the approach, or have at least
had contact and guidance on the method from the creators beforehand. Es-
pecially one question about the notion of ’intuitive and easy-to-use’ arises
when reading the description of the approach:
• Architectural rules model is modeled using standard UML syntax, but
the meaning is at the higher meta-model level.
While using the standard UML syntax has the advantage of allowing the
architectural rules model to be modeled using existing modeling tools with-
out extension, it also risks to be confusing for the user. It may be confusing
to read and understand what the rules really mean when the architectural
rules model uses the same syntax as the standard UML models while having
another meaning. Therefore other interesting questions arise:
• How easy to understand is the architectural rules syntax and meaning?
Will it require training for a typical architect or developer?
• Will using standard UML syntax, while having another meaning than
the standard, cause confusion for the architects and developers? If so,
will confusion only happen when the subject is new to the method,
or will it be confusing in other situations, for example when switching
between working on standard UML models and architectural rules
model?
For the method to be widely used and accepted, one could state that it must
be easy to pick up and use without any experts’ guidance. Consequently
more case studies would have to be performed to evaluate the methods
applicability within software development. The first case study gave a hint
on its potential and gives the reader a preview of how the method can aid
the software development. But, as also stated by researchers, there is a need
for further research to study the implications when adopting the approach
in other application domains. Factors to investigate include the ease with
which architects, developers and other stakeholders can learn the approach
and accommodate their working practices to it.
42
6.3. ANALYSIS
model, and its structural design and constrains. As a result the scope of
ArCon does not fall under the Modeling Practices rules, even if the rules are
still identified as of interest. A proposed solution is to create a sister-project
for ArCon that checks the non-project specific types of rules, rules that were
earlier called Modeling Practices rules.
43
CHAPTER 6. METHOD EVALUATION
Summary The workshop showed the potential for ArCon while it also
gave insight on a number of issues and where there is room for improvement,
most likely because the project was so different from ArCon’s first target
project. Even though many of the rules could not be checked right from
the start, there is potential to check them in the future when ArCon and its
method have evolved. Since the project, of the case-study, was in a domain
which was not part of ArCon’s first target, it can be expected that new
features and fixes are needed when expanding the system’s domains. Some
44
6.3. ANALYSIS
of the issues presented in this section are feasible to implement directly, while
others do not have a straight forward solution and require more thoughts
before they become applicable. A few of these improvements were set to be
implemented during the case-study, but it could not be performed within
this thesis because of time constraints. Instead, the ideas and suggestions
are presented in Section 7.2.
45
Chapter 7
This chapter presents the results for this thesis project and gives suggestions
on future work and improvements for ArCon.
7.1 Results
The software architecture, with its rules and constrains on the system model,
is important in many projects. To check and maintain the conformance of
the architectural design rules, on the realizing system, is a problem within
software development. ArCon uses a proposed method to define and check
architectural design rules defined in a UML model. In this thesis, ArCon
was successfully extended with import functionality so that ArCon could
read and check UML models defined in an XMI file. A plugin was also
successfully created to integrate ArCon into the Eclipse environment, and
Papyrus as the first modeling tool in the Eclipse platform to be supported.
The method itself, which ArCon builds upon, was evaluated in a small
case-study. Even though the study was performed in a very short time frame
it gave light to some of ArCon’s potential and shortcomings. Several po-
tential areas to improve ArCon, and the method itself, have been identified
during development and will be presented in the next section, Section 7.2.
• Which rules, or what types of rules, can the method check that cur-
rently exist, in different documents and artefacts, within the project?
• What rules that ArCon can not check would be feasible to do so in
the future? Can the company help with the contribution of ArCon to
implement those?
47
CHAPTER 7. SUMMARY AND CONCLUSIONS
UML2 also gives the advantage to work on the same representation as the
modeling tools, such as Papyrus, within the Eclipse project. No adapter will
be needed to convert UML elements between two different representations,
if the applications would share the same representation.
Other projects, within Eclipse Modeling Project, may be of interest when
the development of ArCon matures, or when new projects arise under the
EMP flag.
48
7.2. FUTURE WORK
transformations will be defined and work is not obvious today and they will
have to be evaluated just like the current rules.
An idea could be to create a framework to allow user-defined transforma-
tion rules, meaning they do not exist within ArCon’s standard transforma-
tion regulations. The motivation would be that companies and stakeholders
may have their own types of rules, which are specific for them, that they
want to check. Allowing them to define and check those rules, without
implementing user specific rules into ArCon, would be beneficial for them
while also making sure ArCon remains a generic tool that can be used by
everyone. If a user-defined rule is generic enough it can be subject to be
added into ArCon’s core transformation rules. It would then be of interest,
for the community around ArCon, to actually take in new generic rules into
ArCon’s standard rules, to prevent everyone from having their own defini-
tion of transformation rules and resulting in nobody can interchange their
models.
49
CHAPTER 7. SUMMARY AND CONCLUSIONS
and type. Using the multiplicity separates the name definition from the
definition of the allowed amount, while also allowing more specific constrains
to be defined on the amount.
50
7.3. CONCLUSION
7.2.6 Formalization
The current transformation description, see Table 1, is vague and subject to
interpretation by the reader. A formalized description of the rules is needed
before the method can become a standard and be used more widely.
7.2.8 Profiling
One of the drawbacks with the current method to model the architectural
rules, supported by ArCon, is that the constructs may not be easy to under-
stand. Since the UML constructs have another meaning than the standard
UML it can be confusing for the user. Also the UML elements are not
created for this purpose, so there may also exist constructs that have no
meaning at all, or the meaning is very vague in the context of the architec-
tural meta model. As a consequence, I suggest extending and constraining
the constructs with UML profiling. The idea is based on the way SysML
is defined by UML profiling, and with that both extending and constrain-
ing the UML constructs. With the profiling it would be possible to have
names and values so that the meaning of the model becomes more obvious.
Constructs in the standard UML that have no meaning in the architectural
meta model could also be removed, and new constructs can be added to
better describe the architecture. Later on, if the method receives ground,
modeling tools can add explicit support for the method in a similar way as
many tools support SysML nowadays.
In the current transformation rule description, Table 1, the architectural
rules model has to use some stereotypes to define some specific rules. At
current state these would be created in a profile that the architectural model
applies. This means the step towards profiling has indirectly already started
but a lot more can be done to help the users understand and use the building
stones of the architectural meta model.
7.3 Conclusion
Architectural design rules are seen as important, and at the same time they
are complicated to define and verify. ArCon uses a proposed method to
define and check the architectural design conformance of software systems.
During this thesis, ArCon has been shown to have potential to define a wide
51
CHAPTER 7. SUMMARY AND CONCLUSIONS
52
Bibliography
[14] Herb Sutter and Andrei Alexandrescu. C++ Coding Standards: 101
Rules, Guidelines, and Best Practices. Addison-Wesley Professional,
2004. ISBN 0-321-11358-6.
54
Avdelning, Institution Datum
Division, Department Date
PELAB,
Dept. of Computer and Information Science 2012-06-12
581 83 Linköping
http://www.ep.liu.se
Titel
Title
Emil Fridell
Sammanfattning
Abstract
Nyckelord
Software Architecture, Model-Driven Development, UML, Architecture
Keywords
conformance, ArCon, Open-Source
På svenska
In English
The publishers will keep this document online on the Internet - or its possible
replacement - for a considerable time from the date of publication barring
exceptional circumstances.
The online availability of the document implies a permanent permission for
anyone to read, to download, to print out single copies for your own use and to
use it unchanged for any non-commercial research and educational purpose.
Subsequent transfers of copyright cannot revoke this permission. All other uses
of the document are conditional on the consent of the copyright owner. The
publisher has taken technical and administrative measures to assure authenticity,
security and accessibility.
According to intellectual property law the author has the right to be
mentioned when his/her work is accessed as described above and to be protected
against infringement.
For additional information about the Linköping University Electronic Press
and its procedures for publication and for assurance of document integrity,
please refer to its WWW home page: http://www.ep.liu.se/
© Emil Fridell