<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>An Infrastructure for Generating Run-time Model Traces for Maintenance Tasks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Lorena Arcega y</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jaime Font y</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Øystein Haugenz</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Carlos Cetina Universidad San Jorge</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>SVIT Research Group</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zaragoza</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Spain Email:</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>larcega</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>jfont</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>ccetinag@usj.es</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>-Current research efforts are focused on taking advantage of the models at run-time for run-time decisionmaking related to run-time system concerns associated with autonomic and adaptive systems. In addition, all systems need maintenance over time as new requirements emerge or when bug-fixing becomes necessary. Models at run-time can provide an execution trace of a high level of abstraction that is useful for maintenance tasks. In this paper, we propose a generic infrastructure, which is able to get the run-time model trace. Our infrastructure creates a descriptive model of the running code by means of Code-Model Connection Rules. These rules translate the behaviour of the running source code in model traces. We validate our infrastructure in a Smart Hotel. The results of our infrastructure show promising results towards the generation of model traces from source code at run-time. However, further work is required to a better specification of the rules, to solve some issues with the model dependencies and to allow the propagation of changes in the models to the source code.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>
        Models at run-time research efforts are concerned with how
abstractions of software implementations can be used at
runtime to manage software changes at run-time [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Current
research works are focused on how models can be used to
support run-time adaptations in autonomous systems (i.e., in
self-* systems) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Usually, the adaptation actions are driven
by a MAPE-K loop [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and prescriptive models. That is,
changes in the model are transferred to the system.
      </p>
      <p>
        In software development, all systems evolve over time
as new requirements emerge or when bug-fixing becomes
necessary. Lehman et al. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] pointed out that up to the 80% of
the lifetime of a system is spent on maintenance and evolution
activities. Currently, research efforts in feature location are
concerned with identifying software artifacts associated with
a program functionality (a feature). Feature location is one
of the most important and common activities performed by
developers during software maintenance and evolution [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>
        The amount of run-time data produced by many applications
tends to be huge and is recorded in different forms. Relevant
information has to be extracted and stored with the
corresponding artifacts produced at design-time to reveal the causes of
unexpected software behavior [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. The purpose of the analysis
is to find the effects within a chain of effects occurred during
software execution [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Therefore, some techniques are needed
to extract and understand the run-time information. Then,
runtime information is necessary at design-time to make decision
regarding the system maintenance.
      </p>
      <p>The goal of our work is to extend the use of models at
run-time to perform maintenance task. This work presents
our generic infrastructure to generate run-time model traces
through the use of connection rules specified at design-time
called Code-Model Connection Rules.</p>
      <p>The Code-Model Connection Rules maps model elements to
different point in the source code such as methods or values
of variables. Our generic infrastructure is divided in two parts:
Controller and Translator. It controls the implementation code,
check it through the Code-Model Connection Rules, and, if
changes in the run-time model are necessary, our generator
translates the changes in the model at run-time.</p>
      <p>We validate our infrastructure in our Smart Hotel. The
infrastructure creates model traces from source-code to
models. The results of the validation of our infrastructure show
promising results towards the generation of model traces from
source code at run-time. However, further work is required to
a better specification of the Code-Model Connection Rules, to
solve some issues with the model dependencies and to allow
the performance of maintenance tasks at model level, that is,
the propagation of changes in the models to the source code.</p>
      <p>The remainder of the paper is structured as follows. In
Section II, we introduce the Smart Hotel. In Section III, we
describe the steps of our approach. In Section IV, we validate
our approach with the Smart Hotel case study and then discuss
the results. In Section VI, we examine the works related with
this one. Finally, in Section VII, the conclusions of our work
are presented.</p>
    </sec>
    <sec id="sec-2">
      <title>II. BACKGROUND</title>
      <p>
        The running example and the evaluation of this paper are
performed through a Smart Hotel [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. In this section, we
present the models that are used by the Smart Hotel.
      </p>
      <p>
        We use Pervasive Modeling Language (PervML) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] to
describe the Smart Hotel. PervML1 is a Domain Specific
Language (DSL) that describes pervasive systems using
highlevel abstraction concepts such as services. This language
      </p>
    </sec>
    <sec id="sec-3">
      <title>1https://tatami.dsic.upv.es/pervml/index.php</title>
      <p>&lt;&lt;Service&gt;&gt;</p>
      <p>LightingByLight
+ setTresholdLighting(luxes:Integer)
+ getCurrentTreshold():Integer
*
1
&lt;&lt;Service&gt;&gt;
LightingDetection
(from SensorServices)
+ currentLighting():Integer</p>
      <p>Lighting Services Model
&lt;&lt;Service&gt;&gt;</p>
      <p>Lighting
*
1..* ++ sswwiittcchhOOnff(())
+ isLighting():Boolean</p>
      <p>1..*
&lt;&lt;Service&gt;&gt;</p>
      <p>GradualLighting
+ setIntensity(intensity:Integer)
+ getIntensity():Integer
*</p>
      <p>&lt;&lt;Service&gt;&gt;
LightingByPresence
+ enable()
+ disable()
+ isEnabled():Integer</p>
      <p>*
1..*
&lt;&lt;Service&gt;&gt;
PresenceDetection
(from SensorServices)
+ presenceDetected():Boolean
Gradual Lighting State Machine</p>
      <p>isLighting(), getIntensity(), setIntensity(intensity) [intensity=0]
new
is focused on specifying heterogeneous services in distinct
physical environments. This DSL has been applied to develop
solutions in the Smart Hotel domain.</p>
      <p>PervML uses six different models which globally provide
the information that is required to describe a pervasive system.
These models are:</p>
      <p>The Services Model describes the kinds of services that
are provided in the pervasive system. It is used for
specifying the common characteristics of these similar
services.</p>
      <p>The Structural Model indicates the number and kind
of services that are provided by the pervasive system in
every system location.</p>
      <p>The Interaction Model is used for describing the
communication that is produced between the different
components of the services.</p>
      <p>The Binding Providers Model is used to describe the
different kinds of devices or software systems that are in
charge of providing the basic pervasive system
functionality.</p>
      <p>The Components Structural Specification is used to
assign devices and software systems to each one of the
service components.</p>
      <p>The Components Functional Specification is used to
specify the actions that are executed when an operation
of a service is invoked.</p>
      <p>Because of space constraints, Fig. 1 shows only a small part
of the PervML models related to the functioning of the lights
in the Smart Hotel. The concrete syntax of PervML is similar
to the one used by UML. The Smart Hotel provides services
which offer operations for switching on and switching off the
lights or setting the light intensity. The Gradual Lighting State
Machine shows the state machine related to the gradual lights.
This kind of service supports setting the light intensity from
0% to 100% by means of a set of operations.</p>
      <p>
        The output system is obtained through a model to text
transformation. That is, each element of the model is translated
to one or more Java bundles. In addition, we use an
implementation framework of PervML and the OSGI framework [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
See [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] for more implementation details.
      </p>
    </sec>
    <sec id="sec-4">
      <title>III. FROM SOURCE-CODE TO MODELS</title>
      <p>This work presents our generic infrastructure to generate
run-time model traces through the use of connection rules
specified at design-time called Code-Model Connection Rules.
The infrastructure monitors the software changes in the
running system and put the running information into a descriptive
model at run-time.</p>
      <p>Fig. 2 shows an overview of our Run-time Model Trace
Generator. At design-time, the software engineer creates the
models that specify the system and are used to generate the
run-time model. From the models, the code is implemented,
usually manually by using the models as a reference and in
some cases it is doing automatically or semi-automatically.
The software engineer also species the rules, Code-Model
Connection Rules, which will generate the descriptive model
at run-time.</p>
      <p>In a regular use, the deployment of the system is performed
running the source code. When the software engineer wants to
obtain the run-time model trace, he can activate the Run-time
Model Trace Generator.</p>
      <p>In the Run-time Model Trace Generator, our infrastructure
controls the implementation code, checks it through the
CodeModel Connection Rules, and, if changes in the run-time model
are necessary, our generator translates the changes in the model
trace at run-time.</p>
      <p>As a summary, the key idea of our infrastructure is a
loop which is responsible for translating the information of
the run-time knowledge from source code to models. Next
subsections present the Code-Model Connection Rules used in
our infrastructure and the steps of our Run-time Model Trace
Generator.
creates</p>
      <p>creates
Models</p>
      <p>
        To generate a model from the executed source code, we
developed a Code-Model Connection Rules, which are
expressed using Event-Condition-Action (ECA) rules [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. We
are not reinventing the ECA rules. The ECA rules have been
intensely studied and used for the management of self-adaptive
systems [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. However, we use these ECA rules in a novel way
to perform changes in a run-time model when the code is
executed.
      </p>
      <p>
        The definition of our rules is based on the ERA language
[
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] to provide mechanism for specifying the execution of
external actions (actions in the run-time model) instead of
internal actions (actions in the running code of the system).
      </p>
      <p>The Code-Model Connection Rules take the following
shape: ’when a line of the source code is executed, the state
of variables change, or both take place, then a model element
should be created, modified, or deleted in the run-time model’.</p>
      <p>For example, when the line of code that creates the gradual
lighting service (GradualLightService
mainGradualLightService=new GradualLightService()) is executed, the
GradualLighting model element in the run-time model must appear.
In this particular case, the rule is depicted as follows:
( GradualLightService mainGradualLightService=new
GradualLightService() ,
IS NOT(LightingServices.GradualLighting) ,</p>
      <p>ADD ELEMENT(LightingServices.GradualLighting));
In this rule, the first parameter (GradualLightService
mainGradualLightService=new GradualLightService()) is the
line of code that triggers the rule. The second
parameter (IS NOT(LightingServices.GradualLighting)) indicates the
condition that must be fulfilled and in which model. The
keyword IS NOT checks if the model element appears in the
run-time model and return true if it is not in the model. In
this case it returns true if the model element GradualLighting
is not in the LightingServices model. The third parameter
(ADD ELEMENT(Lighting- Services.GradualLighting)) is the
kind of modification that must be performed in the run-time
model. In the smart hotel, it is the addition of the model
element GradualLighting in the LightingServices model.</p>
      <p>On the other hand, when the code indicates that the
GradualLightingService is not available any longer
(remove(mainGradualLightService)), the element must be
removed from the run-time model. The rule is similar to the
one for adding model elements:
(remove(mainGradualLightService),</p>
      <p>IS( LightingServices . GradualLighting ) ,</p>
      <p>DEL ELEMENT(LightingServices.GradualLighting));
The first parameter (remove(mainGradualLightService))
is the line of code that must be executed to
trigger the Model-Code Connection rule. The second
parameter (IS(LightingServices.GradualLighting)) indicates if
the model element is in the model. The third parameter
(DEL ELEMENT(LightingServices.Gradual- Lighting)) is the
modification that must be performed in the run-time model. In
this case it is a deletion of the model element GradualLighting
in the LightingServices model.</p>
      <p>Although the idea of the Code-Model Connection Rules is
domain independent, our current implementation is tailored
to the Smart Hotel. Even though these rules have helped us
to address the research questions, our future work involves
designing independent domain rules that combine debug
expressiveness to specify the state of the variables and execution
points (triggers) and OCL-like expressions to specify
(conditions and actions in the run-time model).</p>
      <p>Some model elements may require few rules to be
synchronized with the code, but others may require more effort.
These rules are a trade-off, the more specifications the engineer
makes, the richer the run-time model will be, but at the cost
of the increase in the amount of time that must be spent by
the software engineer in order to specify them.</p>
      <p>One of the main characteristics of our approach is that,
by means of the Code-Model Connection Rules, the software
engineer can change the set of the models defined at
designtime that will be used at run-time. That is, the software
engineer can decide how many model elements should be
connected with the running code.</p>
      <p>B. Run-time Model Trace Generator</p>
      <p>
        Szvetis and Zdum [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] creates a classification of the
objectives, techniques, kinds and architectures used with models at
run-time. According to their categories, we can classify our
infrastructure to work with models at run-time as follows:
Objectives: The main one is monitoring the system by
using models in order to help the understanding of the
system behavior. In addition, we use models to raise the
abstraction level and bring closer the problem to the user.
Finally, the use of models provides platform-independent
views of the system under observation.
      </p>
      <p>Technique: We use the introspection technique that deals
with extraction of run-time system data in order to
apply model-based techniques on the analyzed behavior.
In addition, they subdivided the introspection in three
main groups: event log checking, instrumentation and
management API.</p>
      <p>Specifically, our infrastructure is similar to the
instrumentation group. Even though, we do not insert any extra
source code to the system. We use the rules to translate
the running software of a system into a model.</p>
      <p>Kind: Our infrastructure does not depend on one kind of
model. We use a domain specific language (PervML, see
section II), however, the model generated depends on the
defined rules and the user can choose whoever he wants.
Architecture: We use a model-aware middle-ware
architecture. This architecture allows us to monitor the system
while our solution checks the rules and creates the model
at run-time.</p>
      <p>The Code-Model Connection rules previously presented
enables to reflect running-code changes into a descriptive
runtime model. The details of our infrastructure are depicted in
Fig. 3.</p>
      <p>
        Controller: When the system is running, the running
source code needs to be controlled (see Fig. 3). The
implementation of the controller is developed by means of
the Java Code Language Introspection Capabilities [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ].
Our infrastructure uses the run-time state of the code as
input to check conditions from the Code-Model
Connection Rules. In the running example, our approach
detects every time that the line ’GradualLightService
mainGradualLightService = new GradualLightService()’
is executed.
      </p>
      <p>
        Once a relevant change in the state of the code is
detected, our approach checks if the conditions of the
Code-Model Connection Rule is fulfilled. In the running
example, our approach checks if the GradualLighting
model element appears in the LightingServices run-time
model, (’IS NOT(LightingServices.GradualLighting)’).
Translator: The response of the controller is used to
translate the source code into models (see Fig. 3). The
implementation of the translator is developed by means
of the EMF Introspection Capabilities [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ].
      </p>
      <p>Our infrastructure uses the action of the Code-Model
Connection Rule to determine the modifications that must
be performed in the run-time model. In the running
example, the action determines that the
GradualLighting model element must be added to the
LightingServices run-time model (’ADD ELEMENT(
LightingServices.GradualLighting)’). If the model element does not
appear in the run-time model, it checks the design-time
models and takes the information that is needed in order
to add this model element to the run-time model. If
the model element appears in the run-time model, our
approach checks if some modifications are necessary.
The run-time model is modified in order to add, modify
or delete the model elements specified in the
CodeModel Connection Rules. In the running example, the
GradualLighting model element is added to the run-time
model.</p>
      <p>The model generated at run-time only includes elements that
have been executed. This run-time model is the main artifact
that the software engineer can use to improve his knowledge
of the system. We extract the run-time representation of the
system as models to enable reasoning on a high level of
abstraction.</p>
    </sec>
    <sec id="sec-5">
      <title>IV. VALIDATION</title>
      <p>
        We validate whether our infrastructure creates the correct
models at run-time. To do that, we compare our model traces
generated at run-time with an oracle that is composed by the
models of the defined scenarios in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. We generate a run-time
model trace while the other model trace is extracted from a
previous work [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], we compare both traces in order to detect
differences.
      </p>
      <p>
        We defined the experimental design of our study using
the Goal-Question-Metric method (GQM) [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. We used the
template presented in [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]. The GQM method was defined as
a mechanism for defining and interpreting a set of operation
Comparison with
the oracle
goals using measurements. In this evaluation, our goal was the
following:
      </p>
      <p>Object: Our Smart Hotel
Purpose: Validation
Issue: The correctness of the models generated at
runtime
Context: The infrastructure for of our Run-time Model
Trace Generator</p>
      <p>To fulfill this goal, we focused on answering the following
research question:
1) Does our infrastructure generate the same model traces
as the oracle?</p>
      <p>
        Basili in [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] and Travassos in [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] describe four kinds
of studies: in-vivo, in-vitro, in-virtuo, and in-silico. In our
case, we chose to carry out in-virtuo experiments, where the
real world is described as computer models. This experiment
involves the interaction among participants and a computerized
model of reality. The simulated environment offers major
advantages regarding the cost and the feasibility of replicating
a real-world configuration. In addition, some scenarios such
as res or floods cannot be replicated in the real world.
      </p>
      <p>
        The Smart Hotel is developed by means of a software
product line, the PervML model and the source code of the
Smart Hotel are configured with a feature model. The feature
model specifies the 39 different features that the Smart Hotel
has implemented. We use the PervML model traces of the [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]
approach as an oracle to evaluate the presented approach. That
is, we make use of a set of implementation codes whose model
realizations are known beforehand and will be considered as
the ground truth, enabling us to compare the run-time traces
extracted from the [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] approach with the results of the models
generated by our infrastructure.
      </p>
      <p>
        Figure 4 shows the entire process that we have followed
in this validation. For the validation, we used the Smart
Hotel defined in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. The Smart Hotel presents 476 model
elements in the design-time models. It consists of 268 classes
implemented in about 67,207 methods of Java source code.
In the evaluation set-up, a simulated environment was used
to represent the Smart Hotel. In addition, at design-time, the
Code-Model Connection Rules and the scenario are defined
to allow the generation of the trace model from the code at
run-time, as shown in Fig. 4 (A).
      </p>
      <p>After running the scenario, see Fig. 4 (B), our Run-time
Model Trace Generator (see Fig. 4 left) generates the
runtime model. The infrastructure monitors the running code
and applies the corresponding Code-Model Connection Rules
to translate source code behavior into a descriptive run-time
model trace.</p>
      <p>
        For the comparison, see Fig. 4 (C), we collect the traces by
means of the Reconfiguration Tracker that is provided by the
implementation of the Smart Hotel that we used [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>At the end, we have two set of models that represents the
behavior of the system. One of the set is generated by our
Run-time Model Generation and the second set is the oracle.
Then, we can compare the results of the two approaches.</p>
      <p>The number of model elements in the run-time model
depends on the Code-Model Connection Rules defined. As we
wanted to determine if the models generated was equivalent,
we performed the validation with a set of rules that connected
all the possible elements with the source code. By this way,
we could compare both models traces easily.</p>
      <p>Therefore, the number of rules that the software engineer
must use is an open topic that will be addressed in the future.
The specification of the rules takes times and it is not always
necessary to specify all of them. Thus, I hope I can guide the
software engineer about what are the rules he need to specify.</p>
      <p>A concrete example of our validation is shown in Fig. 5.
The Smart Hotel is defined with a large number of models
(see section II), however in this section we only show one of
these models. As the examples show, all the models obtained
are a subset of the entire definition of the Smart Hotel.</p>
      <p>The fist one of the models of Fig. 5, Smart Hotel PervML
Structural Model, corresponds to the one that defines the
entire system of the Smart Hotel. The second one, Smart
Hotel PervML Structural Model in Watching a Movie Scenario
represents the model generated in the Watching a Movie
Smart Hotel PervML Structural Model</p>
      <p>Watching a Movie Scenario</p>
    </sec>
    <sec id="sec-6">
      <title>Scenario.</title>
      <p>The definition of the Watching a Movie scenario is as
follows:</p>
      <p>’The user of the hotel decides to watch a movie from the
of which the hotel offers. The user can select the movie in the
screen of the control panel. In addition, the user will be able
to choose the room preferences (illumination and temperature)
for a better experience. The system will give him many options
so he can choose the one that suits him more. The user is
enjoying the movie but, someone is calling to his cell phone
with Bluetooth technology synchronized with the rooms main
system. This call will be notified through the main screen. He
is forced to stop watching the movie but he will have the option
to continue where he left at any other time during his stay.’</p>
      <p>Then, the main devices that are involved in this scenario
are the cell phone, the control panel, the central dock. Some
other devices related to this scenario are ones related to the
illumination and temperature services. In the same way, the
main service in this scenario is the multimedia service, and
also the ones related to illumination and temperature.</p>
      <p>This trace generated from this scenario is formed by 23
channels, 13 devices and 9 services in the Smart Hotel PervML</p>
    </sec>
    <sec id="sec-7">
      <title>Structural model (see bottom part of Fig. 5).</title>
      <p>A. Does our infrastructure generate the same model traces as
the oracle?</p>
      <p>The results of our infrastructure show promising results
towards the generation of model traces from source code at
run-time.</p>
      <p>The results obtained in this validation suggest that our
infrastructure generates a valid model trace from the running
scenarios. All the generated traces contain the main devices
and services necessary for execute the defined scenario.</p>
      <p>However, the trace generated with our infrastructure
contained more information than the trace from the oracle. But, the
trace from the oracle was contained in the trace generated with
our infrastructure. The major difference between our generated
model traces at run-time and the traces from the oracle lies in
the number of attributes of the model element.</p>
      <p>In addition, it is necessary further specific experiments in
order to identify more relevant correlations between the source
code and the run-time models. However, the Code-Model
Connection Rules have flexibility to enable and disable the
model elements that must appear in the run-time model trace.</p>
      <p>Another issue detected is related to the dependencies
between model elements. The management of the dependencies
through the use of the Code-Model Connection Rules is
cumbersome and error prone. We detect that a dependency
tree could be very useful to check the consistency of the model
trace while it is being generated.</p>
      <p>Moreover, our infrastructure generates the model trace to
increase the level of abstraction and to ease the maintenance
task. But nevertheless, the maintenance task must be
performed at source code level because the infrastructure does
not allow propagate changes in the models to the source code
of the system.</p>
      <p>In spite of the results, this initial effort must not be
underestimated since the Run-time Model Trace Generator produced
proper output to see the first results. The overall performance
of the infrastructure needs more tests. Further work is required
to see if these concerns are reasonable and if so, find out how
to these previous problems can be solved.</p>
    </sec>
    <sec id="sec-8">
      <title>V. THREATS TO VALIDITY</title>
      <p>
        We use the classification of threats to validity in [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. This
classification distinguishes four aspects of validity:
1) Construct validity: This aspect of validity reflects the
extent to which the operational measures that are studied
represent what the researchers have in mind and what is
investigated based on the research questions.
      </p>
      <p>The purpose validation does not have a true/false answer.
To minimize this threat the scenarios were designed
by two experts in the Smart Hotel. These experts have
developed the Smart Hotel and in other model-based
tools (in the induction hob domain and train control
software domain). Their participation was limited to the
design of the scenarios.</p>
      <p>
        The measure used in our research is the similarity of our
model traces extracted and the oracle. These similarity
measures have been proved in other kind of models with
fair results [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ].
2) Internal validity: This aspect of validity is of concern
when causal relations are examined. There is a risk that
the factor being investigated may be affected by other
neglected factors.
      </p>
      <p>In our work, this is a very low risk due to the human task
are reduced to the minimum. The comparison between
the traces were performed automatically by a computer,
therefore the humans did not affect the final result.
3) External validity:This aspect of validity is concerned
with to what extent it is possible to generalize the
finding, and to what extent the findings are of relevance
for other cases.</p>
      <p>The software system used in the validation is
representative of those used in practice. Given the scale
and complexity of our Smart Hotel, we consider our
evaluation a good starting point representing a realistic
case. However, this threat can be reduced if we
experiment with other software systems of different sizes and
domains.
4) Reliability: This aspect is concerned with to what extent
the data and the analysis are dependent on the specific
researchers.</p>
      <p>The main risk relies on the selection of the running
scenarios to obtain the execution trace of the models.
Since we are experts in the Smart Hotel system, we
can claim that our scenarios are good representatives
of the entire system, and, therefore, our infrastructure
generates the correct models for all the system. However,
depending on the chosen scenarios, the result may differ.</p>
    </sec>
    <sec id="sec-9">
      <title>VI. RELATED WORK</title>
      <p>Some approaches use the run-time models to visualize and
analyze data from model-based systems. Although they do
not generate the run-time models, their works are based on
extracting information from run-time models.</p>
      <p>
        Graf and Mller-Glaser [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] define various
debuggingperspectives independent of the actual execution platform for
identifying error occurrences. They extract run-time
information out of the executed binary from the target platform and
transport this information back to the model level. Obtained
run-time information can then be used to visualize the internal
state of the executable. In contrast to our approach, they extend
the UML meta-model with meta-classes that allow storage of
data acquired by the model mapping.
      </p>
      <p>
        Maoz [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] introduces an approach which uses model-based
traces to record the run-time of a system through abstractions
provided by models used in its design. The traces include
information about the systems from which they were
generated, the models that induced them and the relationships
between them at run-time. The approach is focused on metrics
and operators for such traces to understand the structure and
behavior of a running system while we are focused on the
infrastructure to generate the run-time model from source
code.
      </p>
      <p>
        Bodenstaff et al [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ] uses event log checking to check a
model against the running system. They assume that the event
log is consistent with the running system and also with a model
if essential parts of the model do not contradict. In contrast to
our approach, they are focus on identifying relevant parts of
the log event and extract them as models while our approach
generates the models directly from the running system.
      </p>
      <p>
        Szvetits et al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] propose the usage of run-time models
in combination with model-driven techniques and interactive
visualizations to ease tracing between log file entries and
corresponding software artifacts. They creates a
repositorybased approach to augment root cause analysis with interactive
tracing views to maximize the re-usability of models created
during the software development process. In contrast to our
approach, they focus their work on the interactive
visualizations while our work is focused on the generation of run-time
models from non-model-based system. However, we can apply
their techniques to analyze the model traces that we extract
from the running system.
      </p>
      <p>Some other approaches insert monitoring functionality into
the system in order to observe the system behavior.</p>
      <p>
        Nierstrasz et al. [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ] use instrumentation at run-time in
combination with and Abstract Syntax Tree (AST) model as
abstraction above the byte-code level. They use the concept
of links to be set as annotations to AST nodes which are
transferred by a compiler plugin before execution. This results
in code to be inserted in the program at nodes where links are
installed. Such links can also be installed by other links or
manipulated by themselves.
      </p>
      <p>
        Hamann et al. [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ] propose monitoring of JVM hosted
applications by using platform-aligned model (PAM) as link
between the platform-specific model (PSM) and the
platformindependent model (PIM). A PAM is iteratively designed
through assumptions which are stated, checked, and refined.
      </p>
      <p>This kind of approaches requires the source code of the
system to be available. In contrast to us, this approaches extract
the run-time data and then they translate the extracted data as
models to enable reasoning on a high level of abstraction while
we extract the data as models at run-time and do not introduce
anything new in the source code.</p>
    </sec>
    <sec id="sec-10">
      <title>VII. CONCLUSION</title>
      <p>This work proposes a generic infrastructure to generate
run-time models through the use of connection rules called
Code-Model Connection Rules. Specifically, our infrastructure
allows change from source-code to descriptive models
increasing the abstraction level.</p>
      <p>Our validation in our Smart Hotel compares the result
obtained from our infrastructure and from a oracle. We use the
model traces generated to determine if the results obtained are
correct. The results of the validation of our infrastructure show
promising results towards the generation of model traces from
source code at run-time. However, further work is required to
a better specification of the Code-Model Connection Rules, to
solve some issues with the model dependencies and to allow
the performance of maintenance tasks at model level, that is,
the propagation of changes in the models to the source code.</p>
      <p>In addition to the previous one, our future work involves
designing independent domain rules that combine debug
expressiveness to specify the state of the variables and execution
points (triggers) and OCLlike expressions to specify
(conditions and actions in the run-time model).</p>
    </sec>
    <sec id="sec-11">
      <title>ACKNOWLEDGMENT</title>
      <p>This work has been partially supported by the Ministry of
Economy and Competitiveness (MINECO) through the
Spanish National R+D+i Plan and ERDF funds under the project
Model-Driven Variability Extraction for Software Product Line
Adoption (TIN2015-64397-R).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>U.</given-names>
            <surname>Aßmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Bencomo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. H. C.</given-names>
            <surname>Cheng</surname>
          </string-name>
          , and R. B. France, “Models@run.time (
          <issue>Dagstuhl Seminar 11481</issue>
          ),” Dagstuhl Reports, vol.
          <volume>1</volume>
          , no.
          <issue>11</issue>
          , pp.
          <fpage>91</fpage>
          -
          <lpage>123</lpage>
          ,
          <year>2012</year>
          . [Online]. Available: http://drops.dagstuhl.de/opus/volltexte/2012/3379
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>H.</given-names>
            <surname>Giese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Bencomo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Pasquale</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. J.</given-names>
            <surname>Ramirez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Inverardi</surname>
          </string-name>
          , S. Wa¨tzoldt, and
          <string-name>
            <given-names>S.</given-names>
            <surname>Clarke</surname>
          </string-name>
          , Models@run.time: Foundations, Applications, and Roadmaps. Cham: Springer International Publishing,
          <year>2014</year>
          , ch.
          <source>Living with Uncertainty in the Age of Runtime Models</source>
          , pp.
          <fpage>47</fpage>
          -
          <lpage>100</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3] IBM, “
          <article-title>An architectural blueprint for autonomic computing,” IBM, Tech</article-title>
          . Rep.,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>M. M. Lehman</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Ramil</surname>
          </string-name>
          , and G. Kahen, “
          <article-title>A paradigm for the behavioural modelling of software processes using system dynamics,” Imperial College of Science, Technology and Medicine</article-title>
          ,
          <source>Department of Computing, Tech. Rep</source>
          .,
          <year>Sep 2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>B.</given-names>
            <surname>Dit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Revelle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gethers</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Poshyvanyk</surname>
          </string-name>
          , “
          <article-title>Feature location in source code: A taxonomy and survey</article-title>
          ,”
          <source>in Journal of Software Maintenance and Evolution: Research and Practice</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>M.</given-names>
            <surname>Szvetits</surname>
          </string-name>
          and U. Zdun, “
          <article-title>Enhancing root cause analysis with runtime models and interactive visualizations</article-title>
          ,” in 8th International Workshop on Models at Run.time, Miami, Florida, USA,
          <year>September 2013</year>
          . [Online]. Available: http://eprints.cs.univie.ac.at/3764/
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>H. W.</given-names>
            <surname>Dettmer</surname>
          </string-name>
          ,
          <article-title>Goldratt's theory of constraints: a systems approach to continuous improvement</article-title>
          . ASQ Quality Press,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>C.</given-names>
            <surname>Cetina</surname>
          </string-name>
          , “
          <article-title>Achieving autonomic computing through the use of variability models at run-time,”</article-title>
          <source>Ph.D. dissertation</source>
          , Universidad Polite´cnica de Valencia,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>J.</given-names>
            <surname>Mun</surname>
          </string-name>
          <article-title>˜oz, “Model driven development of pervasive systems. building a software factory</article-title>
          ,
          <source>” Ph.D. dissertation</source>
          , Universidad Polite´cnica de Valencia,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>D.</given-names>
            <surname>Marples</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Kriens</surname>
          </string-name>
          , “
          <article-title>The open services gateway initiative: an introductory overview</article-title>
          ,
          <source>” IEEE Communications Magazine</source>
          , vol.
          <volume>39</volume>
          , no.
          <issue>12</issue>
          , pp.
          <fpage>110</fpage>
          -
          <lpage>114</lpage>
          ,
          <year>Dec 2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>J. O.</given-names>
            <surname>Kephart</surname>
          </string-name>
          and
          <string-name>
            <given-names>W. E.</given-names>
            <surname>Walsh</surname>
          </string-name>
          , “
          <article-title>An artificial intelligence perspective on autonomic computing policies</article-title>
          ,”
          <source>in Proceedings of the 5th IEEE International Workshop on Policies for Distributed Systems and Networks. POLICY '04</source>
          ,
          <year>June 2004</year>
          , pp.
          <fpage>3</fpage>
          -
          <lpage>12</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J. J.</given-names>
            <surname>Alferes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Banti</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Brogi</surname>
          </string-name>
          ,
          <source>Logics in Artificial Intelligence: 10th European Conference, JELIA 2006 Liverpool, UK, September 13- 15</source>
          ,
          <year>2006</year>
          Proceedings. Berlin, Heidelberg: Springer Berlin Heidelberg,
          <year>2006</year>
          ,
          <string-name>
            <given-names>ch. An</given-names>
            <surname>Event-Condition-Action Logic</surname>
          </string-name>
          Programming Language, pp.
          <fpage>29</fpage>
          -
          <lpage>42</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>M.</given-names>
            <surname>Szvetits</surname>
          </string-name>
          and U. Zdun, “
          <article-title>Systematic literature review of the objectives, techniques, kinds, and architectures of models at runtime</article-title>
          ,
          <source>” Software &amp; Systems Modeling</source>
          , vol.
          <volume>15</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>31</fpage>
          -
          <lpage>69</lpage>
          ,
          <year>2016</year>
          . [Online]. Available: http://dx.doi.org/10.1007/s10270-013-0394-9
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>K.</given-names>
            <surname>Arnold</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Gosling</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Holmes</surname>
          </string-name>
          ,
          <article-title>The Java programming language 4th Edition</article-title>
          . Addison-wesley,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15] “
          <article-title>The eclipse project: Emf model query</article-title>
          .” [Online]. Available: https://projects.eclipse.org/projects/modeling.emf.query
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>V. R.</given-names>
            <surname>Basili</surname>
          </string-name>
          , “
          <article-title>The role of experimentation in software engineering: Past, current</article-title>
          , and future,”
          <source>in Proceedings of the 18th International Conference on Software Engineering</source>
          , ser.
          <source>ICSE '96</source>
          . Washington, DC, USA: IEEE Computer Society,
          <year>1996</year>
          , pp.
          <fpage>442</fpage>
          -
          <lpage>449</lpage>
          . [Online]. Available: http://dl.acm.org/citation.cfm?id=
          <volume>227726</volume>
          .
          <fpage>227818</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>V. R.</given-names>
            <surname>Basili</surname>
          </string-name>
          , G. Caldiera, and
          <string-name>
            <given-names>H. D.</given-names>
            <surname>Rombach</surname>
          </string-name>
          , “
          <article-title>The goal question metric approach,” in Encyclopedia of Software Engineering</article-title>
          . Wiley,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <surname>M. O. B. G. H. Travassos</surname>
          </string-name>
          , “
          <article-title>Contributions of in virtuo and in silico experiments for the future of empirical studies in software engineering</article-title>
          ,” in
          <source>In Proceedings of the Workshop on Empirical Studies in Software Engineering (ESEIW)</source>
          .
          <source>IEEE Computer Society</source>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>P.</given-names>
            <surname>Runeson and M. Ho</surname>
          </string-name>
          <article-title>¨st, “Guidelines for conducting and reporting case study research in software engineering,” Empirical Softw</article-title>
          . Engg., vol.
          <volume>14</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>131</fpage>
          -
          <lpage>164</lpage>
          , Apr.
          <year>2009</year>
          . [Online]. Available: http://dx.doi.org/10.1007/s10664-008-9102-8
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>M.</given-names>
            <surname>Ehrig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Koschmider</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Oberweis</surname>
          </string-name>
          , “
          <article-title>Measuring similarity between semantic business process models</article-title>
          ,”
          <source>in Proceedings of the Fourth Asia-Pacific Conference on Comceptual Modelling -</source>
          Volume
          <volume>67</volume>
          ,
          <article-title>ser</article-title>
          .
          <source>APCCM '07</source>
          .
          <string-name>
            <surname>Darlinghurst</surname>
          </string-name>
          , Australia, Australia: Australian Computer Society, Inc.,
          <year>2007</year>
          , pp.
          <fpage>71</fpage>
          -
          <lpage>80</lpage>
          . [Online]. Available: http://dl.acm.org/citation.cfm?id=
          <volume>1274453</volume>
          .
          <fpage>1274465</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>P.</given-names>
            <surname>Graf and K. D.</surname>
          </string-name>
          Muller-Glaser, “
          <article-title>Dynamic mapping of runtime information models for debugging embedded software</article-title>
          ,
          <source>” in Seventeenth IEEE International Workshop on Rapid System Prototyping (RSP'06)</source>
          ,
          <year>June 2006</year>
          , pp.
          <fpage>3</fpage>
          -
          <lpage>9</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>S.</given-names>
            <surname>Maoz</surname>
          </string-name>
          , “
          <article-title>Using model-based traces as runtime models</article-title>
          ,
          <source>” Computer</source>
          , vol.
          <volume>42</volume>
          , no.
          <issue>10</issue>
          , pp.
          <fpage>28</fpage>
          -
          <lpage>36</lpage>
          ,
          <year>Oct 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>L.</given-names>
            <surname>Bodenstaff</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Wombacher</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Reichert</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Wieringa</surname>
          </string-name>
          , “
          <article-title>Made4ic: an abstract method for managing model dependencies in inter-organizational cooperations</article-title>
          ,
          <source>” Service Oriented Computing and Applications</source>
          , vol.
          <volume>4</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>203</fpage>
          -
          <lpage>228</lpage>
          ,
          <year>2010</year>
          . [Online]. Available: http://dx.doi.org/10.1007/s11761-010-0062-7
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>O.</given-names>
            <surname>Nierstrasz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Denker</surname>
          </string-name>
          , and
          <string-name>
            <given-names>L.</given-names>
            <surname>Renggli</surname>
          </string-name>
          , Model-Centric,
          <article-title>Context-Aware Software Adaptation</article-title>
          . Berlin, Heidelberg: Springer Berlin Heidelberg,
          <year>2009</year>
          , pp.
          <fpage>128</fpage>
          -
          <lpage>145</lpage>
          . [Online]. Available: http://dx.doi.
          <source>org/10.1007/978- 3-642-02161-9 7</source>
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25] L. Hamann, M. Gogolla, and
          <string-name>
            <given-names>M.</given-names>
            <surname>Kuhlmann</surname>
          </string-name>
          , “
          <article-title>Ocl-based runtime monitoring of jvm hosted applications,” Electronic Communications of the EASST</article-title>
          , vol.
          <volume>44</volume>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>