institut f¨ur informatik - PST Thesis Management Interface - LMU
institut f¨ur informatik - PST Thesis Management Interface - LMU
institut f¨ur informatik - PST Thesis Management Interface - LMU
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
INSTITUT FÜR INFORMATIK<br />
DER LUDWIG–MAXIMILIANS–UNIVERSITÄT MÜNCHEN<br />
Diplomarbeit<br />
An Automated Process for the<br />
Generation of Generic Model <strong>Interface</strong>s<br />
for Evolutionary Different<br />
AUTOSAR Schema Versions<br />
Leonard Krpan
INSTITUT FÜR INFORMATIK<br />
DER LUDWIG–MAXIMILIANS–UNIVERSITÄT MÜNCHEN<br />
Diplomarbeit<br />
An Automated Process for the<br />
Generation of Generic Model <strong>Interface</strong>s<br />
for Evolutionary Different<br />
AUTOSAR Schema Versions<br />
Leonard Krpan<br />
Aufgabensteller: Prof. Dr. Martin Wirsing<br />
Betreuer: Annabelle Klarl<br />
Christian Knüchel (BMW Car IT)<br />
Abgabetermin: 30. September 2011
Hiermit versichere ich, dass ich die vorliegende Diplomarbeit selbstständig verfasst<br />
und keine anderen als die angegebenen Quellen und Hilfsmittel verwendet habe.<br />
München, den 30. September 2011<br />
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .<br />
(Unterschrift des Kandidaten)
Abstract<br />
This thesis describes a concept for the automatic creation of a generic, version-independent<br />
metamodel based on the comparison of evolutionary different metamodel versions. The<br />
comparison results are obtained from an automatically created difference model. Unlike<br />
a transformation engine which typically uses information in a difference model to migrate<br />
an existing model to the evolved model, the concept developed in this thesis exploits the<br />
difference model to identify metamodel elements that can be represented by a generic metamodel<br />
and explores to which extent this can be done automatically before a semantic gap is<br />
reached. The concept is showcased through a model transformation prototype that produces<br />
a generic metamodel encompassing elements common to all version-specific metamodels and<br />
elements that were subjected to minor changes during the evolution process. The generic<br />
metamodel can be directly deployed to automatically generate version-independent model<br />
API code with the Eclipse Modeling Framework. The concept is applied to create a generic<br />
AUTOSAR metamodel as a solution to the metamodel evolution problem that occurs in<br />
AUTOSAR tool development with Artop.<br />
vii
Acknowledgments<br />
I would like to thank Prof. Dr. Martin Wirsing for approving the request to do my thesis<br />
at BMW Car IT. More importantly, I thank Prof. Wirsing for the many lessons in which he<br />
shared his knowledge with me and which I much enjoyed attending.<br />
I would like to thank my <strong>LMU</strong> supervisor Annabelle Klarl for the time and effort she invested<br />
in mentoring my thesis and for organizing communications with Prof. Wirsing and the <strong>PST</strong><br />
department.<br />
I would like to thank Team Blue at BMW Car IT for giving me the opportunity to experience<br />
their company through this thesis project. I especially thank my supervisor Christian<br />
Knüchel and my co-supervisor Paul Hoser for organizing the thesis, introducing me to their<br />
project and giving me the opportunity to expand my knowledge with the topics that this<br />
thesis covers. I also thank them for their extensive mentoring throughout the project. Furthermore,<br />
I thank my professor, my supervisors at <strong>LMU</strong> and BMW Car IT, the head of<br />
Team Blue, Michael Rudorfer, and the head of BMW Car IT, Prof. Dr. Harald Heinecke,<br />
for helping me ensure the quality of the thesis document.<br />
I would like to express deepest gratitude to my parents Irena Krpan and Jasmin Krpan<br />
for guiding me to decisions that led to choosing <strong>LMU</strong> and Munich, which has resulted in the<br />
opportunity to develop myself on a professional and personal level that would not have been<br />
attainable at home. I thank them and my sister Izabela Krpan, my grandmother Donka<br />
Miloˇs and our dog Peggy for their support, encouragement and love throughout my student<br />
experience.<br />
I would also like to thank my friends in Munich for the much needed support during the<br />
final stages of my university studies.<br />
My greatest appreciation goes to my girlfriend Erin Beaton for her enormous patience and<br />
for her continuous encouragement during every single day of work on this thesis. Without<br />
her love and care, I would not have had the strength to complete this work.<br />
ix
Contents<br />
1. Introduction 1<br />
1.1. <strong>Thesis</strong> objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1<br />
1.2. <strong>Thesis</strong> outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2<br />
2. State of the Art 3<br />
2.1. Model-Driven Software Development . . . . . . . . . . . . . . . . . . . . . . . 3<br />
2.1.1. Growing complexity of software . . . . . . . . . . . . . . . . . . . . . . 3<br />
2.1.2. Abstraction in computing . . . . . . . . . . . . . . . . . . . . . . . . . 3<br />
2.1.3. The model-driven approach . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
2.1.4. Principles of model-driven software development . . . . . . . . . . . . 5<br />
2.1.5. Model-driven software development in the automotive industry . . . . 10<br />
2.2. Eclipse Modeling Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />
2.2.1. Ecore - the EMF metamodel . . . . . . . . . . . . . . . . . . . . . . . 12<br />
2.2.2. Model persistence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
2.2.3. Code generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
2.2.4. EMF Compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19<br />
2.3. Model evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20<br />
2.3.1. Model versioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21<br />
2.3.2. Model adaptation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22<br />
2.4. Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24<br />
3. Automotive Open System Architecture 25<br />
3.1. The AUTOSAR standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25<br />
3.1.1. AUTOSAR architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 25<br />
3.1.2. AUTOSAR methodology . . . . . . . . . . . . . . . . . . . . . . . . . 27<br />
3.1.3. AUTOSAR metamodel . . . . . . . . . . . . . . . . . . . . . . . . . . 29<br />
3.2. Artop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30<br />
3.2.1. Artop architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31<br />
3.2.2. Developing AUTOSAR tools with Artop . . . . . . . . . . . . . . . . . 32<br />
3.3. The Generic AUTOSAR concept . . . . . . . . . . . . . . . . . . . . . . . . . 34<br />
3.3.1. GAUTOSAR metamodel . . . . . . . . . . . . . . . . . . . . . . . . . 34<br />
3.3.2. Implementing tool functionality with GAUTOSAR . . . . . . . . . . . 35<br />
3.4. Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36<br />
4. Automation of Generic AUTOSAR 37<br />
4.1. Realization of GAUTOSAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37<br />
4.1.1. Process steps for realizing GAUTOSAR . . . . . . . . . . . . . . . . . 37<br />
4.1.2. Automation of the GAUTOSAR realization process . . . . . . . . . . 39<br />
4.2. Analysis of the automated metamodel comparison process . . . . . . . . . . . 40<br />
4.2.1. DiffMap metamodel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40<br />
xi
Contents<br />
4.2.2. Model comparison in DiffMap . . . . . . . . . . . . . . . . . . . . . . . 42<br />
4.2.3. Distributed comparison history . . . . . . . . . . . . . . . . . . . . . . 42<br />
4.2.4. Leaking occurrence information . . . . . . . . . . . . . . . . . . . . . . 44<br />
4.3. Automated creation of the generic metamodel . . . . . . . . . . . . . . . . . . 50<br />
4.3.1. Construction phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51<br />
4.3.2. Decoupling phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54<br />
4.3.3. Gification phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55<br />
4.3.4. Prototype implementation . . . . . . . . . . . . . . . . . . . . . . . . . 56<br />
4.4. Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59<br />
5. Results 61<br />
5.1. Generic AUTOSAR metamodel . . . . . . . . . . . . . . . . . . . . . . . . . . 61<br />
5.1.1. Observed issues in the generic metamodel . . . . . . . . . . . . . . . . 61<br />
5.1.2. Known limitations of the prototype . . . . . . . . . . . . . . . . . . . . 62<br />
5.2. Limitations in the automation process . . . . . . . . . . . . . . . . . . . . . . 63<br />
5.2.1. Undetectable class changes . . . . . . . . . . . . . . . . . . . . . . . . 63<br />
5.2.2. Generic elements not present in all metamodels . . . . . . . . . . . . . 63<br />
5.2.3. Superclass information gain . . . . . . . . . . . . . . . . . . . . . . . . 63<br />
5.3. Evaluation of achieved results . . . . . . . . . . . . . . . . . . . . . . . . . . . 65<br />
5.4. Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67<br />
6. Conclusion 69<br />
6.1. <strong>Thesis</strong> summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69<br />
6.2. Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70<br />
6.2.1. Self-containment of the DiffMap model . . . . . . . . . . . . . . . . . . 70<br />
6.2.2. AUTOSAR-specific matching algorithm . . . . . . . . . . . . . . . . . 70<br />
6.2.3. Use-case analysis of attribute type changes . . . . . . . . . . . . . . . 71<br />
6.3. Final thought . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71<br />
A. Appendix 73<br />
List of Figures 79<br />
List of Listings 81<br />
CD Contents 83<br />
Bibliography 85<br />
xii
1. Introduction<br />
Software development is a complex and demanding task that requires considerable human<br />
effort and significant technical resources. One of the technical aspects is the availability of<br />
comprehensive development tools. BMW Car IT is driving forward model-driven software<br />
development in the automotive domain, which also applies to creating tools. These tools<br />
facilitate development of models by offering various tool functions that can be used to create<br />
and manipulate the models. BMW Car IT is involved in developing Artop, an infrastructure<br />
platform for creating AUTOSAR tools. AUTOSAR is a standardized architecture for<br />
developing software for automobile electronic control units that relies on the model-driven<br />
approach.<br />
The AUTOSAR standard, representing a software entity, is under constant development<br />
and improvement. As a reaction to this development, the metamodel representing the AU-<br />
TOSAR architecture is subject to evolution. Artop reacts to metamodel evolution by providing<br />
support for a number of metamodel versions within each tool release. The consequence<br />
of supporting multiple metamodel versions in one tool is that semantically equivalent tool<br />
functionalities have to be implemented separately for each metamodel version. To alleviate<br />
this inconvenience, evolutionary different metamodel versions are compared in order to create<br />
a generic metamodel that encompasses common parts of metamodels of the supported<br />
versions. Tool functionality can then be implemented only once and automatically delegated<br />
to specific metamodel versions. Due to the size of AUTOSAR metamodels, comparing the<br />
metamodels and creating a common metamodel manually becomes a very complicated and<br />
time-consuming task. Therefore, BMW Car IT is engaged in research efforts to automate<br />
this process to the furthest possible extent.<br />
1.1. <strong>Thesis</strong> objective<br />
The objective of this thesis is to develop a concept for the automatic creation of a generic,<br />
version-independent metamodel based on comparison results of evolutionary different metamodel<br />
versions. The developed concept will be showcased through a model transformation<br />
prototype. The prototype will use a difference model containing metamodel comparison<br />
results as input and produce a version-independent metamodel as output. The automation<br />
concept will be applied to AUTOSAR metamodels and the prototype will yield a versionindependent,<br />
generic AUTOSAR metamodel as result.<br />
The metamodel comparison results will be obtained from a difference model developed in<br />
a preceding thesis at BMW Car IT. The difference model will be improved to present the<br />
comparison results in a format that enables automatic identification of generic metamodel<br />
elements. The difference model will also be improved to achieve a higher accuracy when<br />
identifying metamodel elements that are common in compared versions.<br />
1
1. Introduction<br />
The automation concept will process the difference model and explore to which extent the<br />
creation of a generic metamodel can be automated before a manual intervention is necessary.<br />
The concept will process each metamodel element found in the difference model and inspect<br />
the occurrence history and change information for that element in order to determine if it<br />
can be represented in the generic metamodel. This will enable automatic extraction of metamodel<br />
elements which are common in all versions or which have been changed to a minor<br />
degree and automatic creation of a generic metamodel made up from such elements. The<br />
generic metamodel will be self-contained in the sense that it will not contain references to elements<br />
in the version-specific metamodels. A naming convention will be used for the generic<br />
metamodel that enables a clear distinction between generic and version-specific elements,<br />
but at the same time makes it possible to relate their meaning.<br />
1.2. <strong>Thesis</strong> outline<br />
The remaining chapters of this thesis are organized as follows:<br />
2<br />
• Chapter 2 presents the state of the art of principles and general technologies that<br />
are relevant for this thesis. The motivation behind model-driven software development<br />
in terms of increasing software complexity and the principles of this approach are<br />
introduced first, followed by examples of applying these principles in the automotive<br />
industry. Next, an introduction to the Eclipse Modeling Framework as a tool for<br />
creating modeling applications in Java is given. The chapter is concluded with an<br />
overview of current research in model evolution.<br />
• Chapter 3 introduces specialized technologies that this thesis is concerned with. Different<br />
aspects of the AUTOSAR standard are discussed in detail at first. Artop is<br />
presented in detail as well, followed by examples of how it enables the creation of<br />
AUTOSAR tools. Following Artop a detailed explanation of the metamodel evolution<br />
problem and its effects on tool development are given. The use of a common<br />
version-independent metamodel is proposed as a solution.<br />
• Chapter 4 begins by introducing the process steps that are necessary to realize the<br />
concept of a generic metamodel, followed by the motivation for the automation of this<br />
process. Automatic comparison of metamodels (done in preceding work) is explained<br />
as the first part of the automation process, together with necessary improvements that<br />
were contributed in this thesis. This thesis’ main contribution - a concept for the<br />
automatic creation of a generic metamodel based on metamodel comparison results<br />
and the prototype that realizes the developed concept - are elaborated in detail as the<br />
second part of the automation process.<br />
• Chapter 5 analyzes the results of development efforts conducted in this thesis. The<br />
prototype for automatic creation of the generic metamodel is run with AUTOSAR<br />
metamodels and the resulting generic metamodel is examined. An overview of limitations<br />
that were encountered while conceiving the automation concept are given. An<br />
evaluation of achieved results concludes the chapter.<br />
• Chapter 6 concludes this thesis with a review of the problems and contributed solutions<br />
and an outlook to future work.
2. State of the Art<br />
This chapter gives an overview of the general software development principles, technologies<br />
and events that are relevant for this thesis.<br />
2.1. Model-Driven Software Development<br />
Model-driven software development gives answers to the issue of managing software of constantly<br />
increasing complexity. This section discusses the events that lead to such complexity<br />
and explains the background and principles of the model-driven solution.<br />
2.1.1. Growing complexity of software<br />
Current advancements in hardware and network technologies have led off to development of<br />
ubiquitous, collaborative software systems that became indispensable for the modern society.<br />
Software in these systems is often deployed in distributed and embedded environments that<br />
consist of various devices (from personal computers and mobile devices to specialized sensors<br />
and electronic control units), while communicating through diverse interaction paradigms<br />
[FR07]. The complexity of such software systems and the expectations of quality are increasing,<br />
while the software development cycles are becoming shorter. Such events cause<br />
software developers to face major challenges in all stages of the software life cycle [HT06].<br />
However, a considerable factor that influences the complexity of developing such systems is<br />
not technical: it is the understanding of the problem domain - the area of interest to which<br />
the end-user is applying the software system - and the gap between the problem domain and<br />
the implementation of the problem solution [Eva03]. This gap appears when a developer<br />
creates software solutions by using abstractions that are at a lower level than those used to<br />
express the problem. When developing a system, the attempt to overcome this gap by using<br />
methods that rely on human effort will only increase the system’s complexity [FR07]. Tackling<br />
this issue thus requires a technology that will effectively raise the level of abstraction<br />
in which the solution is implemented, which in turn will result in improved productivity,<br />
efficiency and software quality.<br />
2.1.2. Abstraction in computing<br />
The history of computing can be observed as a study of layers of abstraction [Lid10, HT06]:<br />
from hard-wired computers to stored-program machines in the early days, programming has<br />
evolved from machine code to assembly languages and from there to third-generation languages.<br />
The third-generation languages enabled developers to ignore register allocation and<br />
low-level machine instructions by introducing high-level abstractions such as named variables<br />
and structured programming constructs. The translation back to machine code could be left<br />
to compilation technologies. Object-oriented languages introduced additional abstractions<br />
3
2. State of the Art<br />
like abstract data types and objects, while domain-specific languages (see section 2.1.4) provided<br />
abstractions for particular application domains. Operating systems and device drivers<br />
were introduced to manage the complexity of interfacing with computer hardware and enabled<br />
developers to concentrate on application development instead on low-level hardware<br />
control. The abstraction of processes within an operating system introduced multitasking<br />
and allowed software developers to avoid dealing with the associated complexity to a great<br />
extent. Thus, each step in the evolution of programming languages and operating systems<br />
has introduced higher levels of abstractions, which enables software developers today to<br />
think in terms of domain objects rather than binary digits stored in a memory location.<br />
This way, the developers can better focus on the application domain because abstractions<br />
that are used to build a software product are conceptually much closer to the application<br />
domain itself. Model-driven software development introduces yet another abstraction with<br />
this goal in mind.<br />
2.1.3. The model-driven approach<br />
Model-driven software development (MDSD) is a software engineering approach consisting<br />
of the application of models and accompanying technologies to raise the level of abstraction<br />
at which developers create and evolve software [HT06]. By automating the various activities<br />
that comprise the software life cycle, the developers’ productivity can be increased while<br />
the cost of development and maintenance can be decreased. A model is a representation of<br />
a system or some part of a system that abstracts the aspects relevant to solving a certain<br />
problem and ignores irrelevant details [FR07, Sel03]. This representation enables an easier<br />
understanding of the system’s essentials. A model can also be considered as an abstraction<br />
of knowledge about a system’s domain [Eva03]. In MDSD, a model is not just an auxiliary<br />
artifact, but the central entity that is tightly integrated into the complete software development<br />
process.<br />
Models and modeling have had an essential role in engineering throughout history [Sel03].<br />
Engineering models offer a visualization of the finished product. This helps to better understand<br />
a complex problem, its possible solutions and design flaws before the effort of a<br />
full construction is made. Engineering software means expressing ideas - it is not bound by<br />
physical laws as other engineering disciplines. Taking advantage of this opportunity brings<br />
out great potential for modeling techniques in software engineering: in MDSD the main<br />
focus of software development are models rather than computer programs. The advantage<br />
to this approach is that models are expressed by using concepts that are less bound to a specific<br />
implementation technology and closer to the problem domain (see section 2.1.2). This<br />
feature also facilitates a more effective communication with the stakeholders in a software<br />
project. The stakeholders are most likely more capable of understanding an abstract model<br />
rather than program code in a specific programming language [Lid10]. Thus, models can be<br />
used to reason about the problem and the solution domain, while the relationships between<br />
models provide dependencies that record the process of creating the solution and help the<br />
stakeholders better understand this process in all of its phases [BCT05].<br />
As the system in development evolves, the models become more complete and the focus<br />
of effort shifts from models at higher abstraction levels to models at lower abstraction levels.<br />
Ultimately, models are used to directly produce program code that constitutes deployable<br />
4
2.1. Model-Driven Software Development<br />
software components [BCT05]. Since automation is the most effective technological way to<br />
boost productivity [Sel03], model transformations can be automated in order to ensure both<br />
consistency between models at different abstraction levels and increased productivity. If a<br />
MDSD technology provides means for automatic generation of complete program code, it<br />
causes the modeling language to take on the role of an implementation language. Essentially,<br />
this increases the abstraction level at which software is developed (as observed in section<br />
2.1.2).<br />
Expressing models requires a clear, formal notation of the model’s syntax and semantics.<br />
The syntax and semantics of a model are conveyed in its elements, their structure and references.<br />
The artifacts that provide this are yet again described in a model, which is called a<br />
metamodel. This formal approach is crucial to enabling the analysis, automation and transformation<br />
of models (see section 2.1.4).<br />
The notion of a model is not completely new to computing. If we look at a model as a<br />
representation of a system, then programming in any language involves some sort of model<br />
[Lid10]. A Java programmer thinks about the problem domain in terms of objects and Java<br />
classes, an SQL programmer through means of tables that have rows and columns. Common<br />
to both mentioned developers is that they are modeling a solution using the abstractions<br />
provided by the respective programming language. Hence, the process of analyzing a problem,<br />
creating a solution and expressing a solution in a high-level programming language can<br />
be considered an implicit form of modeling, which essentially makes software development<br />
a model-based problem solving activity [FR07]. These mental models evolve as a result of<br />
discussions with the project stakeholders, changes in requirements, errors discovered while<br />
testing etc. and lead the development of manually written code. The mental models can be<br />
shared with others using informal sketches or as formal statements in a modeling language.<br />
2.1.4. Principles of model-driven software development<br />
In order to facilitate the possibilities of models described in the previous sections, one should<br />
consider the following principles: [BCT05]<br />
• A formal notation for describing models through the means of metamodels enables<br />
meaningful transformation between models and represents the foundation for automation<br />
through tools.<br />
• Models expressed in a well-defined notation are essential for understanding a system<br />
solution.<br />
• Building a system can be organized around models by applying transformations on<br />
models and organizing them into a layered architecture.<br />
These principles can be identified each time MDSD is applied, regardless of the specific<br />
technologies and standards (such as executable UML, EMF or MDA) that are deployed.<br />
How these principles are realized is described in the remaining part of this section (in the<br />
order as presented above).<br />
5
2. State of the Art<br />
Metamodels and metamodeling<br />
A metamodel uses a formal notation to define the abstract syntax and the semantics of a set<br />
of modeling constructs. In other words, a metamodel formalizes the concepts that are part<br />
of the problem domain and that a model should be able to represent, whereas the abstract<br />
syntax and the semantics describe the well-formed structure of a model [SV05].<br />
Consider the two UML diagrams in figures 2.1 and 2.2. The UML class diagram in figure<br />
2.1 represents a simplified view of the domain of AUTOSAR software components and<br />
their communication paradigm. The software components communicate through interfaces<br />
that are defined by ports (see section 3.1.1). The UML object diagram in figure 2.2 illustrates<br />
a particular instance of the class diagram - an atomic AUTOSAR software component containing<br />
one provided and one required port that specify a client-server interface. The class<br />
diagram represents building blocks and relationships between those building blocks necessary<br />
to create models of AUTOSAR software components. Thus, the class diagram represents a<br />
metamodel for the model depicted in the object diagram. The model in the object diagram<br />
could further be used to automatically generate deployment code in a programming language<br />
(in AUTOSAR, software components are written in C [AUT10b]) and create the modeled<br />
object configuration - an instance of the model.<br />
Figure 2.1.: Simplified view of the domain of software components and their communication<br />
paradigm in AUTOSAR, expressed in the UML class diagram notation.<br />
The notation used for creating the diagrams in figures 2.1 and 2.2 is the UML structure<br />
diagram. The rules of UML on how to specify the different classes, attributes, objects and<br />
other entities constitute a metamodel for creating UML models. Thus, it can be concluded<br />
that the model notation is always relative to a metamodel.<br />
The Object <strong>Management</strong> Group (OMG), which stands behind the UML standard, defines a<br />
whole set of metamodeling levels (see figure 2.3). According to OMG, level M0 corresponds<br />
6
2.1. Model-Driven Software Development<br />
Figure 2.2.: The UML object diagram representing a model of an AUTOSAR software component.<br />
The model conforms to the metamodel in figure 2.1.<br />
to an instance of a model that typically represents real-life objects. Level M1 represents the<br />
information or problem domain, which is captured in the model. The metamodel is found on<br />
level M3. It defines the language for creating a model - this is UML itself. Finally, level M3<br />
provides the infrastructure for defining metamodels - the metametamodel. At this level, the<br />
Meta Object Facility (MOF), OMG’s metamodeling language, is situated. In order to avoid<br />
infinite stacking of further meta-layers, MOF recursively describes itself and is thus its own<br />
metamodel [mdsb]. This is a common approach and can be found in other technologies, such<br />
as XML Schema [mdse], Backus-Naur Form (BNF) grammars [mdsd] and Ecore (presented<br />
in section 2.2.1).<br />
If we strictly apply OMG’s layers to the AUTOSAR software component example, then<br />
the object diagram corresponds to level M0 and is an instance of the model represented by<br />
the class diagram on level M1. UML was used as the metamodel on level M2 and UML’s<br />
metamodel is MOF on level M3. Notice that the generated C code is left out and the object<br />
diagram took the role of a model instance. Here, one could argue that these two represent the<br />
same concept, but in a different notation (C code on one hand and a UML object diagram<br />
on the other hand). However, if we try to map the software component artifacts to the four<br />
layers as they were initially described, we get a different result: in the initial example, the<br />
C code is considered an instance of a model and therefore corresponds to level M0. The<br />
AUTOSAR software component model depicted in the object diagram corresponds to level<br />
M1 and the software components domain depicted in the class diagram corresponds to the<br />
metamodel on level M2. This leaves us with UML at the metametamodel level M3. However,<br />
7
2. State of the Art<br />
Figure 2.3.: The four (meta)modeling layers as specified by OMG.<br />
we know that UML’s metamodel is not UML itself but MOF, which is now missing a layer.<br />
Indeed, the number of considered abstraction levels depends on the specific technology (i.e.<br />
Ecore defines only three levels).<br />
Domain Specific Languages<br />
In the process of creating a solution for an engineering problem, one can apply either a<br />
generic or a specific approach [vDKV00]. A generic approach offers a solution for many<br />
problems, however, such a solution might not be optimal. A specific approach offers a better<br />
performing solution for a small set of particular problems. This phenomenon is present in<br />
computer science, too [Tah08]: one can distinguish between general-purpose languages and<br />
modeling languages on the one hand, such as Java and UML, and domain-specific languages<br />
(DSLs) on the other hand, such as SQL and HTML. Often there is a distinction between<br />
visual DSLs, such as the Eclipse Graphical Editing Framework [mdsc], and textual DSLs,<br />
such as ARText [mdsa], which is a subproject of Artop (see section 3.2). Interestingly, some<br />
older programming languages - like Cobol, Fortran and Lisp - were all conceived for solving<br />
specific problems and came to evolve to general-purpose languages. Such evolution though<br />
causes a need for specialized language support to solve problems in specific application domains.<br />
This is why language designers today are especially interested in DSLs.<br />
8
2.1. Model-Driven Software Development<br />
The software component example given earlier in this section reflects this nature in a small<br />
scope: a general-purpose modeling language, UML, was used to create a specific modeling<br />
language intended to model simple AUTOSAR software components.<br />
DSLs can help bridge the gap between the problem and the solution domains: they allow<br />
solutions to be expressed in terms of problem domain entities and at the level of abstraction<br />
of the problem domain [FR07]. This makes it possible for domain experts to not only use<br />
DSLs, but also understand, validate and develop the language themselves, while not having<br />
to be concerned with implementation details at lower abstraction levels [vDKV00]. Thus,<br />
DSLs offer abstraction qualities that are necessary to express models in MDSD.<br />
Model transformation<br />
Model transformations are used to transform models that were initially conceived for some<br />
purpose into models that are better suited for other purposes while maintaining model traceability.<br />
Maintaining model traceability means keeping the transformed models consistent and<br />
the relationship between them traceable [FR07, HT06]. A typical example is the transformation<br />
from a technology-independent, high-level abstraction model to a technology-specific,<br />
low-level abstraction model that features specific data instead.<br />
Model transformations require a model as one of the inputs in the automation process and<br />
one or more models and/or different levels of executable code as output. Different types of<br />
transformations exist which can be classified as follows: [BCT05]<br />
• Refactoring transformations reorganize a model based on well-defined criteria. The<br />
output is a revision of the original model - the refactored model.<br />
• Model-to-model transformations convert information from one or more models to<br />
another model or a number of models. The goal is usually to convert information at<br />
one abstraction level to a different abstraction level. This type of transformation can<br />
also have other purposes that are specific to certain issues within the problem domain<br />
- such a transformation is the subject of this thesis (see section 4.1.1).<br />
• Model-to-code transformations convert model elements into program code and are<br />
often the final transformation that is performed.<br />
Transformations can be applied both manually and automatically [BCT05]. In a manual<br />
transformation, a developer or a domain expert analyzes the input model and manually<br />
creates or modifies the elements in the transformed model by interpreting the information<br />
in the original model. Automatic transformations apply a series of changes to a single or<br />
a number of input models based on predefined transformation rules. The rules can be provided<br />
by a tool used to perform the transformations or can be manually tailored based on<br />
domain-specific knowledge. Utilizing automatic transformation requires the input model to<br />
be syntactically and semantically well-formed. Combined, semi-automatic approaches where<br />
the automation process requires manual input in order to produce a correct transformation<br />
are possible, too (see sections 2.3.2 and 4.1.1).<br />
9
2. State of the Art<br />
In a roundtrip engineering approach, models describing system design are used to generate<br />
code stubs that need to be further refined by the programmer. The code generation<br />
process applies a set of patterns to transform model elements to code (see section 2.2.3).<br />
The refinements in code need to be reflected in the model by either adapting the model<br />
manually or by using a transformation tool [BCT05]. In a model-centric modeling approach,<br />
models are established that convey enough detail for a full implementation to be generated<br />
through model-to-code transformation. A manual examination and modification of<br />
the generated code is unnecessary, just as this is the case with machine code generated by<br />
compilers. Furthermore, modern generators can achieve performance and memory efficiency<br />
that outperforms equivalent manual-written code [Sel03].<br />
2.1.5. Model-driven software development in the automotive industry<br />
MDSD has found application in the telecommunications, financial and aerospace industries<br />
as well as in web application and software product line development [MD08]. However, this<br />
section gives an overview of using MDSD in the automotive domain.<br />
Modern innovations in the automotive industry are shifting from advances in mechanical<br />
engineering and mechanical solutions to electronic and software functions. Over the last<br />
years, advances in electronics made up 90% of innovations in new automobiles [VSK05].<br />
This course of events causes software to become an important aspect of vehicle development.<br />
Traditionally, automotive embedded software applications are comprised of small programs<br />
that run on a single device, thus being self-contained and not depending on systems outside<br />
of the vehicle. However, the amount and complexity of embedded software is rapidly<br />
increasing due to networks of embedded, interacting devices that communicate through various<br />
channels and bus systems [VSK05]. Furthermore, telematics applications sending data<br />
from and to the vehicle and the recent trend towards the integration of mobile devices with<br />
the vehicle contribute to the complexity and require a complex integration of the involved<br />
systems [NH08].<br />
The general goal in today’s embedded software development is to reduce the complexity<br />
of the system, to save development effort and to achieve a shorter time-to-market, while<br />
taking into account the requirements such as software modularity, customizability and extensibility<br />
[VSK05]. Thus, the issue of growing software complexity (see 2.1.1) holds also for<br />
the automotive industry. In the remaining parts of this section, selected work on deploying<br />
MDSD in the automotive domain is presented.<br />
A research roadmap for software engineering in automotive systems was devised in [PBKS07].<br />
Five different features of the automotive software domain are introduced. Their characteristics<br />
are mapped onto research issues, followed by a proposal of using MDSD to address some<br />
of the issues. The proposal identifies four types of models and elaborates each one in detail:<br />
10<br />
• Requirements models embrace all issues related to requirements and deal with the<br />
behavior of embedded software functions from the users’ point of view. The use cases<br />
and related behavior specifications are a part of the models.<br />
• The logical architecture represents a breakdown of the software functionality into inter-
2.1. Model-Driven Software Development<br />
acting logical components, including their behavior. The logical components provide<br />
functionalities described in the requirements model.<br />
• The technical architecture defines the deployment architecture, i.e. all hardware units,<br />
the basic software (operating system and middleware) on them and their connections -<br />
controllers, communication devices, actuators and sensors, as well as a mapping from<br />
the logical architecture (its structures and behaviors), to this deployment architecture.<br />
• Behavioral models specify the functionality at a detailed level and allow the generation<br />
of production, simulation and test code.<br />
The work in [NH08] is motivated by the increasing integration of external devices and external<br />
communication into the vehicle. The authors focus on developing a facility for modeldriven<br />
development of embedded software that enables modeling from multiple viewpoints.<br />
The viewpoints include the functional viewpoint, software structure viewpoint and humanmachine<br />
interface viewpoint. They achieve this by extending a modeling facility that has<br />
been proven successful in body electronics ECUs to the system level and the infotainment domain.<br />
Furthermore, they include the associated requirements for wireless connectivity. This<br />
way, they bring the different viewpoints together in a set of models. These models provide a<br />
possibility to handle the associated complexity and ensure the quality of the vehicle software.<br />
In [GHH04] the use of well-understood mathematical modeling frameworks that allow formal<br />
verification of a system is emphasized. The background idea is early detection of bugs and<br />
problems in order to achieve a more efficient embedded software development process. The<br />
developed model-driven process places strong emphasis on performance and as much testing<br />
and verification in tight-loops as possible. The models and controllers are framed in the<br />
context of hybrid automata.<br />
Software variability in automotive systems refers to deploying varying controller software<br />
on the same ECU (while maintaining the same principal software structure) according to<br />
different customer requirements. During product configuration (configuration of the ECU<br />
software according to customer needs), specific class variants have to be selected (see section<br />
3.1.2). Selecting the right combination of variants for a certain product is error-prone because<br />
of the vast number of variants. Knowledge about dependent variants and conflicting<br />
variants is currently not explicitly included in models, but it is up to the software engineers<br />
to be aware of such dependencies and to resolve them. A solution to this problem is proposed<br />
at system design level in [Gri08] by extending existing tools to allow explicit modeling of<br />
dependencies between variants through creating appropriate metamodels.<br />
A model-driven method for building embedded component infrastructures based on the<br />
combination of component/container infrastructures is developed in [VSK05]. In particular,<br />
automatic code generation is used to create infrastructure code required to make the<br />
application logic work in the context of the embedded system’s hardware infrastructure.<br />
Building a software infrastructure for embedded components is also one of the central issues<br />
addressed by AUTOSAR. This extensive application of MDSD in the automotive domain is<br />
concerned in this thesis and is presented in detail in chapter 3. In particular, AUTOSAR<br />
addresses the logical and technical architecture mentioned above.<br />
11
2. State of the Art<br />
2.2. Eclipse Modeling Framework<br />
The Eclipse Modeling Framework (EMF) is a utility for creating model definitions and modeling<br />
applications based on the Java programming language. As its name reveals, EMF<br />
exploits the facilities provided by the Eclipse Platform. EMF brings together Java, XML<br />
and UML: it allows to define and process models with any of these technologies. It also<br />
enables cross-transformations between these forms. EMF provides a runtime framework<br />
that can be used to validate, persist and edit any modeled data. Furthermore, it enables<br />
code generation of corresponding implementation classes, including Eclipse plugin artifacts.<br />
Figure 2.4 depicts how these features are organized into the EMF architecture. The features<br />
are described in detail throughout this section.<br />
EMF is not a high-level modeling technology, but rather places itself in the middle between<br />
the modeling and the programming worlds - to maximize the effectiveness of both<br />
[SBPM09]. An EMF model is essentially a subset of the UML class diagram. Even with this<br />
simple approach, the benefits of modeling in a standard Java development can be exploited<br />
to a great extent. Thus, EMF does not require a developer to understand complex mappings<br />
between high-level modeling concepts and the generated Java code, as the mappings<br />
are rather straightforward.<br />
Figure 2.4.: The EMF architecture (image adopted from [Ste08]).<br />
2.2.1. Ecore - the EMF metamodel<br />
The formal syntax of models in EMF - the EMF metamodel - is represented by the Ecore<br />
model. Ecore is itself an EMF model and therefore its own metamodel (see section 2.1.4).<br />
Ecore is inspired by OMG’s MOF and resembles it in its ability to specify classes, their<br />
structural and behavioral features, inheritance and reflection [SBPM09]. Ecore is situated<br />
at the Core of the EMF architecture in figure 2.4.<br />
12
2.2. Eclipse Modeling Framework<br />
In the following, some key aspects of the Ecore metamodel (see figure 2.5) will be described.<br />
• An groups related classes together in a package. Thus, EPackages are useful<br />
for structuring large models. When an Ecore model is serialized, the root element<br />
represents a package.<br />
• An models classes themselves. Classes are identified by name and can have a<br />
number of structural features, such as attributes and references. In order to support<br />
inheritance, a class can refer to one or more other classes as its supertypes. Abstraction<br />
is supported through respective EClass properties.<br />
• An is the common base class for EAttributes and EReferences.<br />
Both have a name and a type. EStructuralFeatures represent the components of<br />
an object’s data. They also define the state of an instance of the EClass they are<br />
contained in. Besides name and type, EStructuralFeatures have various properties<br />
that define them closely, such as upper and lower bounds, mutability, uniqueness etc.<br />
• An models the behavioral features of a class only by specifying interfaces<br />
to the operations (an actual behavior implementation can be supplemented through<br />
annotations).<br />
Figure 2.5.: An excerpt from the Ecore metamodel (image adopted from [Ste08]).<br />
EOperation is not displayed in this image.<br />
The structure of a domain model can be defined as an Ecore diagram (in an editor that<br />
is shipped with EMF, see figure 2.6), as XML or XML Schema Definition, as UML and<br />
as annotated Java. In each case EMF creates the corresponding Ecore model, which can<br />
then be used to automatically create model representations in all the other forms as well.<br />
13
2. State of the Art<br />
Finally, an Ecore model can be created directly as a model tree. Besides loading a model<br />
from a serialized form, a model can be created programmatically. Essentially, creating a<br />
model means specifying the types of objects that make up the model, their data and their<br />
relationships.<br />
EMF uses a model in two different contexts [SBPM09]. During application development<br />
it is the primary source of information for the EMF code generator which produces a Java<br />
implementation of the model. At runtime a model can be manipulated through EMF’s<br />
generic API (similarly to reflection in Java) and dynamically explored and processed by<br />
user-written code (see section 4.3.4).<br />
The AUTOSAR software component example that was specified as a UML class diagram<br />
in figure 2.1 can be created as an Ecore diagram. An Ecore diagram resembles the UML<br />
class diagram notation. From the Ecore diagram EMF automatically creates the tree view<br />
and the XMI representation of the model, just as it would have created a diagram and a<br />
tree view had the model been initially created in XMI format. These representations of the<br />
software component metamodel are shown in figure 2.6.<br />
2.2.2. Model persistence<br />
The ability to persist and reference other persisted models is a key feature of EMF modeling<br />
[SBPM09]. Therefore, EMF provides powerful mechanisms for managing persistence of<br />
models. Persistence is part of the Core of the EMF architecture in figure 2.4. Generally,<br />
Ecore models are serialized in the XML Metadata Interchange (XMI) format (see figure 2.6).<br />
EMF also supports saving objects in any persistent form - though this might require writing<br />
custom serialization code - and referencing the objects serialized in this custom format.<br />
2.2.3. Code generation<br />
The boost in productivity that results from automatic code generation is an important<br />
benefit of EMF [SBPM09]. The EMF code generator (represented by the Codegen part<br />
of the EMF architecture in figure 2.4) does not produce code directly from a particular<br />
Ecore model, but uses a generator model instead. The generator model wraps the original<br />
Ecore model and supplements data regarding implementation details that are necessary for<br />
code generation in addition to data contained in the original model. Figure 2.7 shows the<br />
generator model and the various properties that can be set to generate model code that<br />
complies to these properties.<br />
The generator uses various patterns (which reflect design decisions made by the EMF creators)<br />
to produce high-quality model code. This model code includes type-safe interfaces<br />
and efficient implementations for creating, modifying, saving and loading model instances.<br />
The EMF generator also takes manual editing of generated code into account and provides a<br />
means to regenerate model code without overwriting manual changes. The generated model<br />
artifacts include (but are not limited to) the following [SBPM09]: for each model a factory<br />
and a package are generated that provide a create method for instantiating each modeled<br />
class and accessors to Ecore model metadata. These artifacts serve as an entry point for<br />
model reflection. Furthermore, for each class a corresponding interface and implementation<br />
14
2.2. Eclipse Modeling Framework<br />
Figure 2.6.: Three representations of the simplified AUTOSAR software component metamodel:<br />
Ecore diagram (up left), Ecore tree view (up right) and the XMI serialization<br />
format (down).<br />
15
2. State of the Art<br />
Figure 2.7.: The generator model (up left) and code generation properties (down) for the<br />
software component model (up right).<br />
16
2.2. Eclipse Modeling Framework<br />
class are generated. The separation between interface and implementation is a design favored<br />
by the creators of EMF: it is the best pattern for a model API and complies with<br />
design choices found in Eclipse itself. The generated methods for structural features contain<br />
not only the getter-and-setter stubs, but also observer notification implementations (as in<br />
listing 2.2) and support bidirectional reference integrity.<br />
Internally, the generator uses templates that can be extended by the user if needed (or<br />
completely replaced by fully customized ones, thus creating an own generator). The Java<br />
Emitter Templates (JET) that are used in the EMF generator consist of fixed content -<br />
that is meant to be output exactly as it appears - and of Java Server Pages (JSP)-like tags<br />
that are evaluated and interpreted by the template engine while processing model elements<br />
[SBPM09].<br />
The interface and implementation of the SoftwareComponent class generated from the corresponding<br />
generator model are given in listings 2.1 and 2.2 respectively. Essentially, all<br />
the generated artifacts together comprise the software component model API. This model<br />
API can be used to create and manipulate instances of software components, ports and port<br />
interfaces in a Java program. Further examples of how the model API can be used is given<br />
in section 3.2.2. The prototype that implements the automation concept developed in this<br />
thesis (see section 4.3) also uses a model API to programmatically explore a model instance<br />
(and create a new model based on found information).<br />
...<br />
SoftwareComponent EObject {<br />
}<br />
String getName ();<br />
setName ( String value );<br />
String getType ();<br />
setType ( String value );<br />
EList getPorts ();<br />
Listing 2.1: Generated interface for the SoftwareComponent class. Generated imports and<br />
comments have been omitted for clarity.<br />
...<br />
SoftwareComponentImpl EObjectImpl<br />
SoftwareComponent<br />
{<br />
...<br />
EList ports ;<br />
17
2. State of the Art<br />
}<br />
SoftwareComponentImpl () {<br />
();<br />
}<br />
String getName () {<br />
name ;<br />
}<br />
setName ( String newName ) {<br />
String oldName = name ;<br />
name = newName ;<br />
( eNotificationRequired ())<br />
eNotify ( ENotificationImpl ( , Notification .SET ,<br />
SwcomponentsPackage . SOFTWARE_COMPONENT__NAME , oldName ,<br />
name ));<br />
}<br />
...<br />
EList getPorts () {<br />
( ports == ) {<br />
ports = EObjectContainmentEList ( Port . ,<br />
, SwcomponentsPackage . SOFTWARE_COMPONENT__PORTS );<br />
}<br />
ports ;<br />
}<br />
...<br />
Listing 2.2: Generated implementation for the SoftwareComponent class. Generated<br />
imports, comments and optimization methods have been omitted for clarity.<br />
Additionally the EMF generator produces a set of classes that utilize EMF.Edit (depicted in<br />
figure 2.4). These generated classes can be used to build a visual model editor. The editor<br />
can be used for creating and editing models and can be easily integrated into the Eclipse<br />
framework as an Eclipse plugin. The editor can be enriched with custom functionality and<br />
model functions specific to the model domain (i.e. a JET template could be written that<br />
produces C code from modeled AUTOSAR software components - this could be offered in<br />
the editor as a code generation function). Figure 2.8 shows the generated editor for the<br />
software component model.<br />
The final result is a visual domain-specific language (see section 2.1.4) for modeling simple<br />
AUTOSAR software components that consists of a visual editor and the corresponding functionality<br />
required to create and edit software component models.<br />
In a fashion similar to the simplified software components example, Artop (see section 3.2)<br />
exploits the power of EMF to create a DSL (and a full-scale framework) for modeling complete<br />
AUTOSAR systems.<br />
18
2.2. Eclipse Modeling Framework<br />
Figure 2.8.: The software component model editor generated with EMF and integrated into<br />
the Eclipse framework. The editor features a software component with two ports<br />
that define a port interface.<br />
2.2.4. EMF Compare<br />
EMF Compare is a model comparison facility for Ecore models. Models evolve due to changes<br />
in their domain and these changes may be performed by a number of people involved in the<br />
modeling process. The need to identify these changes and access model history arises, thus a<br />
model comparator becomes an essential tool in MDSD (see role of tools in MDSD in section<br />
2.1.4) [Tou06]. The EMF Compare tool provides a stable, generic model comparison implementation<br />
that can be used out-of-the-box, but at the same time it has been designed with<br />
extensibility in mind. Therefore, every part of the comparison process is extensible and can<br />
be customized according to user needs [emfa, Bru]. Figure 2.9 illustrates the comparison<br />
process and emphasizes parts that can be customized. The DiffMap project (see section 4.2)<br />
utilizes the extension possibilities of EMF Compare and customizes the diff builder and diff<br />
extension parts of the process depicted in figure 2.9.<br />
Currently, EMF Compare supports comparison of two or three models at most. The comparison<br />
process consists of two phases. In the matching phase, one model is browsed through<br />
while for each of its elements a corresponding element is searched for in the opposite model.<br />
The result of the matching process is presented in a match model. The differencing phase<br />
uses the match model and identifies the differences between matched elements to produce a<br />
diff model. The diff model then holds change information across the compared models. The<br />
diff model can be extended according to domain and user specific needs (see section 4.2.1)<br />
[Bru08].<br />
19
2. State of the Art<br />
Figure 2.9.: The EMF Compare process. Artifacts colored red can be customized to match<br />
specific user needs (image adopted from [Bru08]).<br />
The match engine is crucial in the comparison process as it determines the quality of the final<br />
comparison result. The generic match engine that ships with EMF Compare (and that was<br />
used in the DiffMap project, see section 4.2) is based on total comparison of the attributes<br />
of a model element and goes back to the fundamentals of information theory [Tou06]. In<br />
particular, it considers the name, content, type and relations of an element in order to<br />
determine similarity [Bru08].<br />
2.3. Model evolution<br />
Evolution is an omnipresent aspect of software development which affects the whole software<br />
life cycle and spans across different artifacts involved in creating software. Model-driven<br />
software development is subject to software evolution as well. In [Bre10], the concept of<br />
living models is introduced. This paradigm is used to define model-driven management,<br />
design and operation of dynamically evolving systems. With an emphasis on metamodel<br />
and model evolution, current research in this area is concerned with two issues that can be<br />
considered complementary:<br />
20<br />
• Model versioning is an important task in MDSD. However, tools and techniques to<br />
support model versioning and change management are not as commonly available as<br />
they are for other software artifacts, such as text-based systems used for versioning<br />
source code. Crucial model versioning questions are the comparison of models and the<br />
representation of the comparison result [Gru06].
2.3. Model evolution<br />
• Model adaption is the necessary response to metamodel evolution. As metamodels<br />
evolve due to changing requirements or refactorings during the development process,<br />
models need to be migrated to prevent invalidity and retain compatibility with regards<br />
to the evolved metamodel.<br />
In the following sections selected approaches to solve these issues are presented in more<br />
detail. Some open questions in model versioning and adaptation are summarized. Where<br />
appropriate, references to the subject of this thesis are given.<br />
2.3.1. Model versioning<br />
Current widely used version control systems (such as SVN [relc]) and their storage and visualization<br />
features rely upon the line-based comparison of a stream of text contained in<br />
a single file. This approach works well for artifacts such as source code. When applied to<br />
models, the only way to archive a model is to convert it into a linear file, usually an XML<br />
representation (see section 2.2.2). This however destroys the intuitive model hierarchy, as<br />
hierarchy and containment in models are replaced by links and references within the XML<br />
document. In order to acquire information from the comparison result, a model developer<br />
must browse through the XML documents and search for tags that denote change, while<br />
having to possibly mentally convert XML data back to a structured model representation.<br />
Hence archiving and versioning models requires an approach that will take into account the<br />
model structure directly. Thereby, model comparison and visualization of model differences<br />
are the central questions [LZG04]. A model-centric versioning system was developed in<br />
[Kal10], which will be explained in more detail later.<br />
Model comparison is required to detect changes between different models. In version<br />
control systems, one wants to track changes caused by evolutionary development. In the<br />
GAUTOSAR project (see section 3.3), the identification of changes is necessary to determine<br />
a common, generic model respective of all compared models. In both cases, manual<br />
comparison is tedious, time-consuming and error-prone (see section 4.1). The question that<br />
arises first is what properties of the models should be compared, followed by the question of<br />
how to define the mappings between two models [LZG04]. The EMF Compare framework,<br />
which was used in work dealing with GAUTOSAR, considers the name, content, type and<br />
relations of a model element in order to determine similarity (see section 2.2.4). Furthermore,<br />
section 4.2.4 describes AUTOSAR-specific comparison issues that arose during the<br />
course of this thesis.<br />
Visualizing model differences requires a different approach than parallel visual mapping<br />
of differences that is common for text files since linear files cannot sufficiently represent<br />
the hierarchical nature of models. The visualization technique is crucial for providing a fast<br />
and understandable overview of changes between model versions. A common technique is<br />
coloring, where different colors are used to indicate different types of changes. Coloring is<br />
also used in the approach of [Kal10], which will be discussed in the following paragraph. The<br />
DiffMap project (see section 4.2), which is concerned with model comparison in GAUTOSAR<br />
and which this thesis builds upon, uses history elements to model changes in a historical<br />
context at the position where they occurred in a model (see sections 4.2.1 and 4.2.2).<br />
21
2. State of the Art<br />
A model-centric versioning system was developed in [Kal10]. It is a model repository<br />
for UML models with emphasis on model merging. The motivation behind the development<br />
of a model repository is the current lack of such tools. EMF Compare was customized for<br />
UML models (compare with DiffMap’s extensions to EMF Compare in section 4.2.1). In<br />
particular, it was used to compare the HEAD version of a model stored in the repository<br />
with the model being committed. The results are presented to the user in a UI which uses<br />
colors to denote differences. The user can initiate the merge of some or all model elements<br />
through EMF Compare. The result is presented in a diffModel. These functions are all part<br />
of a client tool. On the server side, it was attempted to use the EMF Compare diff model<br />
as a symmetric delta and thus the central versioning entity in the repository. This approach<br />
was abandoned in favor of EPatch [rela], which is further described in the next section.<br />
An approach to comparing models which conform to arbitrary metamodels is developed<br />
in [RV08] by using the Maude specification language [relb]. Maude is used to define<br />
a difference metamodel and a set of operations that provide support for calculating<br />
differences, composing simple differences to complex ones and applying model differences<br />
to perform model migration. In Maude, models are represented by object configurations,<br />
while metamodels are represented by object-oriented modules. This way, models conform to<br />
metamodels by construction. The difference model distinguishes between element addition,<br />
deletion and modification, but does not reflect elements that have not changed. This is in<br />
contrast to the EMF Compare difference model and its extensions by DiffMap (see section<br />
4.2.1): there, unchanged elements are included in the difference model with a ”clear” history.<br />
This approach has two advantages. On one hand, a domain expert examining the DiffMap<br />
model is presented a model as a whole and thus it is easier to mentally map it to the original<br />
model. On the other hand, GAUTOSAR is primarily concerned with model elements which<br />
feature no or little change in order to fulfill its goals (see section 3.3 for details). What is<br />
similar to EMF Compare is the calculation of differences in a matching and a differencing<br />
step. Matching can be performed in two ways. Since Maude objects have persistent identifiers,<br />
one possibility is to match objects comparing these identifiers. However, if the two<br />
models conform to different metamodels then two elements that are semantically the same<br />
will most likely not have the same identifier. This problem occurred within this thesis and is<br />
described in more detail in section 4.2.3. Thus, the other possibility is to match objects by<br />
using structural similarities (as EMF Compare does), which is again implemented in Maude.<br />
2.3.2. Model adaptation<br />
Manual model adaptation essentially suffers from the same peculiarities as manual model<br />
comparison described above. Moreover, metamodels may evolve in different ways: where<br />
some changes are independent from other elements and thus require no or limited model<br />
revision, other changes can lead to inconsistencies that cannot be easily and automatically<br />
resolved. With regard to these findings, the possible changes have been classified as follows:<br />
[CDREP08, Gru06]<br />
22<br />
• non-breaking changes: changes in the metamodel which do not break the consistency<br />
of the model to the corresponding metamodel.<br />
• breaking and resolvable changes: changes in the metamodel which break the consistency<br />
of the model, but can be automatically resolved.
2.3. Model evolution<br />
• breaking and non-resolvable changes: changes in the metamodel which break the consistency<br />
of the model and cannot be automatically resolved. These changes require<br />
manual intervention by a domain expert.<br />
The concept of non-breaking and breaking changes can also be found in API evolution and<br />
the way it influences programs that make use of the API. An example for a non-breaking<br />
API change is the addition of a method in some class: this change does not break the existing<br />
instances of the class. The renaming of a method is an example for a breaking change: it<br />
breaks the program code that invokes this method by its old name because the code fails to<br />
compile. The code has to be adapted to use the new method name before it can compile<br />
successfully.<br />
The DiffMap model can be used as an information source for adapting AUTOSAR models<br />
to new versions of the AUTOSAR metamodel. This requires a transformation program<br />
that will adapt AUTOSAR models by utilizing metamodel change information found in the<br />
DiffMap model. However, this is not in the scope of GAUTOSAR and will not be further<br />
discussed in this thesis.<br />
OMG M-levels concept (see section 2.1.4) is used to elaborate on frequency and impact<br />
of model change in [Gru06]. M3 models represent modeling tools that are independent<br />
of the problem domain. As such, they are considered unchangeable from the point of view of<br />
the software solution and its life cycle. Changes to M2 models follow from insights into the<br />
problem domain as the software project evolves. These changes may cause inconsistencies<br />
in M1 models. M1 models are changed on a daily basis. Therefore, a need for a catalog of<br />
changes on M2 level and their influence on M1 level is identified. This catalog should be used<br />
to create algorithms for automated break resolution. Such catalogs have been constituted<br />
with varying levels of detail in [CDREP08], [BGGK07] and [HVW11].<br />
Co-adaptation is a term coined in [CDREP08] to describe model adaptation required upon<br />
metamodel change. Furthermore, a transformational approach for model co-adaptation is<br />
proposed where well-defined adaptation steps can be automatically generated from modifications<br />
that the metamodel underwent. In order to facilitate this, a difference model of the<br />
metamodels is exploited to co-adapt the depending models. This difference model consists<br />
of all manipulation operations from the original metamodel to the evolved metamodel. This<br />
method of detecting change is known as recording the metamodel change trace, in contrast<br />
to direct comparison method used in EMF Compare (see section 2.2.4). A discussion of<br />
advantages and disadvantages of both approaches is given in [BGGK07] and [Eys08].<br />
The work in [Eys08] explores the change tracing method in more detail and utilizes wellknown<br />
technologies such as the observer pattern and existing EMF utilities to implement<br />
this method in a patch. A patch is an EMF model that serves as a difference model where<br />
changes are described as atomic primitives, which enables transforming the old metamodel<br />
to the new one and vice-versa. The atomic primitives are then grouped into composite<br />
changes and augmented with information required for the co-adaptation algorithm. The<br />
patch technology was used for the development of the model versioning system in [Kal10]<br />
(see section 2.3.1).<br />
23
2. State of the Art<br />
The COPE (COuPled Evolution of metamodels and models) project developed from a thesis<br />
done at BMW Car IT [Her07]. The term coupled evolution is used to describe the process<br />
of breaking down metamodel history into small steps of metamodel evolution and the associated<br />
model adaptation. In more detail, it is denoted that some primitive changes only make<br />
sense when regarded in combination with others, such as the migration of a class attribute<br />
to the superclass. In this case, primitive changes need to be combined and interpreted as<br />
a compound change. Coupled evolution steps can be divided in the same way as the types<br />
of changes referenced at the beginning of this section. The evolution steps can be complete<br />
if no manual interaction is necessary to correctly adapt a model or incomplete otherwise.<br />
Furthermore, the evolution steps are open if domain-specific knowledge is necessary to fully<br />
adapt the model and closed otherwise. This distinction is equivalent to the distinction between<br />
automatic and semi-automatic adaptation. For open coupled evolution, the approach<br />
consists of maintaining metamodel history as a sequence of changes that lead from an empty<br />
metamodel to the current version. In the course of evolution history, previous versions of<br />
the metamodel are constructed at some point in time. Then model transformation rules in<br />
a sufficiently expressive language can be attached to any number of primitive metamodel<br />
changes. Closed coupled evolution provides a mechanism to specify transformation rules in<br />
form of coupled evolution operations independently of the metamodel, which can then be<br />
instantiated and applied in a model adaptation template.<br />
2.4. Summary<br />
This chapter explained the events that led to the increased complexity of modern software<br />
systems and how models can be used to tackle this issue. Examples from the automotive<br />
industry were used to illustrate applications of the model-driven approach. Capabilities of<br />
the Eclipse Modeling Framework were explored in the context of creating a modeling tool<br />
for basic AUTOSAR software components. The chapter was concluded with an overview<br />
of model evolution, its common problems and research directions aiming at solving these<br />
problems.<br />
24
3. Automotive Open System Architecture<br />
This chapter introduces specialized technologies that rely on model-driven software development<br />
to solve the complexity issue in developing automotive software. These technologies<br />
represent the scope of work concerned in this thesis.<br />
3.1. The AUTOSAR standard<br />
AUTOSAR (AUTomotive Open System ARchitecture) is an open standard that applies the<br />
model-driven approach (see section 2.1) to software development for Electronic Control Units<br />
(ECUs) in automobiles. AUTOSAR is motivated by the increasing complexity of modern<br />
automotive electric and electronic (E/E) architecture (see section 2.1.5). In order to manage<br />
this complexity, automobile manufacturers, suppliers and tool developers have formed a development<br />
partnership that cooperates on developing common, basic functions and supports<br />
competition on innovative functions [Hei04]. The ability to manage this complexity results in<br />
improved quality and reliability of automotive E/E systems. Furthermore, the AUTOSAR<br />
development partnership aims at creating scalable solutions that can be reused within and<br />
across vehicle and component product lines and at an improved development process.<br />
3.1.1. AUTOSAR architecture<br />
The AUTOSAR architecture (see figure 3.1) provides a common software infrastructure for<br />
automotive systems of all vehicle domains. It consists of multiple software layers that build<br />
up on each other and are interconnected through standardized interfaces.<br />
This approach is considered fundamental to achieving the following technical goals: [Hei04,<br />
AUT11c]<br />
• Modularity: enables combining functional modules from different suppliers.<br />
• Scalability: ensures compatibility of common software modules to different vehicle<br />
platforms.<br />
• Transferability: optimizes the use of resources throughout the electronic architecture<br />
of a vehicle.<br />
• Reusability: enables integration of software modules into new environments.<br />
The remaining part of this section describes the essential concepts of the AUTOSAR architecture<br />
in more detail.<br />
25
3. Automotive Open System Architecture<br />
Figure 3.1.: AUTOSAR ECU architecture (image adopted from [AUT11b]).<br />
AUTOSAR Software<br />
The AUTOSAR design concept distinguishes between application and infrastructure. Thus,<br />
an application in AUTOSAR consists of interconnected AUTOSAR software components -<br />
each of which implements a part of the application functionality - and runs on the AUTOSAR<br />
infrastructure [AUT11d]. The software components have well-defined interfaces that are<br />
described through a standardized description format: [AUT10a]<br />
• operations and data elements the component provides and requires<br />
• requirements of the software component on infrastructure<br />
• resources needed by the software component (such as memory and CPU time)<br />
• information about specific implementation of the component<br />
By specifying provided and required data and services in this fashion software components<br />
can be exchanged as long as they provide the same communication interface. Furthermore,<br />
a software component is uncoupled from other software components in the sense that it does<br />
not require knowledge about whether it communicates with software components from the<br />
same (local communication) or from different ECUs (remote communication). The implementation<br />
of the software component is thus independent of the used network technology.<br />
The communication takes place through interfaces that are specified through ports, where<br />
a port is always assigned to only one component [AUT11d]. An interface can be either a<br />
client-server interface - by defining operations that can be used, or a sender-receiver interface<br />
- enabling data-oriented communication. If the client-server paradigm is used, a component<br />
providing an interface offers an implementation of the operations specified in the interface<br />
26
3.1. The AUTOSAR standard<br />
whereas a requiring component can invoke the operations. Equivalently, if a sender-receiver<br />
paradigm is used, a providing port generates the data whereas a receiving port consumes it.<br />
Virtual Functional Bus and Runtime Environment<br />
The Virtual Functional Bus (VFB) is a theoretical concept that represents an abstraction of<br />
the connections between AUTOSAR software components of the entire vehicle and between<br />
AUTOSAR software components and the components of the basic software. The VFB enables<br />
AUTOSAR software components to be integrated before the underlying ECU hardware<br />
is available, thereby speeding up the vehicle development process. The AUTOSAR runtime<br />
environment (RTE) functions as a communication center for both inter-ECU and intra-ECU<br />
information exchange that takes place between AUTOSAR software components [AUT10b].<br />
Since these communication requirements depend on the deployment, the RTE needs to be<br />
customized for each ECU. Therefore, it can be seen as a realization of the VFB on a specific<br />
ECU.<br />
Basic software<br />
The basic software provides services to the AUTOSAR software components and is required<br />
to run the application part of the software, but it does not fulfill any functional tasks itself<br />
[Hei04]. The basic software consists of standardized components - such as an operating<br />
system, a communication framework to the vehicle bus systems (CAN, FlexRay etc.), access<br />
to the ECU’s microcontroller and other hardware such as sensors and actuators that are<br />
specific to each individual ECU.<br />
3.1.2. AUTOSAR methodology<br />
The AUTOSAR methodology describes the common technical approach for steps that are<br />
necessary for AUTOSAR system development [AUT11a]. Figure 3.2 shows a broad view of<br />
the design steps from system configuration to generating an ECU executable. The methodology<br />
is formalized as a workflow that defines dependencies between documents containing<br />
information and activities processing that information.<br />
Figure 3.2.: Overview of the AUTOSAR methodology (image adopted from [AUT11a]).<br />
The formal description of the contained information is supported by the AUTOSAR metamodel<br />
(see section 3.1.3). The activities involve complex processing of a large amount of<br />
27
3. Automotive Open System Architecture<br />
data stored in the documents. Thus, the AUTOSAR methodology requires support through<br />
complex tools that allow a high degree of automation (see section 3.2).<br />
The System Configuration Input document in figure 3.2 defines the software, the hardware<br />
and the general system constraints. In particular, it requires for each software component<br />
a description of data types, ports and interfaces, for each ECU the specification of the<br />
processor unit, the memory, the sensors and actuators etc. The Configure System activity<br />
maps the software components to the ECUs and produces the System Configuration<br />
Description document. The Configure ECU activity, after extracting necessary information<br />
in the respective preceding steps, deals with the configuration of the RTE and Basic<br />
software modules. It results in the ECU Configuration Description, which contains all<br />
information specific for an individual ECU. Finally, Build Executable involves generating<br />
code for the RTE and the Basic software, compiling these sources and linking everything<br />
into an executable.<br />
The implementation of software components is independent from ECU configuration [AUT11e].<br />
Figure 3.3 depicts the workflow that allows the development of a software component’s core<br />
functionality.<br />
Figure 3.3.: AUTOSAR methodology for software component implementation (image<br />
adopted from [AUT11a]).<br />
The Component Internal Behavior Description describes aspects such as scheduling issues<br />
and how a component responds to events, but does not specify any functional behavior.<br />
The Generate Component activity creates header declarations necessary for RTE communication.<br />
In the Implement Component activity a developer can utilize the information<br />
28
3.1. The AUTOSAR standard<br />
contained in the Component Internal Behavior Description and Component API documents<br />
to develop functional aspects of the component. This can be done independently<br />
from the design of the rest of the system. The functionality of the component is contained<br />
in the Component Implementation Description. The Compile Component activity uses<br />
the Component Implementation Description to compile the Component Implementation.<br />
Additionally the activity requires the Component API and the Additional Headers documents<br />
to complete the compilation process. The result of the Compile Component activity<br />
is the Compiled Component document and a refined Component Implementation<br />
Description.<br />
3.1.3. AUTOSAR metamodel<br />
The data contained in the documents that are utilized within the AUTOSAR methodology<br />
(see section 3.1.2) is supported through the use of an AUTOSAR metamodel and the accompanying<br />
templates 1 . The metamodel describes the structure of all components that compose<br />
the AUTOSAR architecture, i.e. software components (depicted in figure 3.4), ECU configuration<br />
and basic software modules. The templates describe the respective parts of the<br />
metamodel in more detail [AUT09].<br />
Figure 3.4.: Detailed view of the AUTOSAR metamodel in [autb] describing different types<br />
of software components in AUTOSAR and their relationships.<br />
1 The metamodels and the templates are available at the official AUTOSAR website. The metamodels are<br />
described in terms of UML diagrams and available as Sparx Systems Enterprise Architect Project files.<br />
29
3. Automotive Open System Architecture<br />
The AUTOSAR standard is subject to constant improvement. This causes the corresponding<br />
metamodel to evolve as well. Each new release of the AUTOSAR standard brings with it<br />
evolutionary modifications of the metamodel. If one compares the respective metamodels<br />
of AUTOSAR versions 3.1 ([auta]) and 4.0 ([autb]), one will notice structural changes in<br />
both parts describing the overall structure and very detailed parts of the metamodel. One<br />
metamodel always belongs to only one version of the AUTOSAR standard.<br />
3.2. Artop<br />
Developing AUTOSAR systems (see section 3.1.2) is supported through the use of appropriate<br />
tools. All these tools must cover basic functionality related to handling AUTOSAR<br />
models. A simple example is the ability to load an AUTOSAR model into the memory so it<br />
can be manipulated through tool functions. The specific functionality of the tool vendor’s<br />
area of expertise can be built on top of the common functions. However, with every tool<br />
vendor implementing the common AUTOSAR functionality on their own, a great deal of<br />
redundant development occurs among the vendors [KRV + 10b]. This approach is illustrated<br />
on the left hand side in figure 3.5. Artop (AUTOSAR Tool Platform) addresses this by<br />
applying the ecosystem approach to the field of AUTOSAR tools in a way that resembles<br />
ecosystems found in open-source projects [KRV + 10a]. An ecosystem in this sense refers to a<br />
concept where the value of products and services of the ecosystem participants complement<br />
each other. Such an organization implies the requirement for using common technologies<br />
and standards. This approach is illustrated on the right hand side in figure 3.5.<br />
Figure 3.5.: Non-collaborative and collaborative AUTOSAR tool development approach in<br />
comparison (image adopted from [KRV + 10b]).<br />
Artop is an infrastructure platform for tools used to design, develop and configure AUTOSAR<br />
systems which provides an implementation of common tool functionality. The community<br />
developing Artop - the Artop User Group - consists of AUTOSAR members and partners.<br />
This way Artop offers both an organizational and a technical advantage: an improved cooperation<br />
with AUTOSAR partners as well as a high interoperability and integration of<br />
AUTOSAR tools [Rud10].<br />
For a better understanding of how Artop works and its role in the AUTOSAR world, the<br />
Artop stakeholders are presented:<br />
30<br />
• Artop developers are the immediate creators of the infrastructure platform that<br />
constitutes Artop and that is defined in this section. Artop developers comprise the<br />
Artop User Group layer of the Artop architecture in figure 3.6.
3.2. Artop<br />
• Artop users or AUTOSAR tool developers utilize the infrastructure provided by<br />
Artop developers to create vendor-specific tools. AUTOSAR tool developers comprise<br />
the Tool Vendor layer of the Artop architecture in figure 3.6.<br />
• AUTOSAR tool users work with tools provided by AUTOSAR tool developers to<br />
create AUTOSAR models. Such tools are comprised of all the layers of the Artop<br />
architecture in figure 3.6.<br />
3.2.1. Artop architecture<br />
Artop builds upon the Eclipse Platform and makes heavy use of the Eclipse Modeling Framework<br />
(see section 2.2) to create an infrastructure for realizing AUTOSAR tools. Where an<br />
adaption of existing Eclipse technologies is necessary, Artop provides a set of extensions to<br />
the respective Eclipse projects. Figure 3.6 shows the different layers of the Artop architecture:<br />
[Rud10]<br />
• Competitive Layer. Tool vendors commercially develop plugins at this level and<br />
realize their tool functionality by using the infrastructure provided by Artop.<br />
• Artop AUTOSAR Layer. This layer provides software components and plugins<br />
that implement AUTOSAR-specific functionality.<br />
• Artop Eclipse Complementary Layer. This layer implements Artop’s extensions<br />
to the Eclipse platform, but does not contain any AUTOSAR specific functions. Since<br />
Artop release 3.0 this layer has become a part of the Eclipse Sphinx project [sph] and<br />
is located in the Eclipse Platform layer.<br />
• Eclipse Platform. Eclipse is well-suited for developing domain-specific IDEs, hence<br />
it is used as Artop’s foundation.<br />
Figure 3.6.: Layers composing the Artop architecture (image adopted from [Rud10]).<br />
31
3. Automotive Open System Architecture<br />
3.2.2. Developing AUTOSAR tools with Artop<br />
The Artop architecture contains implementations of AUTOSAR metamodel releases and enables,<br />
among other related AUTOSAR services, creation and editing of AUTOSAR models<br />
in a visual editor (as depicted in figure 3.7) [Rud10]. As mentioned in section 3.1.3, the<br />
AUTOSAR metamodel is subject to evolution. Artop aims at supporting a number of metamodel<br />
versions rather than just one. A wide support approach - together with functionalities<br />
that add value to the tools that make use of Artop - ensures a greater acceptance of Artop<br />
in the AUTOSAR community and especially among AUTOSAR tool developers.<br />
Figure 3.7.: Two models created with the Artop Technology Demonstrator - an Eclipse-based<br />
AUTOSAR tool which was built by the Artop community to showcase Artop’s<br />
capabilities. The same is also possible in any AUTOSAR tool that makes use<br />
of Artop.<br />
In the background Artop provides a model API that can be used to build and process an<br />
AUTOSAR model. Furthermore, the API can be used to manipulate AUTOSAR models<br />
through creating useful complementary tool functions. The API code is automatically<br />
generated from the AUTOSAR metamodel for each AUTOSAR version (see section 2.2.3).<br />
The version-specific APIs, although similar in content, are distinctive from each other. The<br />
reason for this lies in the fact that the APIs originate from different metamodels, which<br />
represent different AUTOSAR version releases. Figure 3.8 illustrates the generation of API<br />
code from the version-specific metamodels.<br />
32
3.2. Artop<br />
Figure 3.8.: Version-specific generation of AUTOSAR API code from the respective AU-<br />
TOSAR metamodels.<br />
This situation requires the tool developer to implement the same tool functionality separately<br />
for each AUTOSAR version. Consider an example where Artop should offer a function on a<br />
QueuedReceiverComSpec model element 2 from figure 3.7 that requires reading the value of<br />
its Queue Length property. The code will look like illustrated in listing 3.1:<br />
( element autosar21 . swcomponent . communication .<br />
QueuedReceiverComSpec ) {<br />
queuedReceiver_21 = ( autosar21 . swcomponent . communication .<br />
QueuedReceiverComSpec ) element ;<br />
qrValue = queuedReceiver_21 . getQueueLength ();<br />
...<br />
} ( element autosar3x . swcomponent .<br />
communication . QueuedReceiverComSpec ) {<br />
queuedReceiver_3x = ( autosar3x . swcomponent . communication .<br />
QueuedReceiverComSpec ) element ;<br />
qrValue = queuedReceiver_3x . getQueueLength ();<br />
...<br />
} ( element autosar40 . swcomponent .<br />
communication . QueuedReceiverComSpec ) {<br />
2 The semantics of this element is irrelevant here, but can be found in the appropriate AUTOSAR template.<br />
33
3. Automotive Open System Architecture<br />
}<br />
queuedReceiver_40 = ( autosar40 . swcomponent . communication .<br />
QueuedReceiverComSpec ) element ;<br />
qrValue = queuedReceiver_40 . getQueueLength ();<br />
...<br />
Listing 3.1: Implementing the same functionality for different metamodel versions in an<br />
Artop-based AUTOSAR tool.<br />
This approach obviously requires redundant work from the tool developer, while the code<br />
becomes unclear and is error-prone. Each time a new version of the AUTOSAR standard is<br />
released, the code will have to be replicated for that version, making the situation even worse.<br />
Ideally, Artop would provide the tool developer with a possibility to implement functionality<br />
that involves certain parts of the metamodel only once. This refers to parts of the metamodel<br />
that have remained unchanged or feature only minor changes across different AUTOSAR<br />
versions. Furthermore, Artop would provide a way to integrate the existing functionality<br />
into APIs for new releases. This idea has been dealt with in the GAUTOSAR project, which<br />
is introduced in the next section.<br />
3.3. The Generic AUTOSAR concept<br />
The GAUTOSAR (Generic AUTOSAR) project arose from the idea of not having to write<br />
repetitive code for each AUTOSAR version API while implementing the same functionality<br />
on semantically identical model elements (see listing 3.1). The main purpose of GAUTOSAR<br />
is to relieve the AUTOSAR tool developer of this problem by providing means to implement<br />
the same functionality only once. This section introduces the GAUTOSAR concept. The<br />
realization of the concept is presented in detail in chapter 4.<br />
3.3.1. GAUTOSAR metamodel<br />
The GAUTOSAR metamodel encompasses model elements that are common to all versionspecific<br />
AUTOSAR metamodels. A unique API code is generated from the GAUTOSAR<br />
metamodel. This generic API code can then be referred to from existing AUTOSAR APIs<br />
and also reused in future AUTOSAR releases, given that the same model element in the<br />
new release can be represented by the current GAUTOSAR metamodel. Figure 3.9 depicts<br />
this idea. For model elements that are specific to each metamodel and thus cannot be<br />
represented in the GAUTOSAR metamodel, the version-specific API can still be used for<br />
realizing functionality on these elements.<br />
The GAUTOSAR metamodel is subject to a specific naming convention that makes it easy<br />
for tool developers to associate the generic model elements with their version-specific counterparts.<br />
At the same time, it enables a clear distinction between generic and version-specific<br />
model code. As the name GAUTOSAR implies, the naming convention consists of adding<br />
a prefix to model element names that is based on the ”keyletter” g. An overview of the<br />
naming convention for each model element type is given in table A.1 in the appendix.<br />
34
Figure 3.9.: The principle of Generic AUTOSAR.<br />
3.3.2. Implementing tool functionality with GAUTOSAR<br />
3.3. The Generic AUTOSAR concept<br />
With GAUTOSAR, implementing functionality depicted in listing 3.1 works as follows: for<br />
each generic class in the model, an appropriate interface is generated as depicted in listing<br />
3.2:<br />
gautosar . gswcomponents . gcommunication ;<br />
GQueuedReceiverComSpec<br />
{<br />
Integer gQueueLength ;<br />
}<br />
Integer gGetQueueLength ();<br />
Listing 3.2: The generic interface representing a QueuedReceiverComSpec object.<br />
Instead of repeating code that embodies the desired functionality for each AUTOSAR version<br />
as in listing 3.1, the code can be written only once - by using the generic method provided by<br />
the generic interface. This way, at the time of implementation, the tool developer does not<br />
require any knowledge about how many AUTOSAR versions are supported in the current<br />
Artop release or in which version a tool user might build a model:<br />
35
3. Automotive Open System Architecture<br />
...<br />
qrValue = element . gGetQueueLength ();<br />
...<br />
Listing 3.3: The actual implementation of the desired functionality reading the value of the<br />
queueLength property.<br />
The functionality in listing 3.3 does not need to be changed as long as its semantics remains<br />
the same and the GQueuedReceiverComSpec is still an element in the generic metamodel. If<br />
changes to the function are required, they only need to be incorporated at this site.<br />
In the background, the classes representing the QueuedReceiverComSpec object in each<br />
version-specific API all implement the generic GQueuedReceiverComSpec interface from listing<br />
3.2 and provide the value of its actual queueLength property:<br />
autosar21 . swcomponent . communication ;<br />
QueuedReceiverComSpec <br />
GQueuedReceiverComSpec {<br />
}<br />
Integer gGetQueueLength () {<br />
getQueueLength ();<br />
}<br />
Integer getQueueLength () {<br />
queueLength ;<br />
}<br />
Listing 3.4: Integration of the generic interface into a version-specific API (here the 2.1 API).<br />
3.4. Summary<br />
This chapter introduced the principles of AUTOSAR, a standardized architecture for modeldriven<br />
development of automotive control software. Artop was introduced as an infrastructure<br />
platform for creating tools that enable developing AUTOSAR systems. The issues in<br />
tool development caused by AUTOSAR metamodel evolution - the need for repetitive implementation<br />
of equivalent tool functionality for each metamodel version - were explained.<br />
The idea of using a generic AUTOSAR metamodel to generate version-independent model<br />
API code that can be used to implement tool functionality only once was introduced as the<br />
chosen solution.<br />
36
4. Automation of Generic AUTOSAR<br />
This chapter elaborates Generic AUTOSAR that was introduced in section 3.3 in detail. In<br />
particular, it explains the steps that are necessary to realize the GAUTOSAR concept with<br />
an emphasis on an automated realization process. The chapter is organized as follows:<br />
• Conceptual realization of GAUTOSAR is explained first in section 4.1 by introducing<br />
the necessary phases for the realization process. This is followed by an<br />
elaboration of the manual and the automatic realization approach. The motivation<br />
behind the automatic approach serves as an introduction to the remaining two parts<br />
of the chapter.<br />
• Analysis of the AUTOSAR metamodel comparison process and the resulting<br />
difference model. A concept for the implementation of step one of the GAU-<br />
TOSAR realization process presented in section 4.1.1 has been contributed in preceding<br />
work. The analysis of this work is presented in section 4.2, including solutions for<br />
known limitations and necessary improvements that were contributed in this thesis.<br />
• Presentation of a concept for automated creation of the generic metamodel.<br />
A concept for the implementation of step two of the GAUTOSAR realization process<br />
presented in section 4.1.1 is the main subject of this thesis. The developed concept<br />
and the prototype that implements the concept are presented in section 4.3.<br />
4.1. Realization of GAUTOSAR<br />
The GAUTOSAR realization process has already emerged in the course of Artop development<br />
prior to this thesis. However, it is still subject to research and has not been formalized<br />
yet. In [Kni11], a preceding thesis at BMW Car IT, a three-step process is proposed: metamodel<br />
comparison, manual refinement of comparison results and finally generation of target<br />
entities, such as API code or further models. These steps were established with an emphasis<br />
on metamodel comparison and presentation of comparison results.<br />
4.1.1. Process steps for realizing GAUTOSAR<br />
The process for the creation of the version-independent GAUTOSAR API will follow similar<br />
principles as for the version-specific AUTOSAR APIs. This involves automatic code generation<br />
from a metamodel. The generic metamodel that will be used for code generation<br />
should encompass all elements that are common to version-specific metamodels supported<br />
in a single Artop release. Thus, a refined sequence for the realization of GAUTOSAR that<br />
considers both metamodel comparison and creation of the generic metamodel is proposed.<br />
This process is illustrated in figure 4.1. The sequence for the realization process is organized<br />
in a way such that each step contributes a framework that helps realize the respective<br />
subsequent step:<br />
37
4. Automation of Generic AUTOSAR<br />
1. Comparison of existing AUTOSAR metamodels and presentation of the<br />
results in an appropriate format. This step requires developing an algorithm to<br />
compare an arbitrary number of AUTOSAR metamodels and creating a format to<br />
present comparison results in a way that makes the second step feasible.<br />
2. Exploration of comparison information and creation of the generic metamodel.<br />
Exploit the results of model comparison from the first step to determine differences<br />
and similarities between compared metamodels - and utilize external knowledge<br />
if required - in order to create a generic metamodel with the desired structure. The<br />
generic metamodel should be self-contained in the sense that it should not contain any<br />
references to other metamodels (in particular version-specific AUTOSAR metamodels)<br />
or their elements. The generic metamodel should also reflect requirements on the<br />
generic API.<br />
3. Generation of the generic API code and linking into version-specific APIs.<br />
Use the generic metamodel to automatically generate Java interfaces and link them to<br />
corresponding Java classes in version-specific APIs that provide functionality specified<br />
in the interfaces.<br />
Figure 4.1.: Illustration of the steps necessary to realize GAUTOSAR with their respective<br />
resulting entities.<br />
38
4.1. Realization of GAUTOSAR<br />
Originally the first two of the described GAUTOSAR realization steps have only been conducted<br />
manually. These steps require a domain expert to simultaneously browse and compare<br />
the structure of multiple AUTOSAR metamodels and determine changes among them (step<br />
one), then build a generic metamodel (step two) based on its desired properties (which will<br />
be reflected in the API) and the types of changes that occurred.<br />
The advantage of the approach where the first two steps are conducted manually is that<br />
a human domain expert can instantly recognize change and its influence on the surrounding.<br />
This is due to a human’s ability to implicitly understand context [WSA02]. Furthermore, a<br />
human expert has an understanding of the semantics behind the data structure - in this case<br />
the principles governing model-based and object-oriented software development. An algorithm<br />
can essentially only base its decisions on the syntax of a data structure, which makes<br />
its understanding of context limited. Therefore, creating a generic metamodel is a relatively<br />
easy task for a human expert. The disadvantage of the manual approach is that the current<br />
AUTOSAR metamodels contain between 600 and 900 classes, which makes manual analysis<br />
an extremely complicated and time-consuming task. Moreover, each time a new AUTOSAR<br />
metamodel becomes available and also becomes supported in an Artop release, the process<br />
has to be repeated with consideration of all metamodels that are supported in the particular<br />
Artop release. This includes some or all of the previously supported metamodels and the<br />
new metamodel. However, a fully automated process might not produce results as good as<br />
the manual process due to the semantic gap in algorithmic data processing. The ideal approach<br />
will combine fast automated processing with the contextual knowledge of the human<br />
expert. This semi-automatic approach combines the advantages of both man and machine<br />
while excluding the disadvantages on both sides to the furthest possible extent.<br />
4.1.2. Automation of the GAUTOSAR realization process<br />
The first step of the GAUTOSAR realization process - comparison of version-specific AU-<br />
TOSAR metamodels - was automated in the DiffMap project - a preceding thesis at BMW<br />
Car IT. The results of the DiffMap project including improvements that were contributed<br />
in this thesis are presented in section 4.2. Automation of the second step - creation of the<br />
GAUTOSAR metamodel - is the subject of this thesis and is presented in section 4.3.<br />
The quality of the metamodel comparison result directly influences the quality of the created<br />
generic metamodel. The extent of the generic metamodel then determines the usability<br />
extent of the generic API. As explained in the previous section, automatic comparison cannot<br />
detect all types of changes that can occur between version-specific metamodels due to<br />
a semantic gap. Similarly, some types of changes cannot be automatically resolved by the<br />
engine that uses comparison information to create the generic metamodel (see section 2.3.2).<br />
In order to resolve such issues nevertheless and improve the quality of the generic API, the<br />
comparison result and the generic metamodel should include a possibility for manual intervention<br />
by a domain expert. The comparison result and the generic metamodel are both<br />
Ecore models (see section 2.2.1) that can be manipulated by hand in Eclipse.<br />
The third step is already automated. It involves using an EMF generator that has been<br />
customized for Artop with special JET templates (see section 2.2.3) to generate the desired<br />
result. The generator processes the GAUTOSAR metamodel that is enriched with<br />
39
4. Automation of Generic AUTOSAR<br />
annotations which contain GAUTOSAR-specific generation instructions. It generates the<br />
GAUTOSAR API and implementations of the generic interfaces in the version-specific APIs.<br />
For the purpose of automation efforts conducted in this thesis, it is assumed that the results<br />
of each processing step in section 4.1.1 have been manually verified and corrected by a human<br />
domain expert before they are used as input for the subsequent processing step.<br />
4.2. Analysis of the automated metamodel comparison process<br />
The DiffMap model is a difference model that collects all the information about similarities,<br />
changes and version history of the compared metamodels [Kni11]. The collected information<br />
supports the creation of a generic AUTOSAR metamodel (see section 4.1.1) and is readable<br />
by both a domain expert and a computer program. DiffMap builds upon the EMF Compare<br />
framework (see section 2.2.4) by extending the provided algorithms to enable the comparison<br />
of more than two models (see section 4.2.2) and by extending the provided metamodel<br />
to define the comparison results in a historical context (see section 4.2.1). Presenting the<br />
results in this fashion implies reading and editing the model by a domain expert in order to<br />
gain knowledge about changes between different model versions and generic model elements.<br />
The quality of this information can be enhanced through manual completion of the model<br />
based on a domain expert’s knowledge.<br />
Sections 4.2.1 and 4.2.2 describe the DiffMap project in the stage as it was found before<br />
this thesis was commenced. During development, certain aspects of DiffMap with a crucial<br />
impact on this work had to be improved upon. Limitations in the structure of the resulting<br />
difference model and the solution contributed in this thesis are given in section 4.2.3. An<br />
improvement of the solution for a better comparison performance is described in section<br />
4.2.4.<br />
4.2.1. DiffMap metamodel<br />
The DiffMap metamodel places itself within the EMF Compare Diff metamodel (see [emfb])<br />
and provides additional classes necessary to capture comparison results and make them<br />
available in a historical context. The DiffMap metamodel is shown in figure 4.2. Elements<br />
of the metamodel that are relevant for this thesis are explained in more detail below.<br />
The class is the central element in the DiffMap metamodel. It extends<br />
EMF Compare’s DiffGroup and contains a reference to an AUTOSAR model element. The<br />
comparison information for this model element is contained in a list of HistoryElements.<br />
The features versionOccurrence and continuousVersionOccurrence are computed from<br />
the contained versionHistory and state in how many model versions a model element<br />
occurred or respectively in how many model versions the element occurred unchanged. The<br />
state feature supports the domain expert in keeping track of the current state of the manual<br />
processing of model elements. The class contains information resulting<br />
from a (single) comparison that a model element took part in. Accordingly, the total number<br />
of historyElements in a model element is equivalent to the total number of comparisons<br />
(see section 4.2.2 for details on how models are compared) the element took part in. The<br />
from and to references point at the version information of the compared model pair, where<br />
40
4.2. Analysis of the automated metamodel comparison process<br />
Figure 4.2.: The DiffMap metamodel (purple) in the context of EMF Compare’s Diff metamodel<br />
(yellow) (image adopted from [Kni11]).<br />
41
4. Automation of Generic AUTOSAR<br />
from refers to the older model and to refers to the newer model. Each HistoryElement<br />
states that either no change occurred in a model element between these two versions or<br />
lists the changes that occurred. Changes can be found in the operations reference, which<br />
contains a list of diff operations - such as renaming, relocation etc. - that were identified on<br />
this element during the comparison process. The historyState feature shows directly if a<br />
model element has suffered any changes (broken) or has remained unchanged (continuous)<br />
during the comparison.<br />
4.2.2. Model comparison in DiffMap<br />
During the preprocessing step, metamodel elements that carry information which is only<br />
relevant for AUTOSAR metamodel developers is removed. Additionally, package restructuring<br />
is performed (see section 4.2.4).<br />
The matching step uses the generic matching algorithm provided by EMF Compare (see<br />
section 2.2.4) and performs a two-way comparison of each model pair. The model pairs are<br />
grouped by age (first version with second version, second version with third version etc.).<br />
The generic matching algorithm performs breadth-first search (BFS) simultaneously on the<br />
two models. For each model element in the older model, the algorithm tries to find a matching<br />
element at the same height in the newer model. If no match is found, the children of the<br />
element in the older model are stored in a separate list, while the children of visited elements<br />
in the newer model are ignored. The visited elements in the newer model are stored in an<br />
equivalent separate list. After BFS has completed, elements contained in the separate lists<br />
are attempted to be matched outside the search tree. A match model is created as the result<br />
of the matching process.<br />
The differentiation step utilizes the match model to figure out the exact type of change<br />
that occurred and then models this change as a diff operation (see 4.2.1) in the DiffMap<br />
model. The initial DiffMap model is created from the match model of the first model pair.<br />
Each element in the DiffMap model is modeled in a DiffMapGroup with its history information<br />
set accordingly (see 4.2.1). In order to facilitate comparison of more than two models,<br />
the EMF Compare diff engine is extended at this point to use the previously constructed<br />
DiffMap model and the next match model as input, which produces an extended DiffMap<br />
model. During this process, for each element in the match model the corresponding element<br />
in the DiffMap model is searched for. If found, the existing DiffMapGroup’s history information<br />
for that element is updated with difference information calculated from the current<br />
match model. If no element already incorporated into the DiffMap model can be associated<br />
with the element in the current match model, a new DiffMapGroup is created for the element<br />
found in the current match model.<br />
4.2.3. Distributed comparison history<br />
The analysis of DiffMap showed that when more than two metamodels were compared, the<br />
resulting DiffMap model contained a separate difference subtree for each pairwise comparison<br />
of AUTOSAR metamodels (see figure 4.3). Such behavior represented a limitation in<br />
recognizing generic metamodel elements required for the concept developed in this thesis.<br />
This section describes the problem and the contributed solution in detail.<br />
42
4.2. Analysis of the automated metamodel comparison process<br />
Figure 4.3.: The resulting DiffMap model structure when comparing three AUTOSAR metamodel<br />
versions.<br />
A metamodel element was modeled in DiffMap as many times as it participated in a pairwise<br />
comparison, with each occurrence containing exactly one history element. Due to this limitation,<br />
an element’s complete history could not be accessed from one location. The histories<br />
were distributed across the difference subtrees. The version occurrence attributes would not<br />
state the real number of occurrences in all compared metamodels. A domain expert could<br />
not make statements about the appearance of a metamodel element and its changes in a<br />
straightforward manner. This heavily impeded DiffMap’s usefulness for manual examination.<br />
A computer program that uses DiffMap to create a generic metamodel would have to<br />
search all subsequent difference subtrees for further occurrences of an element it found in the<br />
first subtree. The program would have to store version and change information, aggregate<br />
it and then decide if this element can be represented in the generic metamodel. Essentially,<br />
the program would have to match model elements across different subtrees, even though this<br />
matching was already done during comparison in DiffMap.<br />
The source of this issue was located in EMF Compare’s algorithm which creates difference<br />
groups and allocates compared elements to groups during the differentiation phase (see<br />
section 4.2.2). During the extension of the DiffMap model with information from the second<br />
43
4. Automation of Generic AUTOSAR<br />
and later comparisons, this algorithm tries to determine if a group for the element in the<br />
match model exists in two ways. It first takes the already grouped model element - which<br />
is a reference to an element in the first metamodel. It then compares this element with<br />
the older element of the matched elements pair contained in the second match model. The<br />
algorithm uses reference equality to compare the elements. However, because semantically<br />
identical elements from different metamodels have distinct memory addresses, comparing by<br />
reference always fails. In the second attempt the algorithm tries to fetch the grouped element’s<br />
corresponding matched element and compare it to the element in the second match<br />
model (again by reference). However, at that time only the second match model, which<br />
contains matching pairs from the second and the third metamodel, is available to the algorithm.<br />
The first match model, which contains matching pairs from the first and the second<br />
metamodel, is not available because EMF Compare was conceived for comparing only two<br />
metamodels, thus requiring only one match model when grouping elements. The attempt<br />
to find the grouped element’s matched counterpart thus results in null and the comparison<br />
to the element in the second match model fails again. After both attempts to allocate<br />
the element from the second or later match models to an existing group have failed, a new<br />
group is created, even though the correct group for that element exists in the DiffMap model.<br />
The solution is to enable the algorithm to successfully match elements from metamodels<br />
that were not compared directly. In order to achieve this, the algorithm is provided with<br />
all match models that were created during the matching phase. Except the oldest and the<br />
newest metamodel, each metamodel in between participates in two comparisons: first as<br />
the newer model and in the subsequent comparison as the older model. This situation is<br />
made use of to link pairs of match models through their common metamodel, thus creating<br />
a matching chain between semantically identical model elements in all metamodels. This<br />
approach is illustrated in figure 4.4.<br />
Figure 4.4.: Illustration of the matching chain solution. An element from model 1 can be<br />
matched to an element in model 3, even though model 1 and model 3 were not<br />
compared directly.<br />
The DiffMap model now contains only one difference tree where the complete comparison<br />
history for each element is available within one difference group (as depicted in figure 4.5).<br />
4.2.4. Leaking occurrence information<br />
In early stages of prototype development, it was noticed that a number of elementary classes<br />
were not incorporated into the generic metamodel even though they did fulfill the requirements<br />
for generic elements. These affected classes are at the top of the AUTOSAR class<br />
hierarchy and serve as superclasses for a vast number of specialized classes. This behavior<br />
represented a limitation in the ability of the prototype developed in this thesis to produce<br />
correct results. This section describes the problem and the contributed solution in detail.<br />
44
4.2. Analysis of the automated metamodel comparison process<br />
Figure 4.5.: The improved structure of the DiffMap model with three compared metamodels.<br />
The problem was caused by the radical restructuring of packages that contain the affected<br />
classes in metamodel version 4.0 (see figure 4.6) and the way EMF Compare’s matching<br />
algorithm operates (see section 4.2.2). Because the algorithm ignores the contents of new<br />
packages in metamodel version 4.0, the classes contained in these packages were not available<br />
for matching with their counterparts in metamodel version 3.x. Therefore, the DiffMap<br />
model incorrectly presented these classes as existing in only two of the three compared<br />
metamodel versions (depicted in figure 4.7).<br />
This issue was recognized in [Kni11] and the implemented solution inserts any packages<br />
(without their contents) that are new in the new model into the old model. This way the<br />
matching algorithm is able to store classes in new packages in the separate list and then<br />
match them with their corresponding classes in the older model’s separate list. The algorithm<br />
for identifying new packages was using the NsPrefix package property when comparing<br />
packages from both metamodels. This property is used to define the namespace prefix for<br />
the XML namespace of the root element [SBPM09]. However, this property is empty in all<br />
AUTOSAR metamodels used in this work. Therefore, no packages could be identified as<br />
new, which caused the solution to have no effect when a comparison was run.<br />
In order to make this solution effective, the algorithm was modified to identify new packages<br />
correctly. The crucial part of the algorithm is to identify equivalent packages that exist in<br />
both models and thereby filter out packages that are new. Using the package Name property<br />
is insufficient, as there is no guarantee that package names are unique in each AUTOSAR<br />
metamodel (this is especially true for words describing objects that are common in each part<br />
45
4. Automation of Generic AUTOSAR<br />
Figure 4.6.: Highlighted classes in metamodel version 3.x are reorganized and distributed<br />
among newly created subpackages in metamodel version 4.0.<br />
46
4.2. Analysis of the automated metamodel comparison process<br />
Figure 4.7.: The result of comparing metamodel versions 2.1, 3.x and 4.0. According to the<br />
comparison history of selected classes, they only exist in two metamodel versions<br />
- 2.1 and 3.x.<br />
47
4. Automation of Generic AUTOSAR<br />
of the metamodel, such as infrastructure, common, component etc.). Furthermore, packages<br />
at different locations in the hierarchy would be identified as equivalent, too. A different<br />
location though is usually a strong indication for different semantics of such packages. The<br />
NsURI property reflects the location of a package in the hierarchy in a fashion similar to the<br />
URI of a file on a web server. However, the value of the NsURI property does not depend on<br />
that package alone, but also on its sibling packages (see section 4.3.3 for details on how the<br />
NsURI property is computed). By using only the NsURI property, equivalent packages might<br />
not be recognized as existing in both models. Therefore, a combination of both Name and<br />
NsURI property is used to identify packages that exist in both models. If both properties<br />
match, the packages are labeled as equivalent. If only the Name property matches, the parent<br />
packages are checked for being equivalent and if so, the original packages are considered<br />
equivalent, too.<br />
The package insertion solution implemented in [Kni11] works as long as the older metamodel<br />
is a subset of the newer metamodel. If the older metamodel contains packages that do not<br />
exist in the newer metamodel (such as in figure A.1 in the appendix), the package is considered<br />
deleted in the difference model, while the classes it contains cannot be matched to<br />
their counterparts in the newer metamodel. The classes in the newer metamodel, as long as<br />
they are located in packages that were matched, are then considered added in that version<br />
(illustrated in figure A.2 in the appendix). To avoid this, the solution was extended to also<br />
insert packages that only exist in the older metamodel into the newer metamodel (the result<br />
is depicted in figure A.3 in the appendix). Furthermore, to make the DiffMap model better<br />
readable, package insertions are performed for each combination of metamodel versions.<br />
Since all metamodels now have the same package structure (in terms of parent relationships,<br />
the order of the siblings is irrelevant), no information about package structure change is<br />
available in the DiffMap model. This might be inconvenient for a domain expert who is<br />
using the DiffMap model to find out how the AUTOSAR metamodels evolved. However,<br />
creating the generic metamodel remains unaffected (see package elements in section 4.3.1).<br />
The described improvements of the package identification and the package insertion algorithms<br />
fulfilled the requirements that were necessary to continue the development of the<br />
prototype contributed in this thesis. A solution that tackles the described problem at its<br />
core is proposed in section 6.2.2.<br />
48
4.2. Analysis of the automated metamodel comparison process<br />
Figure 4.8.: The result of comparing metamodel versions 2.1, 3.x and 4.0 when the package<br />
insertion solution is applied. The comparison histories of selected classes now<br />
correctly describe the classes as present in all compared metamodels.<br />
49
4. Automation of Generic AUTOSAR<br />
4.3. Automated creation of the generic metamodel<br />
The concept presented in this section enables the automated creation of a common, versionindependent<br />
metamodel. It relies on metamodel difference information provided by the<br />
DiffMap model (described in section 4.2). The concept is applied to AUTOSAR metamodels<br />
and showcased through the GAUTOSAR creation engine prototype (see section 4.3.4).<br />
However, the presented concept can be likewise applied to arbitrary metamodels with a few<br />
customizations. The process of automated creation of the GAUTOSAR metamodel consists<br />
of the following phases (depicted in figure 4.9):<br />
• Construction is the critical phase of the process. In this phase the difference model<br />
is explored, change information is retrieved and decisions are made on if and how to<br />
incorporate each model element into the generic metamodel. The construction phase<br />
is described in detail in section 4.3.1.<br />
• Decoupling ensures that the generic metamodel constructed in the previous phase is<br />
self-contained. The decoupling phase is described in detail in section 4.3.2.<br />
• Gification renames the elements in the generic metamodel after the GAUTOSAR<br />
naming convention, but can be customized for other domains. The gification phase is<br />
described in detail in section 4.3.3.<br />
Figure 4.9.: Illustration of the automated process for creating the GAUTOSAR metamodel.<br />
50
4.3.1. Construction phase<br />
4.3. Automated creation of the generic metamodel<br />
The construction phase requires the DiffMap model as input at runtime. Then, the DiffMap<br />
model is explored in a top-down manner and the generic metamodel is constructed simultaneously,<br />
based on information contained in DiffMap. In order to construct the generic<br />
metamodel automatically, some essential questions need to be answered. These questions<br />
apply to each model element that is represented in the difference model. The answers to these<br />
questions will then lead to a model element being incorporated into the generic metamodel<br />
or being dismissed. The questions are as follows:<br />
• What are generic model elements? This question is fundamental for the generic<br />
metamodel. The answer implies a decision that is based on two factors. The first factor<br />
is the occurrence frequency of model elements. This requires a decision if elements<br />
that are present in all or in a majority of compared metamodels are to be considered<br />
generic. The second factor is the amount of change that a model element has been<br />
subject to across different metamodel versions. This requires a decision about to which<br />
degree changed elements can still be considered generic and implies the next presented<br />
question.<br />
• What kind of change is detected in the difference model? The generic metamodel<br />
should contain model elements that have slightly changed. Therefore, change<br />
information must be available to the creation engine. The incorporation of such model<br />
elements implicates an answer to the next presented question.<br />
• How do changes affect the generic API? Different types of change require different<br />
handling in the generic API and an appropriate implementation strategy in the versionspecific<br />
APIs. Depending on the type of change and its effects, the implementations<br />
can be more or less complex. This question is tightly related to the next presented<br />
question.<br />
• How to represent change in the generic metamodel? This should be done in<br />
a way that makes it easy for the generator to recognize change and to generate code<br />
that reflects the chosen implementation strategy mentioned above.<br />
The DiffMap model carries occurrence and change information and thereby provides answers<br />
to the first two questions. However, it is not concerned with the effects of changes on the<br />
generic API or the representation of change in the generic metamodel. Therefore, external<br />
knowledge gained from the experience with the GAUTOSAR API that was generated from<br />
the manually created metamodel is used to answer the last two questions. This knowledge<br />
is required at development time and is thus implicitly included in the program code of the<br />
GAUTOSAR creation prototype. Examples of such external knowledge include choosing<br />
a specific, best-practice solution for reacting to change when dealing with complex change<br />
types (such as attribute type change), where a number of solutions are possible. Another example<br />
is the chosen format of information contained in annotations that enable the generator<br />
to recognize and react to change when producing code that represents generic metamodel<br />
elements.<br />
In the remaining part of this section, the presented questions are answered for different<br />
model element types and the resulting strategies for incorporating these model elements into<br />
the generic metamodel are elaborated.<br />
51
4. Automation of Generic AUTOSAR<br />
Package elements<br />
Package elements serve the purpose of structuring metamodel contents and do not have any<br />
semantics of their own. As no functional API code is generated from package elements (but<br />
rather folders which provide structure for files containing functional code), the occurrence of<br />
package elements across different metamodel versions has no effect on the functionality of the<br />
generic API. Therefore, the question of being generic is irrelevant for package elements. All<br />
package elements are incorporated into the generic metamodel, regardless of their contents.<br />
The contents are not inspected when processing a package element as they will be processed<br />
subsequently anyway. After the construction of the generic metamodel has completed, empty<br />
packages are deleted.<br />
Changes such as renaming of a package and relocation of a package also do not have<br />
an effect on the generic API code. Modeling package elements with the old or new name or<br />
at the old or new location in the generic metamodel is a matter of convenience. However,<br />
due to modifications of the DiffMap model explained in section 4.2.4, all compared metamodels<br />
have the same package structure and no package changes can be identified. As the<br />
DiffMap model is the only explicit input for the engine creating the generic metamodel, the<br />
generic metamodel adopts the package structure of the DiffMap model. The DiffMap model<br />
structure is based on the package structure of the oldest AUTOSAR metamodel [Kni11],<br />
with certain packages from the remaining metamodels additionally inserted because of the<br />
previously mentioned modification of the model. Adopting the DiffMap structure enables<br />
a domain expert to easily associate the information contained in the DiffMap model with<br />
information contained in the GAUTOSAR metamodel and vice versa.<br />
Class elements<br />
Classes are the essential elements of a model as they carry type information and denote<br />
the model semantics. The usefulness of the generic API heavily depends on the number of<br />
classes that are represented in the generic metamodel.<br />
A class element is considered generic if it occurs in all compared metamodels. If such a<br />
class is unchanged across all metamodels, it has no special effects on the generic API and<br />
does not require special attention for incorporating it into the generic metamodel. Therefore,<br />
unchanged classes are incorporated immediately and without any further actions to support<br />
their generic representation. The effects on the generic API and the incorporation strategy<br />
for generic classes that have been subject to change are discussed below.<br />
Relocation of a class from one package to another means a structural change that has no<br />
influence on class semantics. Since the GAUTOSAR API generator uses class names to map<br />
generic classes to their corresponding version-specific classes, the package where a generic<br />
class is located is irrelevant. Therefore, class relocation has no effect on the GAUTOSAR<br />
API. Relocated classes are incorporated into the generic metamodel at their original position<br />
- as in the oldest model, which is where they are modeled in DiffMap). Because the DiffMap<br />
model only states the name of the package to which a class has been relocated, but not its<br />
exact position in the model, it is easier for a domain expert to find a class from the difference<br />
model at that same position in the generic metamodel.<br />
52
4.3. Automated creation of the generic metamodel<br />
Class renaming is a frequently occurring change. Renaming causes some classes in the<br />
version-specific APIs to have a different name than the generic interface they implement.<br />
Other than that, renaming has no functional effects. Name change can be represented in the<br />
generic metamodel by adding an annotation to the affected class. The annotation contains<br />
a mapping from AUTOSAR versions to names used in these versions if they vary from the<br />
name of the representing class in the generic metamodel. The generator looks for such annotations<br />
in classes in the generic metamodel and links the generic and the version-specific<br />
classes accordingly. The DiffMap model presents the class with its original name (as in the<br />
oldest metamodel), while the new name (or a multitude of new names in case the class has<br />
been renamed more than once) is contained in the change histories. Choosing the original<br />
name for the generic class makes it easier to pinpoint that class in DiffMap. However, that<br />
name might become obsolete as new AUTOSAR versions are released and thus unfamiliar<br />
to developers who are new to AUTOSAR. Because developing GAUTOSAR requires associating<br />
the DiffMap model with the GAUTOSAR metamodel frequently, the original name<br />
is chosen as the generic name.<br />
Superclass reference change affects the semantics of a class as superclasses determine<br />
the extent of information that a class contains. The DiffMap model can only detect the<br />
addition or the removal of a superclass reference. If a superclass reference is added at some<br />
point in history, it means that the information it adds has not been present in the class<br />
throughout the history and is thus not generic. If an original superclass reference is removed<br />
later on, the information contained in that superclass becomes non-generic, too. Therefore,<br />
superclass references in a class are considered generic only if they occur across all compared<br />
metamodels.<br />
Attributes and references<br />
Attributes and references define the properties of a class and hence determine the class semantics.<br />
A wide usability of a class in the generic API depends on the number of attributes<br />
and references that the class offers.<br />
Attributes and references are considered generic if they are features of a class that has<br />
already been incorporated into the generic metamodel and if they are present in all occurrences<br />
of the generic class. Just as with unchanged classes, attributes and references that<br />
have remained unchanged across all metamodels are incorporated into the generic metamodel<br />
immediately. Attributes and references contain an extensive list of properties that<br />
enable to fine-tune the semantics of the class they are contained in. A change in each of<br />
these properties has a certain effect on the generic API. However, only a selection of these<br />
properties and their changes is elaborated below.<br />
Renaming of attributes and references has a similar effect on the generic API as<br />
renaming of classes. It means that attributes, references and their accessor and mutator<br />
methods in some of the version-specific classes have a different name than their counterparts<br />
in the generic interface. Again, renaming is supported by adding annotations which map<br />
versions to names to the attribute or reference element in the generic metamodel. As for<br />
classes, the original name (from the oldest model) is chosen for the generic element.<br />
53
4. Automation of Generic AUTOSAR<br />
Type change has a major effect on the generic API. It causes the accessor methods to<br />
have different return types and for the mutator methods to have different argument types<br />
in the version-specific APIs and also compared to the generic API. One solution is to generate<br />
one accessor and mutator method set per type. The version-specific classes can then<br />
implement the business logic in methods that correspond to the type that the attribute or<br />
reference has in that version and throw an appropriate exception in implementations of all<br />
other methods. However, the tool developer would then have to implement functionality per<br />
type instead of per version. Even though the implementation effort is reduced, a need for<br />
repetitive implementation remains. Another solution is to use a unique type for the generic<br />
feature, which can be converted to the type found in the version-specific implementations.<br />
This solution is feasible for features of primitive types. Object types however cannot be<br />
easily converted. In such cases, a detailed analysis of the particular use case should be conducted<br />
in order to find out the appropriate solution. For both the multiple and single type<br />
solutions, annotations that map versions to types can be used to inform the generator about<br />
type change in a similar way as it is done for name change.<br />
Reference multiplicity change can imply a type change if it changes from single to<br />
multiple (or the other way around). The generic reference can be represented as a collection<br />
type, since a collection can carry both single and multiple elements. This way, it is possible<br />
to use only one reference in the generic API (rather than splitting them in single-type<br />
and multiple-type references). The number of possible elements in the collection can be<br />
restricted by the highest occurring multiplicity among the supported metamodel versions.<br />
In reading operations, the version-specific implementations can only use the collection range<br />
that is specified in that version and ignore the rest. Similarly, in writing operations the<br />
required range can be filled with user data, while the remaining range can be manually or<br />
automatically filled with blank values. Exceptions can be thrown if a user tries to enter data<br />
which are beyond the version-specific range.<br />
4.3.2. Decoupling phase<br />
The purpose of decoupling is to enforce the self-containment requirement of the generic<br />
metamodel (see step two in section 4.1.1). Because the DiffMap model is processed topdown<br />
to construct the generic metamodel, it is possible that classes that are referenced as<br />
supertypes and as return types of attributes and references have not been processed yet.<br />
Therefore, these are left pointing at classes in the version-specific metamodels until the<br />
DiffMap model has been processed completely and the generic metamodel has been fully<br />
constructed. Then, during the decoupling phase, the constructed generic metamodel is run<br />
through and references to version-specific classes are changed to point at the corresponding<br />
classes in the generic metamodel (figure 4.10 illustrates this).<br />
Under the assumption that only superclass references present across all compared metamodels<br />
and attributes and references whose type has not changed across all compared metamodels<br />
are considered for incorporation into the generic metamodel, these referenced types are guaranteed<br />
to be found again in the generic metamodel. Otherwise, a deletion of the supertype<br />
reference, attribute or reference from the affected class in the generic metamodel is necessary<br />
in order to avoid references to non-generic types.<br />
54
4.3. Automated creation of the generic metamodel<br />
Figure 4.10.: Illustration of references in superclasses, attributes and references before and<br />
after the decoupling phase.<br />
4.3.3. Gification phase<br />
Gification is the procedure of renaming elements in the generic metamodel and setting up<br />
related name properties in accordance with the GAUTOSAR naming convention (see section<br />
3.3). The gification phase is thus specific to GAUTOSAR. However, the application of a<br />
special naming convention for generic metamodel elements is conceivable in other domains<br />
as well.<br />
The gification phase consists of two tasks which are described below. The results of the<br />
gification process are depicted in figure 4.11.<br />
The first task is concerned with setting the NsURI property of each package. EMF requires<br />
each package element to have a unique NsURI. Therefore, the NsURI properties of packages<br />
in AUTOSAR metamodels reflect the position of the respective package in the metamodel<br />
hierarchy. The NsURI properties of packages in the GAUTOSAR metamodel should follow<br />
the same principles. The NsURI of a package does not depend only on the name and the<br />
position of that package in the metamodel, but also on the sibling packages. The NsURI<br />
extension of a single package is derived from the first characters of words that make up the<br />
package name (figure 4.11 illustrates this). Thus, if the names of two sibling packages are<br />
composed of a single word starting with the same character, a different NsURI has to be<br />
assigned to one of them (i.e. by using the whole word or the first two characters). This<br />
convention does not apply to the NsURI of the root package - the full name of the root is<br />
used instead.<br />
The GAUTOSAR metamodel does not necessarily have the same package structure as the<br />
DiffMap model (see section 4.3.1). To ensure that the GAUTOSAR metamodel follows the<br />
same principles for NsURI properties as the AUTOSAR metamodels, the NsURI property has<br />
55
4. Automation of Generic AUTOSAR<br />
Figure 4.11.: An excerpt from the created GAUTOSAR metamodel showcasing the used<br />
naming conventions. The NsURI extension of the gautosar package in the<br />
infrastructure package is shortened to the letter a and appended to extensions<br />
of its predecessor packages.<br />
to be calculated anew for each package element. Existing tools from Artop were used for to<br />
accomplish this and modified where necessary.<br />
The second task is concerned with changing the name properties of packages, classes, attributes<br />
and references according to the convention displayed in table A.1.<br />
4.3.4. Prototype implementation<br />
The developed prototype that implements the concept presented in previous sections is<br />
essentially a model transformation engine. However, unlike a transformation engine that<br />
typically uses a difference model to migrate a model (that complies with an older version of<br />
its respective metamodel) to a newer version (that complies with the evolved metamodel),<br />
this prototype uses difference information to identify metamodel elements that can be represented<br />
by a generic metamodel and uses representations of such elements as building blocks<br />
for the generic metamodel.<br />
As noticed in section 4.1.2, the prototype assumes that the difference model it uses as<br />
input has been verified for correctness by a human domain expert. Likewise, it is assumed<br />
56
4.3. Automated creation of the generic metamodel<br />
that the resulting generic metamodel will be verified by a domain expert before it is used as<br />
input for the generic API generator.<br />
The architecture of the prototype (see figure 4.12) consists of two functional layers that implement<br />
the concept phases presented in section 4.3. The lower layer features the GEngine<br />
and the AutosarVersionMap. The GEngine component is the core of the prototype: it implements<br />
the construction and the decoupling phase. During the construction phase, the<br />
GEngine makes use of the AutosarVersionMap, a convenience component that enables easy<br />
mapping of short and long forms of the AUTOSAR version number specifications. The implementation<br />
of the construction phase is described in detail later in this section. The upper<br />
layer features the Gifier component, which provides all mechanisms that are necessary to<br />
implement the gification phase. Implementing the gification phase in a separate component<br />
and locating this component in a layer above the GEngine enables easy customization - the<br />
Gifier can be replaced by a component that implements a metamodel naming convention<br />
for domains other than AUTOSAR.<br />
The UML diagram of software components described in this section is given in figure A.4 in<br />
the appendix.<br />
Figure 4.12.: Two-layered architecture of the GAUTOSAR creation engine prototype.<br />
A GEngine object requires the DiffMap model and the number of compared metamodels as<br />
input. The DiffMap model is processed top-down and depending on the model element type<br />
that is found within each difference group (DiffMapGroup object), the respective processing<br />
methods for these element types are invoked. These processing methods implement the<br />
strategies that were discussed in the earlier sections of this chapter.<br />
Package elements are processed without regard to their comparison history. A deep<br />
copy of the package element is created and stripped off its contents. This newly created<br />
package element then serves as the element that will be incorporated into the generic<br />
metamodel. Using a new element as the representative in the generic metamodel rather<br />
than just referencing an existing element in a version-specific metamodel contributes to the<br />
57
4. Automation of Generic AUTOSAR<br />
self-containment requirement of the generic metamodel. The difference group that contains<br />
the package element is stored with a link to the generic element representative in the<br />
diffMapModel2genericModelMap data structure. This data structure makes it possible to<br />
locate the parent element in the generic metamodel of a model element being processed via<br />
its parent difference group in the DiffMap model. The root of the compared metamodels is<br />
a package element (see section 2.2.1) and can be identified as the sole model element without<br />
a further parent element. If such a package element is identified, it is anchored to the<br />
genericModel object, thus becoming the root of the generic metamodel. If it is not the root<br />
element, the diffMapModel2genericModelMap data structure is used to retrieve the package<br />
element from the generic metamodel that should be used as the parent package. The generic<br />
representative of the processed package element is then attached under the found generic<br />
parent package.<br />
Class elements are processed only if their difference group contains the maximum number<br />
of history elements, meaning that the class is present in all compared metamodels. Generic<br />
representatives of class elements are created and the parent package in the generic metamodel<br />
is discovered the same way as for package elements. Additionally, the original class element<br />
is stored with a link to its generic counterpart in the originalClass2genericClassMap.<br />
This data structure is required for the decoupling phase. Then the history elements are<br />
explored to detect name and supertype changes. An algorithm was developed that facilitates<br />
the creation of a naming annotation for any number of name changes that might have<br />
occurred throughout the history. The created annotation is then attached to the generic<br />
representative of the class element. The metamodel version information that can be obtained<br />
in DiffMap has the long format, while the generator requires the short version format<br />
when processing naming annotations. Therefore, the AutosarVersionMap is used to obtain<br />
the corresponding short version. If a supertype reference that was present in the initial<br />
metamodel and has been removed later on is detected, an algorithm is used that deletes this<br />
supertype reference from a list of the originally present supertypes. This list is added to<br />
the generic representative of the class. Since the classes in this list are still version-specific<br />
classes, the supertype references are changed to point at corresponding classes in the generic<br />
metamodel during the decoupling phase.<br />
Attributes and references are processed only if their parent class has been incorporated<br />
into the generic metamodel and if within this class they are present in all compared<br />
metamodels. Again, a copy that serves as the generic representative is created and the parent<br />
class in the generic metamodel is located. If the element is unchanged, it is incorporated<br />
into the generic metamodel as a feature of the located generic class immediately. Otherwise,<br />
the history is explored to detect name changes. The same algorithm as for classes was used<br />
to create appropriate name annotations. If any other changes were detected, the prototype<br />
currently dismisses this element from incorporation into the generic metamodel. Return<br />
types that are still pointing at version-specific classes are changed to point at corresponding<br />
classes in the generic metamodel during the decoupling phase.<br />
58
4.4. Summary<br />
4.4. Summary<br />
This chapter elaborated the efforts that were taken to automatically realize the concept<br />
of GAUTOSAR. The first part of the chapter introduced the necessary steps for realizing<br />
the process that leads from comparing evolutionary different metamodel versions and<br />
creating a generic metamodel to producing generic model API code. The advantages and<br />
disadvantages of the manual approach were evaluated and the choice of the automatic approach<br />
was explained. The second part of the chapter was concerned with an analysis of<br />
a metamodel comparison process and the resulting difference model that were conceived in<br />
a preceding thesis. The difference model was improved to present the results in a format<br />
that enables automatic identification of equivalent metamodel elements across different compared<br />
metamodels. The difference model was also improved to achieve a higher accuracy<br />
when identifying such elements during the comparison process. The third part of the chapter<br />
elaborated the main contribution of this thesis - a concept for automated creation of a<br />
generic metamodel based on comparison information in the aforementioned difference model.<br />
The concept analyzes the types of change that can occur in different types of metamodel<br />
elements, their impact on the generic and the version-specific model APIs and the possibilities<br />
of representing such change in the generic metamodel. Based on this information and<br />
on the frequency of occurrence of elements in compared metamodels, a decision is made on<br />
incorporation of the element into the generic metamodel. A model transformation prototype<br />
was developed that implements this concept. The prototype uses the difference model as<br />
input and produces a generic metamodel as output.<br />
59
4. Automation of Generic AUTOSAR<br />
60
5. Results<br />
This chapter presents the results of development efforts that were conducted in this thesis.<br />
These include the generic metamodel produced by the prototype that implements the<br />
developed automation process and conceptual limitations that were encountered during the<br />
course of development. An evaluation of these results concludes this chapter.<br />
5.1. Generic AUTOSAR metamodel<br />
The prototype developed within this thesis implements the automation process for creating<br />
the generic metamodel that was presented in section 4.3. A DiffMap model containing the<br />
results of comparing AUTOSAR metamodel versions 2.1, 3.x and 4.0 served as input for the<br />
prototype throughout the development process. The prototype assumed that the correctness<br />
of results in its input had been verified manually by a domain expert prior to further<br />
processing.<br />
The GAUTOSAR metamodel produced by the prototype contains about 250 classes. The<br />
version-specific AUTOSAR metamodels that were used as input for comparison contain between<br />
600 and 900 classes. Excerpts from the resulting GAUTOSAR metamodel created<br />
by the prototype are presented in figure 5.1. The figure shows the results of the construction<br />
phase and the annotations that were used to support renamed classes and attributes.<br />
Furthermore, results of the decoupling phase can be seen in superclasses and references.<br />
The specific names of metamodel elements are the result of the gification phase. Only selected<br />
metamodel elements in the presented results have been verified manually. However,<br />
as noticed in section 4.1.2, the results should be verified completely and manually adapted<br />
if necessary prior to using the created metamodel to generate the GAUTOSAR API code.<br />
5.1.1. Observed issues in the generic metamodel<br />
The automatically created GAUTOSAR metamodel was found to still contain references to<br />
classes in version-specific metamodels. These can be seen in some attribute and reference<br />
elements contained in the GIdentifiable class and in the GCompositionType class in figure<br />
5.1. The cause of this inconsistency was found in the input DiffMap model. The DiffMap<br />
model did not recognize that the original type of the affected attributes and references had<br />
been deleted in the subsequent metamodel versions. Such metamodel elements are incorrectly<br />
presented as unchanged, which is why they are incorporated into the generic metamodel.<br />
The affected elements are left in the GAUTOSAR metamodel to point out this issue. The<br />
problem can be resolved through manual correction of the respective comparison information<br />
in the DiffMap model.<br />
61
5. Results<br />
Figure 5.1.: Two excerpts from the automatically created GAUTOSAR metamodel.<br />
5.1.2. Known limitations of the prototype<br />
The prototype does not yet support attribute type and reference multiplicity changes that<br />
were discussed in section 4.3.1. Due to the high number of different types that can be<br />
used to describe data and the effect of type change on the generic API, implementing the<br />
optimal strategy for reacting to such changes requires a detailed data and use case analysis.<br />
Furthermore, the prototype does not implement safe means for distinguishing Ecore and<br />
primitive types from AUTOSAR types in the decoupling phase. This could be resolved by<br />
inspecting the fully qualified name of each type in order to find out which respective API<br />
the type belongs to.<br />
62
5.2. Limitations in the automation process<br />
5.2. Limitations in the automation process<br />
The development efforts in this thesis have led to recognition of limitations in automated<br />
creation of the generic metamodel. For some of the discovered limitations, suggestions for<br />
their resolving are given following the description of the problem.<br />
5.2.1. Undetectable class changes<br />
In certain cases, information that is common to all metamodels can still be lost even if<br />
only classes that are present in all compared metamodels are considered generic. Such a<br />
case occurs when a class is split into more classes and thereby information contained in one<br />
class is distributed into a number of classes. Similarly, information loss can occur when a<br />
number of classes is merged and information is aggregated into one class. The EMF Compare<br />
matching algorithm can only establish pairwise links, thus the DiffMap model has no way<br />
of representing changes that involve more than two classes. The engine creating the generic<br />
metamodel has no possibility to detect and to react to these changes automatically. The<br />
problem reflects in the contents of the affected classes as well - attributes and references are<br />
distributed or merged accordingly. From a higher abstraction level, the semantics implied<br />
by the combination of these attributes and references remain unchanged (splitting is often<br />
caused by structural convenience). However, such situations cause a semantic gap that<br />
cannot be processed automatically and can only be resolved by a domain expert.<br />
5.2.2. Generic elements not present in all metamodels<br />
As the number of supported AUTOSAR versions in Artop increases, so does the amount<br />
of change across models. In other words, the amount of generic data shrinks. Therefore,<br />
in order to keep the benefits of GAUTOSAR high, classes that are present in most models<br />
rather than in all models could still be considered generic. This, however, would require<br />
a restriction of usage of generic model elements in model versions that are not covered by<br />
GAUTOSAR. The problem of the decreasing amount of generic data could also be addressed<br />
by retiring support for releases of AUTOSAR metamodels which are not in widespread use<br />
anymore.<br />
5.2.3. Superclass information gain<br />
As discussed in section 4.3.1, the DiffMap model only detects addition or deletion of a<br />
superclass reference. A superclass reference is incorporated into the generic metamodel only<br />
if it is present in all compared metamodels. This way, the ARElement class in figure 5.2 would<br />
lose both the NonSplittableElement and the PackageableElement superclass references<br />
because neither is present in all occurrences of the ARElement class. This way, the ARElement<br />
class loses all information contained further up in the superclass hierarchy.<br />
To avoid such information loss, an alternative approach for constructing the class structure<br />
of the generic metamodel is proposed. In this approach, the first classes incorporated into<br />
the generic metamodel are leaf classes (classes that are not referenced as superclasses). The<br />
generic metamodel is then constructed bottom-up by following superclass references as illustrated<br />
in listing 5.1.<br />
63
5. Results<br />
Figure 5.2.: PhysicalDimension class hierarchy in different AUTOSAR metamodels (the<br />
semantics of the class is irrelevant here).<br />
64
function constructSuperclassHierarchy ( class ) {<br />
}<br />
List supertypes = class . getSupertypes ();<br />
foreach supertype in supertypes do<br />
if supertype in genericMetamodel<br />
class . supertype = supertype ;<br />
else<br />
incorporateInGenericMetamodel ( supertype );<br />
class . supertype = supertype ;<br />
constructSuperclassHierarchy ( supertype );<br />
5.3. Evaluation of achieved results<br />
Listing 5.1: Recursive algorithm for construction of the generic metamodel by building up<br />
the superclass hierarchy.<br />
In order to ensure that each class in the hierarchy contains the maximum information possible,<br />
each class should contain the maximum number of superclasses, combined from all<br />
version-specific metamodels. The combined hierarchy for the PhysicalDimension class from<br />
figure 5.2 is depicted in figure 5.3. The challenge now is to determine the desired maximum<br />
order of supertypes from the aggregated hierarchy. Under the assumption that each class in<br />
an AUTOSAR metamodel is ultimately a subclass of the ARObject class, the class diagram<br />
depicted in figure 5.3 represents a directed acyclic graph (DAG). A topological sorting algorithm<br />
can be applied on a DAG to obtain the longest path in the graph. This longest path<br />
represents the desired maximum order of supertypes (depicted by red arrows in figure 5.3).<br />
With this approach, the decoupling phase becomes unnecessary. Because the generic metamodel<br />
is built by building up the class hierarchy, any class referenced as a supertype is<br />
incorporated into the generic metamodel before it is used in the reference (as illustrated in<br />
listing 5.1). The DiffMap model can be used to obtain leaf classes with desired occurrence<br />
and change properties (i.e. unchanged leaf classes present in all metamodels). Following<br />
a superclass reference in any class represented in the DiffMap model does not lead to the<br />
representation of the superclass in the DiffMap model, but to a class in a version-specific<br />
metamodel. This means that the generic metamodel is essentially built outside of DiffMap,<br />
as following further superclass references from a class in the version-specific metamodel also<br />
leads to a class in the version-specific metamodel. Therefore, the DiffMap model has to be<br />
explored in a subsequent phase to obtain and incorporate class change information. The<br />
modified phase order is depicted in figure A.5 in the appendix.<br />
5.3. Evaluation of achieved results<br />
An evaluation of the resulting GAUTOSAR metamodel showed that the highest degree of<br />
automation is achieved with model elements that occur in all compared metamodels. Such<br />
presence is a strong implication that the semantics of such elements has remained unchanged,<br />
therefore these elements can be represented in the generic metamodel without the need for a<br />
manual intervention through a domain expert. The generic metamodel presented in section<br />
65
5. Results<br />
Figure 5.3.: Aggregated hierarchy for the PhysicalDimension class. Red arrows indicate<br />
the desired superclass order that can be obtained by topological sorting of a<br />
directed acyclic graph.<br />
66
5.4. Summary<br />
5.1 can be used to generate API code that covers up to a third of version-specific classes,<br />
which would otherwise have to be conceived manually.<br />
The identified limitations in automated processing and limitations of the prototype give<br />
an overview of more complex cases of evolutionary metamodel change. These limitations<br />
can be used as a starting point for further improvements of the developed prototype, which<br />
will lead to the automatic creation of an even more detailed generic metamodel.<br />
5.4. Summary<br />
This chapter presented the results of automation efforts in creating a generic metamodel<br />
based on metamodel comparison information. A generic AUTOSAR metamodel that was<br />
automatically created by the prototype from a difference model of three evolutionary different<br />
AUTOSAR metamodels was analyzed. The generic AUTOSAR metamodel contained almost<br />
a third of the number of classes in the version-specific metamodels and can be used to<br />
generate the generic AUTOSAR API. Observed issues in the resulting metamodel and known<br />
limitations of the prototype were listed. Observed issues included remaining references<br />
to elements in the version-specific APIs that were caused by incorrect information in the<br />
difference model. Known limitations of the prototype included no support for attribute type<br />
and reference multiplicity change. Conceptual limitations in automated creation of a generic<br />
metamodel that were discovered in the course of development, such as changes that cannot<br />
be identified automatically or the incorporation of metamodel elements that do not exist<br />
in all compared metamodels, were discussed and some solution suggestions were given. An<br />
alternative way of constructing the generic metamodel by building up the class hierarchy<br />
was discussed. The chapter was concluded with an evaluation of achieved results.<br />
67
5. Results<br />
68
6. Conclusion<br />
This chapter summarizes the problems and solution concepts that this thesis was concerned<br />
with, proposes ideas for future work and concludes the thesis with a final thought.<br />
6.1. <strong>Thesis</strong> summary<br />
This thesis was concerned with AUTOSAR metamodel evolution in Artop. AUTOSAR is<br />
a standardized architecture for developing software for electronic control units in automobiles.<br />
Artop is an infrastructure platform that enables creating versatile tools for developing<br />
AUTOSAR software. Each Artop release supports several versions of the AUTOSAR metamodel.<br />
This required tool developers to implement equivalent tool functionality separately<br />
for each version. The solution to this problem was found in a generic metamodel that could<br />
be used to generate a version-independent model API code. This API makes it possible to<br />
implement tool functionality only once for all versions. The creation of such a generic metamodel<br />
requires a comparison of different metamodels and the extraction of common elements.<br />
Performing these tasks manually on AUTOSAR metamodels is a very time-consuming task,<br />
therefore research efforts were made to automate this process.<br />
This thesis described a concept for automated creation of a generic, version-independent<br />
metamodel based on comparison results of evolutionary different metamodel versions. The<br />
generic metamodel encompasses elements that are common to all version-specific metamodels<br />
and elements that have been subject to minor changes during the evolution process. The<br />
developed concept was implemented in a model transformation prototype. The prototype<br />
uses a difference model containing metamodel comparison results as input and produces<br />
a generic metamodel as output. The generic metamodel can be used to generate versionindependent<br />
model API code.<br />
The metamodel comparison results were obtained from a difference model that was developed<br />
in a preceding thesis. The difference model was improved to present the comparison<br />
results in a format that enables easy recognition of commonly occurring metamodel elements<br />
across the compared versions, thus supporting the identification of generic metamodel elements<br />
that was performed in this thesis. The comparison process was improved to recognize<br />
the appearance of common metamodel elements with more accuracy, thus improving the<br />
quality of the automatically created generic metamodel.<br />
The developed automation concept processes the difference model by inspecting the occurrence<br />
and change information for each found metamodel element. Based on this information,<br />
a decision is made on incorporating the element into the generic metamodel. The generic<br />
metamodel is decoupled from references to elements in version-specific metamodels. The<br />
elements of the generic metamodel are renamed in an unambiguous way that at the same<br />
time makes it easy to relate them to their version-specific counterparts.<br />
69
6. Conclusion<br />
The prototype implementing the concept was applied to a difference model of three evolutionary<br />
different AUTOSAR metamodels. The resulting GAUTOSAR metamodel covered<br />
nearly a third of classes found in version-specific metamodels. The GAUTOSAR metamodel<br />
could be used to generate version-independent model API code. Issues in the resulting metamodel<br />
that could be fixed by manual correction of difference results were pointed out. Known<br />
limitations of the prototype that could be implemented in succeeding work were listed.<br />
The development efforts led to the discovery of some conceptual limitations in automated<br />
creation of a generic metamodel. These limitations were discussed and solution suggestions<br />
were given where applicable. Such limitations included changes that cannot be identified<br />
automatically or the incorporation of metamodel elements that do not exist in all compared<br />
metamodels. An alternative way of creating the generic metamodel that was based on class<br />
hierarchy was discussed.<br />
6.2. Future work<br />
The automation attempts that were discussed in this thesis leave some room for improvement.<br />
This section lists issues that were identified in the course of development of this thesis and<br />
whose solutions would be of great benefit for the automation process.<br />
6.2.1. Self-containment of the DiffMap model<br />
During the development of the prototype, a need for an abstraction of version-specific model<br />
elements contained in DiffMap arose. The DiffMap model is not self-contained, but rather<br />
masks the version-specific metamodels with additional information. This means that AU-<br />
TOSAR metamodel elements that are contained in difference groups are not representations<br />
of version-specific elements, but direct references to elements in the version-specific metamodels.<br />
For instance, following a superclass reference of some class in the DiffMap model<br />
does not lead to the corresponding DiffMap representation of the referenced superclass, but<br />
to the referenced superclass in the version-specific metamodel. Which version-specific metamodel<br />
is referenced exactly depends on when the mentioned original class first occurred in<br />
the metamodel history and which comparison history element the superclass information<br />
was extracted from. When the DiffMap model is processed manually, this is not an issue<br />
because a domain expert is able to mentally abstract the contained information. However,<br />
this situation makes programmatic processing of semantically equivalent information from<br />
different metamodels difficult because it requires the programmer to think in as many dimensions<br />
as there are compared metamodels. Therefore a higher degree of abstraction would<br />
greatly ease programmatic processing and information extraction from the DiffMap model.<br />
6.2.2. AUTOSAR-specific matching algorithm<br />
The EMF Compare matching algorithm that is used in DiffMap is not well-suited for comparing<br />
AUTOSAR metamodels. This matching algorithm was the cause of problems described<br />
in section 4.2.4. An AUTOSAR specific matching algorithm could be developed to produce<br />
better matching results during the comparison process. This would improve the difference<br />
results and would require less manual effort through a domain expert to verify the results.<br />
70
6.3. Final thought<br />
By processing a difference model of higher quality, the GAUTOSAR creation engine would<br />
be able to produce a higher quality generic metamodel which would require less manual<br />
intervention, too.<br />
6.2.3. Use-case analysis of attribute type changes<br />
As mentioned in the discussion of attribute type changes in section 4.3.1, this type of change<br />
has a crucial impact on the model API. Representing attributes that have been subject to<br />
this kind of change in a generic metamodel is still possible. However, choosing the right<br />
strategy for incorporating such attribute elements into the generic metamodel greatly varies<br />
on the characteristics of the involved types. Therefore, a detailed analysis of possible usecases<br />
should be conducted in order to find out the optimal implementation strategy. The<br />
results of this research should be implemented in the prototype. The prototype will be able<br />
to create a more complete generic metamodel, which will result in a wider usage capability<br />
of the generic API.<br />
6.3. Final thought<br />
The results of automation efforts that were conducted in this thesis show that automatic<br />
creation of a generic metamodel from a difference model of version-specific metamodels is<br />
feasible. The automatically created metamodel can be used to generate version-independent<br />
model API code. Even if such API code cannot match the semantical quality of the API<br />
generated from the manually created generic metamodel, the extent of automation achieved<br />
in this thesis relieves Artop developers from manual work to a great extent and thereby<br />
contributes to the usability and wide acceptance of the Artop platform in the AUTOSAR<br />
tool development community.<br />
71
6. Conclusion<br />
72
A. Appendix<br />
Model element or API method Original name Generic name<br />
Package packagename packagename<br />
Class ClassName ClassName<br />
Attribute/Reference attrRefName AttrRefName<br />
Accessor method getAttrRefName GetAttrRefName<br />
Mutator method setAttrRefName SetAttrRefName<br />
Table A.1.: Overview of the naming convention for the GAUTOSAR metamodel.<br />
73
A. Appendix<br />
74<br />
Figure A.1.: Two test models for package insertion.
Figure A.2.: One-way, new-to-old package insertion as conceived in [Kni11]. Internally,<br />
newpackage from the newer model (version 2) is inserted into the older model<br />
(version 1), thus migration of ClassB is identified. Because leakpackage from<br />
the older model is not inserted into the younger model as well, the migration<br />
of ClassC is not recognized but the class is considered to have first appeared<br />
in the newer version.<br />
75
A. Appendix<br />
Figure A.3.: Two-way, new-to-old and old-to-new package insertion. Internally, newpackage<br />
from the newer model (version 2) is inserted into the older model (version 1)<br />
and leakpackage from the older model is inserted into the newer model. The<br />
migration of ClassC is now recognized, too. However, no package addition or<br />
deletion information is available anymore.<br />
76
Figure A.4.: UML class diagram depicting the software components of the GAUTOSAR<br />
creation engine prototype. Internal utilities have been omitted for clarity.<br />
77
A. Appendix<br />
Figure A.5.: Modified concept for creating the generic metamodel. The metamodel is constructed<br />
by building up the class hierarchy through superclass references, thus<br />
not requiring the decoupling phase anymore.<br />
78
List of Figures<br />
2.1. Simplified view of the domain of software components and their communication<br />
paradigm in AUTOSAR, expressed in the UML class diagram notation. . 6<br />
2.2. The UML object diagram representing a model of an AUTOSAR software<br />
component. The model conforms to the metamodel in figure 2.1. . . . . . . . 7<br />
2.3. The four (meta)modeling layers as specified by OMG. . . . . . . . . . . . . . 8<br />
2.4. The EMF architecture (image adopted from [Ste08]). . . . . . . . . . . . . . . 12<br />
2.5. An excerpt from the Ecore metamodel (image adopted from [Ste08]). EOperation<br />
is not displayed in this image. . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
2.6. Three representations of the simplified AUTOSAR software component metamodel:<br />
Ecore diagram (up left), Ecore tree view (up right) and the XMI<br />
serialization format (down). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
2.7. The generator model (up left) and code generation properties (down) for the<br />
software component model (up right). . . . . . . . . . . . . . . . . . . . . . . 16<br />
2.8. The software component model editor generated with EMF and integrated<br />
into the Eclipse framework. The editor features a software component with<br />
two ports that define a port interface. . . . . . . . . . . . . . . . . . . . . . . 19<br />
2.9. The EMF Compare process. Artifacts colored red can be customized to match<br />
specific user needs (image adopted from [Bru08]). . . . . . . . . . . . . . . . . 20<br />
3.1. AUTOSAR ECU architecture (image adopted from [AUT11b]). . . . . . . . . 26<br />
3.2. Overview of the AUTOSAR methodology (image adopted from [AUT11a]). . 27<br />
3.3. AUTOSAR methodology for software component implementation (image adopted<br />
from [AUT11a]). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28<br />
3.4. Detailed view of the AUTOSAR metamodel in [autb] describing different types<br />
of software components in AUTOSAR and their relationships. . . . . . . . . . 29<br />
3.5. Non-collaborative and collaborative AUTOSAR tool development approach<br />
in comparison (image adopted from [KRV + 10b]). . . . . . . . . . . . . . . . . 30<br />
3.6. Layers composing the Artop architecture (image adopted from [Rud10]). . . . 31<br />
3.7. Two models created with the Artop Technology Demonstrator - an Eclipsebased<br />
AUTOSAR tool which was built by the Artop community to showcase<br />
Artop’s capabilities. The same is also possible in any AUTOSAR tool that<br />
makes use of Artop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32<br />
3.8. Version-specific generation of AUTOSAR API code from the respective AU-<br />
TOSAR metamodels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33<br />
3.9. The principle of Generic AUTOSAR. . . . . . . . . . . . . . . . . . . . . . . . 35<br />
4.1. Illustration of the steps necessary to realize GAUTOSAR with their respective<br />
resulting entities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38<br />
4.2. The DiffMap metamodel (purple) in the context of EMF Compare’s Diff metamodel<br />
(yellow) (image adopted from [Kni11]). . . . . . . . . . . . . . . . . . . 41<br />
79
List of Figures<br />
80<br />
4.3. The resulting DiffMap model structure when comparing three AUTOSAR<br />
metamodel versions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43<br />
4.4. Illustration of the matching chain solution. An element from model 1 can be<br />
matched to an element in model 3, even though model 1 and model 3 were<br />
not compared directly. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44<br />
4.5. The improved structure of the DiffMap model with three compared metamodels. 45<br />
4.6. Highlighted classes in metamodel version 3.x are reorganized and distributed<br />
among newly created subpackages in metamodel version 4.0. . . . . . . . . . . 46<br />
4.7. The result of comparing metamodel versions 2.1, 3.x and 4.0. According to<br />
the comparison history of selected classes, they only exist in two metamodel<br />
versions - 2.1 and 3.x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47<br />
4.8. The result of comparing metamodel versions 2.1, 3.x and 4.0 when the package<br />
insertion solution is applied. The comparison histories of selected classes now<br />
correctly describe the classes as present in all compared metamodels. . . . . . 49<br />
4.9. Illustration of the automated process for creating the GAUTOSAR metamodel. 50<br />
4.10. Illustration of references in superclasses, attributes and references before and<br />
after the decoupling phase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55<br />
4.11. An excerpt from the created GAUTOSAR metamodel showcasing the used<br />
naming conventions. The NsURI extension of the gautosar package in the<br />
infrastructure package is shortened to the letter a and appended to extensions<br />
of its predecessor packages. . . . . . . . . . . . . . . . . . . . . . . . . . 56<br />
4.12. Two-layered architecture of the GAUTOSAR creation engine prototype. . . . 57<br />
5.1. Two excerpts from the automatically created GAUTOSAR metamodel. . . . 62<br />
5.2. PhysicalDimension class hierarchy in different AUTOSAR metamodels (the<br />
semantics of the class is irrelevant here). . . . . . . . . . . . . . . . . . . . . . 64<br />
5.3. Aggregated hierarchy for the PhysicalDimension class. Red arrows indicate<br />
the desired superclass order that can be obtained by topological sorting of a<br />
directed acyclic graph. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66<br />
A.1. Two test models for package insertion. . . . . . . . . . . . . . . . . . . . . . . 74<br />
A.2. One-way, new-to-old package insertion as conceived in [Kni11]. Internally,<br />
newpackage from the newer model (version 2) is inserted into the older model<br />
(version 1), thus migration of ClassB is identified. Because leakpackage from<br />
the older model is not inserted into the younger model as well, the migration<br />
of ClassC is not recognized but the class is considered to have first appeared<br />
in the newer version. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75<br />
A.3. Two-way, new-to-old and old-to-new package insertion. Internally, newpackage<br />
from the newer model (version 2) is inserted into the older model (version 1)<br />
and leakpackage from the older model is inserted into the newer model. The<br />
migration of ClassC is now recognized, too. However, no package addition or<br />
deletion information is available anymore. . . . . . . . . . . . . . . . . . . . . 76<br />
A.4. UML class diagram depicting the software components of the GAUTOSAR<br />
creation engine prototype. Internal utilities have been omitted for clarity. . . 77<br />
A.5. Modified concept for creating the generic metamodel. The metamodel is constructed<br />
by building up the class hierarchy through superclass references, thus<br />
not requiring the decoupling phase anymore. . . . . . . . . . . . . . . . . . . 78
List of Listings<br />
2.1. Generated interface for the SoftwareComponent class. Generated imports<br />
and comments have been omitted for clarity. . . . . . . . . . . . . . . . . . . 17<br />
2.2. Generated implementation for the SoftwareComponent class. Generated imports,<br />
comments and optimization methods have been omitted for clarity. . . 17<br />
3.1. Implementing the same functionality for different metamodel versions in an<br />
Artop-based AUTOSAR tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . 33<br />
3.2. The generic interface representing a QueuedReceiverComSpec object. . . . . . 35<br />
3.3. The actual implementation of the desired functionality reading the value of<br />
the queueLength property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36<br />
3.4. Integration of the generic interface into a version-specific API (here the 2.1<br />
API). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36<br />
5.1. Recursive algorithm for construction of the generic metamodel by building up<br />
the superclass hierarchy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65<br />
81
List of Listings<br />
82
CD Contents<br />
The enclosed CD contains documents and prototype sources as listed below. The accompanying<br />
readme files in each folder explain the respective contents and contain instructions for<br />
running the prototypes.<br />
• <strong>Thesis</strong> Document<br />
– Diplomarbeit Leonard Krpan.pdf<br />
• Source Code<br />
– DiffMap Source Code<br />
∗ de.bmw.carit.datk.avem.diffmap<br />
∗ de.bmw.carit.datk.avem.diffmap.edit<br />
∗ de.bmw.carit.datk.avem.diffmap.editor<br />
∗ de.bmw.carit.datk.avem.diffmap.tests<br />
∗ de.bmw.carit.datk.avem.diffmap.gautosar<br />
∗ de.bmw.carit.datk.avem.diffmap.gautosar.diffengine<br />
∗ de.bmw.carit.datk.avem.diffmap.gautosar.matchengine<br />
∗ de.bmw.carit.datk.avem.diffmap.gautosar.util<br />
∗ readme.txt<br />
– <strong>Thesis</strong> Source Code<br />
• readme.txt<br />
∗ EMF Examples<br />
· SwComponentExample<br />
· SwComponentExample.edit<br />
· SwComponentExample.editor<br />
· readme.txt<br />
∗ GAUTOSAR Creation Prototype<br />
· src<br />
· models<br />
· results<br />
· readme.txt<br />
83
CD Contents<br />
84
Bibliography<br />
[auta] AUTOSAR Metamodel Version 3.1.<br />
[autb] AUTOSAR Metamodel Version 4.0.<br />
[AUT09] AUTOSAR. System Template, 4.0.0 edition, December 2009.<br />
[AUT10a] AUTOSAR. Software Component Template, 4.1.0 edition, October 2010.<br />
[AUT10b] AUTOSAR. Specification of RTE, 2.3.0 edition, September 2010.<br />
[AUT11a] AUTOSAR. AUTOSAR Methodology, 1.2.2 edition, April 2011.<br />
[AUT11b] AUTOSAR. Layered Software Architecture, 2.2.2 edition, March 2011.<br />
[AUT11c] AUTOSAR. Main requirements, 2.1.1 edition, April 2011.<br />
[AUT11d] AUTOSAR. Specification of the Virtual Functional Bus, 1.2.0 edition, March<br />
2011.<br />
[AUT11e] AUTOSAR. Technical Overview, 2.2.2 edition, April 2011.<br />
[BCT05] Alan W. Brown, Jim Conallen, and Dave Tropeano. Introduction: Models,<br />
Modeling, and Model-Driven Architecture. In Sami Beydeda, Matthias Book,<br />
and Volker Gruhn, editors, Model-Driven Software Development, pages 1–16.<br />
Springer, 2005.<br />
[BGGK07] Steffen Becker, Thomas Goldschmidt, Boris Gruschko, and Heiko Koziolek. A<br />
process model and classification scheme for semi-automatic meta-model evolution.<br />
In Proc. 1st Workshop MDD, SOA und IT-<strong>Management</strong> (MSI’07). GiTO-Verlag,<br />
2007.<br />
[Bre10] Ruth Breu. Ten Principles for Living Models - A Manifesto of Change-Driven<br />
Software Engineering. In Proceedings of the 2010 International Conference on<br />
Complex, Intelligent and Software Intensive Systems, pages 1–8. IEEE, 2010.<br />
[Bru] Cedric Brun. EMF Compare 1.0.0 Galileo Simultaneous Release. Available<br />
online at: http://www.eclipse.org/project-slides/Galileo/EMF_Compare_<br />
Galileo_Review.pdf, accessed 2.6.2011.<br />
[Bru08] Cedric Brun. Comparing and Merging Models with Eclipse : an Update on EMF<br />
Compare (Presentation). In EclipseCon, March 2008.<br />
[CDREP08] Antonio Cicchetti, Davide Di Ruscio, Romina Eramo, and Alfonso Pierantonio.<br />
Automating co-evolution in model-driven engineering. In Proceedings of the 2008<br />
12th International IEEE Enterprise Distributed Object Computing Conference,<br />
pages 222–231. IEEE, 2008.<br />
85
Bibliography<br />
[emfa] EMF Compare - Eclipsepedia. Online: http://wiki.eclipse.org/EMF_<br />
Compare, accessed 2.6.2011.<br />
[emfb] org.eclipse.emf.compare.diff.metamodel (EMF Compare Javadoc). Online: http:<br />
//download.eclipse.org/modeling/emf/compare/javadoc/1.1.0/, accessed<br />
4.6.2011.<br />
[Eva03] Eric Evans. Domain-Driven Design: tackling complexity in the heart of software.<br />
Addison-Wesley, 1st edition, 2003.<br />
[Eys08] Moritz Eysholdt. Towards EMF Ecore based Meta Model Evolution and Model<br />
Co-Evolution. In MDSD Today, October 2008.<br />
[FR07] Robert France and Bernhard Rumpe. Model-driven Development of Complex<br />
Software: A Research Roadmap. In 2007 Future of Software Engineering, pages<br />
37–54. IEEE, 2007.<br />
[GHH04] Anouck R. Girard, Adam S. Howell, and J. Karl Hedrick. Model-Driven Hybrid<br />
and Embedded Software for Automotive Applications. In 2nd RTAS Workshop<br />
on Model-Driven Embedded Systems, 2004.<br />
[Gri08] Frank Grimm. Increasing Reliability of Model-driven Software Family Engineering<br />
and Product Configuration. In Second International Workshop on Variability<br />
Modelling of Software-intensive Systems, 2008.<br />
[Gru06] Boris Gruschko. Towards Structured Revisions of Meta Models and Semi-<br />
Automatic Model Migration. In Eclipse Modeling Symposium, October 2006.<br />
[Hei04] Heinecke, Harald and Schnelle, Klaus-Peter and Fennel, Helmut and Bortolazzi,<br />
Jürgen and Lundh, Lennart and Leflour, Jean and Mate, Jean-Luc and Nishikawa,<br />
Kenji and Scharnhorst, Thomas . AUTomotive Open System ARchitecture - An<br />
Industry-Wide Initiative to Manage the Complexity of Emerging Automotive<br />
E/E-Architectures, 2004.<br />
[Her07] Markus Herrmannsdörfer. Coupled Evolution of Metamodels and Models. Master’s<br />
thesis, Technische Universität München, 2007.<br />
[HT06] Brent Hailpern and Peri Tarr. Model-driven development: the good, the bad,<br />
and the ugly. IBM Systems Journal, 45:451–461, July 2006.<br />
[HVW11] Markus Herrmannsdörfer, Sander D. Vermolen, and Guido Wachsmuth. An extensive<br />
catalog of operators for the coupled evolution of metamodels and models.<br />
In Proceedings of the Third international conference on Software language engineering,<br />
SLE’10, pages 163–182. Springer, 2011.<br />
[Kal10] Philipp Kalb. UML Model Merging in the Context of a Model Evolution Engine.<br />
Master’s thesis, Leopold-Franzens-University Innsbruck, 2010.<br />
[Kni11] Tom Knipphals. Generische Verarbeitung evolutionär unterschiedlicher Versionen<br />
eines domänenspezifischen Modells. Master’s thesis, Fachhochschule für Angewandte<br />
Wissenschaften Augsburg, January 2011.<br />
86
Bibliography<br />
[KRV + 10a] Christian Knüchel, Michael Rudorfer, Stefan Voget, Stephan Eberle, Romain<br />
Sezestre, and Aldric Loyer. Artop - AUTOSAR Tool Platform. An ecosystem<br />
approach for collaborative AUTOSAR tool development. In ERTS2 Embedded<br />
Real Time Software and Systems, May 2010.<br />
[KRV + 10b] Christian Knüchel, Michael Rudorfer, Stefan Voget, Stephan Eberle, Romain<br />
Sezestre, and Aldric Loyer. Artop - AUTOSAR Tool Platform. An ecosystem approach<br />
for collaborative AUTOSAR tool development (Presentation). In ERTS2<br />
Embedded Real Time Software and Systems, May 2010.<br />
[Lid10] Stephen W. Liddle. Model-Driven Software Development. June 2010.<br />
[LZG04] Yuehua Lin, Jing Zhang, and Jeff Gray. Model comparison: A key challenge<br />
for transformation testing and version control in model driven software development.<br />
In Control in Model Driven Software Development. OOPSLA/GPCE:<br />
Best Practices for Model-Driven Software Development, pages 219–236. Springer,<br />
2004.<br />
[MD08] Parastoo Mohagheghi and Vegard Dehlen. Where Is the Proof? - A Review of<br />
Experiences from Applying MDE in Industry. In Proceedings of the 4th European<br />
conference on Model Driven Architecture: Foundations and Applications, pages<br />
432–443. Springer, 2008.<br />
[mdsa] Artop - AUTOSAR Tool Platform User Group. Online: http://www.artop.<br />
org/artext/, accessed 31.5.2011.<br />
[mdsb] Do you know what your metamodel is. Online: http://nekulturniy.com/<br />
Writings/MOFarticle/MOF_article.html, accessed 31.5.2011.<br />
[mdsc] GEF. Online: http://www.eclipse.org/gef/, accessed 31.5.2011.<br />
[mdsd] Grammatical Description of Syntax: The BNF Metalanguage. Online: http:<br />
//www.cs.sfu.ca/~cameron/Teaching/383/BNF.html, accessed 31.5.2011.<br />
[mdse] XML Schema Tutorial - Part 1/5 - Defining Elements and Attributes.<br />
Online: http://www.liquid-technologies.com/Tutorials/XmlSchemas/<br />
XsdTutorial_01.aspx, accessed 31.5.2011.<br />
[NH08] Edward Nelson and Henry Huang. A Software and System Modeling Facility<br />
for Vehicle Environment Interactions. In Manfred Broy, Ingolf H. Krüger, and<br />
Michael Meisinger, editors, Model-Driven Development of Reliable Automotive<br />
Services, pages 34–47. Springer, 2008.<br />
[PBKS07] Alexander Pretschner, Manfred Broy, Ingolf H. Krüger, and Thomas Stauner.<br />
Software engineering for automotive systems: A roadmap. In 2007 Future of<br />
Software Engineering, pages 55–71. IEEE, 2007.<br />
[rela] EMF Compare/EPatch - Eclipsepedia. Online: http://wiki.eclipse.org/EMF_<br />
Compare/Epatch, accessed 7.6.2011.<br />
[relb] Maude. Online: http://maude.cs.uiuc.edu/, accessed 8.6.2011.<br />
87
Bibliography<br />
[relc] subversion.tigris.org. Online: http://subversion.tigris.org/, accessed<br />
7.6.2011.<br />
[Rud10] Rudorfer, Michael and Voget, Stefan and Eberle, Stephan. Artop whitepaper,<br />
2010.<br />
[RV08] Jose E. Rivera and Antonio Vallecillo. Representing and Operating with Model<br />
Differences. In Richard F. Paige and Bertrand Meyer, editors, TOOLS Europe,<br />
pages 141–160. Springer, October 2008.<br />
[SBPM09] Dave Steinberg, Frank Budinsky, Marcelo Paternostro, and Ed Merks. Eclipse<br />
Modeling Framework. Addison-Wesley, 2nd edition, 2009.<br />
[Sel03] Bran Selić. The pragmatics of model-driven development. Software, IEEE, 20:19–<br />
25, September 2003.<br />
[sph] Sphinx. Online: http://www.eclipse.org/sphinx/, accessed 13.7.2011.<br />
[Ste08] Dave Steinberg. Fundamentals of the Eclipse Modeling Framwork (Presentation).<br />
In EclipseCon, March 2008.<br />
[SV05] Thomas Stahl and Markus Völter. Modellgetriebene Softwareentwicklung - Technicken,<br />
Engineering, <strong>Management</strong>. dpunkt.verlag, 1st edition, 2005.<br />
[Tah08] Walid Taha. Domain-Specific Languages. In International Conference on Computer<br />
Engineering Systems, 2008, pages 23–28. IEEE, 2008.<br />
[Tou06] Antoine Toulme. Presentation of EMF Compare Utility. In Eclipse Modeling<br />
Symposium, October 2006.<br />
[vDKV00] Arie van Deursen, Paul Klint, and Joost Visser. Domain-specific languages: an<br />
annotated bibliography. SIGPLAN Notices, 35:26–36, June 2000.<br />
[VSK05] Markus Völter, Christian Salzmann, and Michael Kircher. Model Driven Software<br />
Development in the Context of Embedded Component Infrastructures. In Colin<br />
Atkinson, Christian Bunse, Hans-Gerhard Gross, and Christian Peper, editors,<br />
Component-Based Software Development for Embedded Systems, pages 143–163.<br />
Springer, 2005.<br />
[WSA02] Huadong Wu, Mel Siegel, and Sevim Ablay. Sensor Fusion for Context Understanding.<br />
In Proceedings of the 19th IEEE Instrumentation and Measurement<br />
Technology Conference, volume 1, pages 13–17. IEEE, August 2002.<br />
88