<!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>Model-driven Development of Adaptive IoT Systems</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mahmoud Hussein</string-name>
          <email>mahmoud.hussein@cea.fr</email>
          <email>mahmoud.hussein@ci.menofia.edu.eg</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Shuai Li</string-name>
          <email>shuai.li@cea.fr</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ansgar Radermacher</string-name>
          <email>ansgar.radermacher@cea.fr</email>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>CEA, LIST, Laboratory of Model Driven Engineering for Embedded Systems</institution>
          ,
          <addr-line>P.C. 174, Gif-sur-Yvette, 91191</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Faculty of Computers and Information, Menofia University</institution>
          ,
          <country country="EG">Egypt</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>There is an increasing demand for software systems that utilize the new Internet of Things (IoT) paradigm to provide users with the best functionalities, through transforming objects from traditional to smart ones. In recent years, a number of approaches have been proposed to enable the development of such IoT systems. However, developing IoT systems that adapt at runtime is still a major challenge. In this paper, we propose a model-driven approach to ease the modeling and realization of adaptive IoT systems. First, to model an IoT system, we adopted SysML4IoT (an extension of the SysML) to specify the system functions and adaptations. We also adopted a publish/subscribe paradigm to model environment information and its relationship with the system. Second, based on the system design model, code is generated which is deployed later on to the hardware platform of the system. To show our approach applicability, we have developed a smart lighting system in the context of the S3P project.</p>
      </abstract>
      <kwd-group>
        <kwd>- IoT Systems</kwd>
        <kwd>Adaptive Software</kwd>
        <kwd>Model-driven</kwd>
        <kwd>PublishSubscribe Paradigm</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>INTRODUCTION</p>
      <p>
        Recently, a growing number of objects have been connected
to the internet for realizing the idea of Internet of Things (IoT)
in a number of domains such as smart homes, transportation,
healthcare, industrial automation, etc. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. In these domains, the
IoT paradigm transforms objects from traditional to smart ones
to provide end users with functions and qualities of IoT systems.
Such systems need to be adapted at runtime to take the
environment changes into account [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. A major challenge is how
to develop such adaptive IoT software systems [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        In recent years, a number of approaches have been proposed
to ease the development of IoT systems (e.g. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], and
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]). However, these approaches do not enable runtime
adaptation of IoT systems while they are in operation. In
addition, some of the existing approaches focus only on one
development phase (e.g. analysis [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] or deployment [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]). Thus,
there is a need for an approach that fully supports the
development of adaptive IoT software systems.
      </p>
      <p>
        In this paper, we propose a model-driven approach to ease
the development of the adaptive IoT systems. First, based on the
system requirements, a design model is specified. This model
captures the system functionality and adaptations. The
functionality is modelled using an extension of SysML [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] for
capturing IoT concepts (i.e. SysML4IoT) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], while the
environment information needed by the system are modelled
following a publish/subscribe pattern [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. To model the system
adaptations, a state machine approach is adopted [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. The
machine states represent the different configurations of the
system, while the transitions represent its adaptation triggers
(i.e. the pre-conceived changes to which the system can adapt)
such as concrete hardware failures. Second, the design model is
used to generate the system implementation. To do so, the
design model is transformed to an IoT platform specific model,
which is then used for generating the code. Finally, this code is
deployed to a hardware platform to have a fully functioning
software system.
      </p>
      <p>
        To show the applicability of our approach, we have used it
to develop a smart lighting system in the context of the S3P
project (Smart, Safe and Secure Platform, see [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]). The system
hardware platform has temperature and luminosity sensors, a
light strip, an Edison board [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] that has a data distribution
service (DDS), i.e., Java implementation of publish/subscribe
paradigm [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], and a board with the MicroEJ operating system
[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. At runtime, our approach also supports the synchronization
between the lighting system execution and its design, through
reflecting the system state to its design model.
      </p>
      <p>The remainder of the paper is organized as follows. A short
description of related work is given in Section II. Our approach
for designing an adaptive IoT software system and generating
its implementations is described in Section III. In Section IV, we
present our approach implementation. Finally, we conclude the
paper in Section V.</p>
      <p>II.</p>
      <p>The work introduced in this paper is related to developing
IoT and adaptive systems. In the following, we describe related
work from these two angles.</p>
    </sec>
    <sec id="sec-2">
      <title>A. Developing IoT Systems</title>
      <p>
        Patel and Cassou have proposed an approach to ease the
development of IoT systems [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. In this approach, the different
system concerns are separated by a development methodology
which is implemented through a development framework. This
framework supports stakeholder actions to develop, deploy, and
maintain an IoT system. It provides a set of modelling languages
for specifying each development concern and to abstract the
complexity related to the system heterogeneity and scale. The
approach also provides automation through code generation that
allows stakeholders to focus on the system’s functional logic
while the task mapping and linking techniques produce a
devicespecific code that results in a distributed system hosted by the
individual devices.
      </p>
      <p>
        The approach proposed by Costa et al. aims to design IoT
systems and verify their QoS properties [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. To model the
system, they have introduced SysML4IoT, a SysML profile
based on the IoT reference architecture model [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. They also
proposed a model-to-text translator called SysML2NuSMV. It
converts an IoT model to a NuSMV (symbolic model verifier)
program automatically [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. Using the SysML4IoT, elements of
the system and their properties can be precisely identified by
software engineers. The engineers are also able to verify system
properties without modifying the system model (i.e., to keep its
precision and alignment with the IoT reference model). The
approach also does not require any profound knowledge about
NuSMV programs from the engineers.
      </p>
      <p>
        A model-driven approach for improving the reusability and
flexibility of sensor software systems, called FRASAD
(FRAmework for Sensor Application Development), has been
proposed in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. In this approach, the system is described using
a rule-based model and a Domain Specific Language (DSL).
The FRASAD tool has a graphical user interface, code
generation components, and supporting tools for helping the
developers in modelling, realizing, and testing an IoT system.
The evaluation of the approach showed that it enables fast
development of IoT systems, and reduces the cost of dealing
with their complexity.
      </p>
      <p>
        The deployment of IoT systems to heterogeneous sensors,
actuators, and business components is a challenging task. Thus,
the Open TOSCA (Topology and Orchestration Specification
for Cloud Applications) runtime has been proposed to ease this
task [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. This runtime platform supports the automated
planbased deployment and management of the IoT systems defined
following the packaging format of TOSCA, which called CSAR
(Cloud Service ARchive). This format enables the bundling of
all system entities (e.g. management and business operations) in
a self-contained manner.
      </p>
      <p>
        For building interoperable and cross-domain IoT systems, a
Machine-to-Machine Measurement (M3) framework has been
introduced in [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. The framework supports the IoT developers
in semantically annotating machine-to-machine (M2M) data,
and generating IoT software systems by combining M2M data
from heterogeneous areas. Therefore, end users can receive the
high-level information about their sensor data.
      </p>
    </sec>
    <sec id="sec-3">
      <title>B. Developing Adaptive Systems</title>
      <p>
        The Rainbow framework provides mechanisms to monitor a
system environment, analyze it for initiating the adaptation
process, select the required adaptation strategy, and act needed
changes to the running system [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]. To capture the system
reactions to context changes, they use a language called Stitch.
      </p>
      <p>
        Sheng et al. proposed a model-driven approach to ease the
development of context-aware services [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ]. In this approach,
they consider the service functionality as a single service, and
the environment changes are used by a number of adaptation
rules to adapt the output parameters of this service.
      </p>
      <p>
        Zhang and Cheng inroduced an approach to create formal
models of a system behaviour [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. In this approach, the system
adaptive behavior is separated from its non-adaptive behavior.
This separation makes the system models easier to specify and
verify. They used Petri-nets to capture the system adaptive
behaviour, where the environment changes are used as guidance
for the transition between system states.
      </p>
      <p>
        The SOCAM project (Service-Oriented Context-Aware
Middleware) has introduced an architecture to build adaptive
software systems [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. It uses a central server for gathering
context information from distributed context providers. Such
information is then processed, so that it can be used by the
system functionality.
      </p>
      <p>
        The MUSIC project is a component-based framework that is
used to optimize the system overall utility in response to the
context changes [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. They have a quality of service (QoS)
model that describes the system composition together with the
relevant QoS dimensions, and how they are affected when the
system changes from one configuration to another. The quality
of service model is used for selecting a new configuration that
has the best utility and is able to cope with the context changes.
      </p>
      <p>
        Heaven et al. have developed an approach for adapting a
software system in response to the environment changes while
preserving its high level goals [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ]. They use Labelled
Transition Systems (LTS) to capture the system states and the
environment situations.
      </p>
      <p>
        Andrade et al. have proposed an approach to cope with the
unanticipated changes of a system’s adaptive behaviour [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ].
They separate the system adaptation from its functionality, and
represent the adaptation logic as a set of condition-action rules.
These rules are constructed as a component-based system that
can be changed at runtime.
      </p>
      <p>
        Morin et al. proposed a technique to handle the exponential
growth of the number of configurations that are derived from the
system’s high variability [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ]. They combine model driven and
aspect oriented approaches to cope with the complexity of
adaptive software systems.
      </p>
      <p>Limitations. The approaches discussed above for developing
IoT systems do not enable their runtime adaptation in response
to environment changes. However, IoT systems need to be
adapted in response to hardware and software failures (e.g. a
sensor failure, or unavailability of a function). In addition, the
approaches proposed for developing adaptive systems target
general software, which makes their adoption for IoT software
development difficult and error prone due to the complexity
introduced by IoT system characteristics such as their large scale
and distributed nature. Furthermore, some of the existing
approaches focus only on one development phase (e.g. analysis
or deployment). Therefore, there is a need for an approach that
fully supports the development of IoT software systems, and
enables their runtime adaptation to cope with the environment
changes.</p>
      <p>III.</p>
      <sec id="sec-3-1">
        <title>DEVELOPMENT OF IOT ADAPTIVE SYSTEMS</title>
        <p>To ease the development of adaptive IoT systems, we have
proposed a two-phase process (see Figure 1). In the first phase,
a system model is created to specify the system functionality and
its adaptive behavior. In phase two, code corresponding to the
design model is generated. In the following, we describe the two
phases in detail.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>A. Modelling Adaptive IoT Systems</title>
      <p>To model an adaptive IoT software system, two aspects of
the system need to be captured: the system functionality and its
adaptive behavior. The adaptive behavior specifies the system
reactions to a number of anticipated context changes such as a
sensor failure.</p>
      <sec id="sec-4-1">
        <title>1 Design Model</title>
        <p>Functional Model
Adaptation Model
2</p>
      </sec>
      <sec id="sec-4-2">
        <title>Generate IoT</title>
      </sec>
      <sec id="sec-4-3">
        <title>Platform Model</title>
        <p>Generate</p>
        <p>
          Code
e
z
i
n
o
r
h
c
n
y
S
Adaptive System Execution
The System Functionality. The system consists of a set of
functions that interact with each other to meet the end user
requirements. To model such functionality, we first adopted a
SysML extension that is called SysML4IoT [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] for capturing IoT
concepts. The SysML4IoT profile is based on the IoT reference
architecture model (see Figure 2) [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]. In the SysML4IoT, the
IoT system (referred to as an Augmented Entity) consists of
Devices and Services. A device is a hardware element which can
be a Tag (to identify a Physical Entity such as a light strip id), a
Sensor (to monitor a physical entity such as temperature), or an
Actuator (to act on a physical entity such as turning lights on or
off). A service is a software component to enable interactions
between the system users (which can be Human or Digital
Artifact) and the physical entities. The service also exposes a
Resource that can be on a device or on the network.
        </p>
        <p>Following the SysML4IoT profile, we model an IoT system
as a composite structure that includes a number of functional
services (e.g. light strip controller), a set of sensors to monitor
environment information required by the functional services
(e.g. current temperature and luminosity level), and a number of
actuators to control parts of the system (e.g. switching the light
strip to on or off).</p>
        <p>
          Second, we adopted a publish/subscribe pattern to specify
which information is provided by the sensors or required by the
functional services [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. In this pattern, the Topic concept is used
to specify the required or provided information, while the Data
Reader and Data Writer concepts are used for specifying readers
and writers of the topics information.
        </p>
        <p>Following the publish/subscribe paradigm, we modeled the
environment information as a set of topics (e.g. temperature and
luminosity), while the data reader concept is applied to a
functional service (e.g. a light controller to read the luminosity
level) and the data writer is applied to sensors (e.g. temperature
sensor to provide the current temperature).</p>
        <p>
          The System Adaptive Behavior. To adapt an IoT system in
response to environment changes, we have introduced a system
management component [
          <xref ref-type="bibr" rid="ref25">25</xref>
          ]. This component is responsible for
the system switching from a configuration to another in response
to an adaptation trigger. Therefore, we need to model adaptation
triggers and different runtime configurations (states) of the IoT
system. Both represent a runtime system state, and then we
model both of them as UML instance specifications. These
specifications describe component instances along with values
for their attributes. Such a set is called a deployment plan, a term
inspired from the CORBA component model. In our approach,
a system deployment plan represents either an adaptation trigger
or a configuration (state) [
          <xref ref-type="bibr" rid="ref26">26</xref>
          ].
        </p>
        <p>
          In order to model the adaptive behavior of an IoT system, we
adopted the state machine approach [
          <xref ref-type="bibr" rid="ref27">27</xref>
          ]. This technique makes
adaptation policies easy to specify/understand, and it is useful
for validation and verification purposes. In this machine, states
are corresponding to the system configurations, while transitions
represent adaptations between the configurations. Each
transition is guarded and triggered through an adaptation event.
For example, to cope with a sensor failure during a specific state,
the system switches from its current state to a configuration that
recovers from this failure.
        </p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>B. Code Generation</title>
      <p>The code generation is performed in two steps, where the
high level model of the system is transformed to an IoT specific
model which is later on transformed to a code.</p>
      <p>
        Generate IoT Specific Model. Code generation is usually
tied to the environment (platform) in which the system is going
to execute. The IoT platforms are very large, and then it is very
difficult for any approach to consider all of them. Thus, in our
work, as a proof of concept, we generate an IoT system that can
execute on a specific Java implementation of the
publishsubscribe paradigm, which called data distribution service
(DDS) [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. The idea behind choosing such a platform is that the
generated Java code can run on a very large number of devices,
implying that our approach can have a wide applicability.
      </p>
      <p>
        To generate code for a system modelled using SysML4IoT
and publish/subscribe paradigm concepts, we automatically
transform the system model to a model that is compatible with
the target DDS platform [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ]. In this transformation, a functional
service (or an actuator) is transformed to a micro-service
concept. This service includes initiate, start, and stop methods.
The initiate method is responsible for initializing the functional
service subscriptions to specific DDS topics. The start method
prepares the topics data readers, while the stop method closes
the opened data readers. In the same manner, the sensors are
transformed to periodic-services that have initiate, start, and stop
methods similar to the micro-services. These services also
include “schedule” and “get duration” methods. The “get
duration” method is used to determine how frequent the
environment information are sensed, while the “schedule”
method includes the specific strategy to get such information.
      </p>
      <p>Generate Java Code. Based on an IoT model (generated as
described above), the Java code is generated. In this process,
first, for each functional service, a Java project is generated
which includes a code corresponding to the functionality and the
service connections with the sensors and actuators. This project
is later compiled to a JAR file that can be deployed to the DDS
Java implementation. In the same manner, Java projects for the
sensors and actuators are generated.</p>
      <p>
        Second, to generate the code corresponding to a DDS topic,
an Interface Definition Language (IDL) file is generated which
is then used by the idlj tool to generate Java code [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ]. Third, to
adapt the IoT software system at runtime, a system management
service based on the adaptation state machine is created, which
has the ability to identify the adaptation triggers and actions. It
also contains code that is able to change the system
configuration by starting and stopping the functional services at
runtime.
      </p>
      <sec id="sec-5-1">
        <title>IV. IMPLEMENTATION</title>
        <p>
          In this Section, we use the concepts previously explained in
Section III to model an adaptive lighting system, and generate
its implementation. This case study has been conducted in the
context of the S3P project, [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. We also describe tools that
support our approach.
        </p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>A. Modelling an Adaptive Lighting System</title>
      <p>As discussed previously, a model of an adaptive system
should specify its functionality and adaptive behavior. Below,
we discuss the model of the adaptive lighting system.</p>
      <p>
        Modelling System Functionality. To create a design model
of the adaptive lighting system following our approach, we use
the Papyrus UML modeler [
        <xref ref-type="bibr" rid="ref30">30</xref>
        ]. The architecture model of the
system functionality is shown in Figure 3. The model consists of
a number of functions that are linked to each other through
functional ports. In Figure 3, there are a number of functional
services to control lights based on the environment information
availability (e.g. luminosity and temperature controller). It also
includes two sensors for monitoring the temperature and the
luminosity level (i.e. temperature and luminosity sensors).
Furthermore, there is a service to control the lights manually
using a user interface.
Modelling the System Adaptive Behavior. To model the
adaptive behavior of the system, both the adaptation triggers and
the system states need to be specified. An example of an
adaptation trigger modeled as an instance specification is shown
in Figure 4 (see the top part). For each component, a runtime
system state is defined {e.g. Active or Inactive}. In the example,
temperature controller, and temperature and luminosity sensors
are in active state, while temperature and luminosity controller,
and luminosity controller are inactive. A configuration to cope
with the availability of the luminosity sensor is shown in
Figure 4 (see the bottom part). The instance specification for
each component is defined as &lt;Component Name, and State&gt;.
Therefore, this configuration is defined as follows:
      </p>
      <p>{&lt; temperature controller, Inactive &gt;, &lt; temperature sensor,
Active&gt;, &lt; luminosity sensor, Active&gt;, &lt; luminosity controller,
Inactive&gt;, &lt; temperature and luminosity controller, Active&gt;}
To model the switching between the system configurations
in response to the adaptation triggers, a state machine is created
as shown in Figure 5. For example, in response to the availability
of the luminosity sensor (the adaptation trigger specified on top
part of Figure 4), the system adapts from its current
configuration to another that takes the luminosity level into
account (i.e. the system configuration shown at the bottom of
Figure 4). This switching is specified by a transition (i.e. light
sensor available) shown in Figure 5. In this transition, the state
of the temperature controller is changed from “Active” to
“Inactive”, while the state of the temperature and luminosity
controller is changed from “Inactive” to “Active”.</p>
      <p>
        Papyrus software designer [
        <xref ref-type="bibr" rid="ref31">31</xref>
        ] is an extension of Papyrus
[
        <xref ref-type="bibr" rid="ref30">30</xref>
        ]. It provides code generation from UML models for a
number of programming languages such C, C++, and Java, and
supports the integration of new code generators. We have added
support for the generation of adaptive IoT software systems to
this tool. This enhancement is based on extensibility mechanism
in the tool, notably the use of an extensible model-2-model
transformation chain. The resulting tool enables the generation
of an IoT specific model from the system’s high level model.
      </p>
      <p>
        Using this extension, first, code corresponding to a
functional service such as luminosity controller is generated in
two steps (see Figure 6). The top part of the Figure shows the
service design model, while the bottom part shows its extended
platform specific model (on the left), and the generated Java
project (on the right). The generated Maven project can then be
complied to create a JAR file (i.e. lux2hue.jar), which is later on
deployed to a running instance of the DDS implementation [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ].
Therefore, users and other services can interact with this service.
Similar to generating the code for the functional services, code
corresponding to system sensors and actuators is generated.
      </p>
      <p>High Level Model</p>
      <p>IoT Specific Model Maven Project</p>
      <p>2- Model-to-Code
Second, as discussed above, the information required by the
functional services is modelled as a set of topics. Thus, for a
functional service to use these topics, Java code corresponding
to these topics needs to be generated. The topic data structure is
modelled by the TopicStruct concept that includes a number of
data items. For example, a temperature topic has id, value, and
raw value (rvalue) as data items (see the top part of Figure 7).
To generate the Java code corresponding to this topic, an IDL
file representing this data structure is generated, which is then
used by the idlj tool to generate the Java code as shown in the
bottom part of Figure 7.
2- IDL-to-Code</p>
      <p>Maven Project
//
------I-D---L----f--i-l-e----------------------// Code generated by Papyrus IDL
//
----------------------------------------module com {
module prismtech {
module edison {
module sensor {
module types {
struct AnalogSensor{
short id;
float value;
float rvalue;
};
}; //end of module types
}; //end of module sensor
}; //end of module edison
}; //end of module prismtech
}; //end of module com</p>
    </sec>
    <sec id="sec-7">
      <title>C. System Deployment and Runtime Monitoring</title>
      <p>
        The hardware platform that we have used to deploy our IoT
system generated above includes a light strip, temperature and
luminosity sensors, an Edison board (a computer-on-module
provided by Intel as a development system for IoT devices [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ])
that has Java implementation of the data distribution service
middleware running on it, and a board with the MicroEJ
operating system [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] that is optimized for the IoT architectures
(see Figure 8).
      </p>
      <p>
        To have a fully functioning IoT system, the generated code
is compiled and deployed to the Edison board. In addition, an
application is developed for the MicroEJ board that enables the
manual control of the light strip. Furthermore, to enable runtime
monitoring of the system, we used a model animation
framework developed in the context of the Papyrus Moka [
        <xref ref-type="bibr" rid="ref32">32</xref>
        ].
Using Moka, the runtime state of the deployed system is
reflected to its design model by instrumenting the generated
code with monitors. We also support the control of the running
system via the model: functional services can be started and
stopped from the design model.
      </p>
      <p>In Figure 8, we show a snapshot of the case study during its
operation. In this snapshot, the light controller, the luminosity
sensor, and the luminosity controller are active. Therefore, in
response to changes in luminosity level, the light strip is turned
on or off. In Figure 8, the active components are also indicated
by model elements that have the green colour (changed using the
Moka animation framework).</p>
      <p>In recent years, a growing number of objects have been
connected to the internet to realize the idea of Internet of Things
(IoT). A challenge is how to develop adaptive systems that can
benefit from the IoT. In this paper, we have proposed a
modeldriven approach to develop such IoT systems. First, based on
system requirements, a design model is created that captures the
system functionality and its adaptation. The functionality is
modelled by the SysML4IoT profile, while data needed by the
system functionity is modelled following the publish/subscribe
paradigm. To model the runtime adaptation, the state machine
approach is adopted. Second, the model is used to generate
system implementations. To do so, the high level design model
is transformed to an IoT platform specific model, which is then
used to generate the Java code. Finally, the generated code is
deployed to the hardware platform of the system to make it fully
functioning.</p>
      <p>As a future work, firstly, we plan to extend our approach to
enable the deployment of IoT systems to other IoT platforms,
and to enable automatic system deployment to such platforms.
Secondly, further evaluations will also be carried out to assess
the approach robustness by applying it to a set of case studies.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>P.</given-names>
            <surname>Patel</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Cassou</surname>
          </string-name>
          ,
          <article-title>"Enabling High-level Application Development for the Internet of Things,"</article-title>
          <source>Journal of Systems and Software</source>
          , vol.
          <volume>103</volume>
          , pp.
          <fpage>62</fpage>
          -
          <lpage>84</lpage>
          ,
          <year>Januray 2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A. P.</given-names>
            <surname>Athreya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. DeBruhl and P.</given-names>
            <surname>Tague</surname>
          </string-name>
          ,
          <article-title>"Designing for selfconfiguration and self-adaptation in the Internet of Things,"</article-title>
          <source>in 9th IEEE International Conference on Collaborative Computing: Networking</source>
          , Applications and Worksharing, Austin, TX,
          <year>2013</year>
          , pp.
          <fpage>585</fpage>
          -
          <lpage>592</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Al-Fuqaha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Guizani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mohammadi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Aledhari</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Ayyash</surname>
          </string-name>
          ,
          <article-title>"Internet of Things: A Survey on Enabling Technologies, Protocols and Applications,"</article-title>
          <source>IEEE Communications Surveys &amp; Tutorials</source>
          , vol.
          <volume>17</volume>
          , no.
          <issue>4</issue>
          , pp.
          <fpage>2347</fpage>
          -
          <lpage>2376</lpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>B.</given-names>
            <surname>Costa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. F.</given-names>
            <surname>Pires</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. C.</given-names>
            <surname>Delicato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Li</surname>
          </string-name>
          and
          <string-name>
            <given-names>A. Y.</given-names>
            <surname>Zomaya</surname>
          </string-name>
          ,
          <article-title>"Design and Analysis of IoT Applications: A Model-Driven Approach,"</article-title>
          <source>in IEEE 14th Intl Conf on Dependable, Autonomic and Secure Computing, Auckland</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>392</fpage>
          -
          <lpage>399</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>X. T.</given-names>
            <surname>Nguyen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. T.</given-names>
            <surname>Tran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Baraki</surname>
          </string-name>
          and
          <string-name>
            <given-names>K.</given-names>
            <surname>Geihs</surname>
          </string-name>
          ,
          <article-title>"FRASAD: A framework for model-driven IoT Application Development,"</article-title>
          <source>in IEEE 2nd World Forum on Internet of Things , Milan</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>387</fpage>
          -
          <lpage>392</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Franco da Silva</surname>
          </string-name>
          , U. Breitenbücher,
          <string-name>
            <given-names>K.</given-names>
            <surname>Képes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Kopp</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Leymann</surname>
          </string-name>
          ,
          <article-title>"OpenTOSCA for IoT: Automating the Deployment of IoT Applications based on the Mosquitto Message Broker,"</article-title>
          <source>in Proceedings of the 6th International Conference on the Internet of Things (IoT'16)</source>
          , New York, NY, USA,
          <year>2016</year>
          , pp.
          <fpage>181</fpage>
          -
          <lpage>182</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7] (
          <year>2017</year>
          , June) SysML. [Online]. http://www.omgsysml.org/
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>W.</given-names>
            <surname>Kang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Kapitanova</surname>
          </string-name>
          and
          <string-name>
            <given-names>S. H.</given-names>
            <surname>Son</surname>
          </string-name>
          ,
          <article-title>"RDDS: A Real-Time Data Distribution Service for Cyber-Physical Systems,"</article-title>
          <source>IEEE Transactions on Industrial Informatics</source>
          , vol.
          <volume>8</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>393</fpage>
          -
          <lpage>405</lpage>
          , May
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Hussein</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Nouacer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Radermacher</surname>
          </string-name>
          ,
          <article-title>"A Model-driven Approach for Validating Safe Adaptive Behaviors,"</article-title>
          <source>in 19th Euromicro Conference on Digital Systems Design (DSD</source>
          <year>2016</year>
          ), Limassol, Cyprus,
          <source>August 31 - September 2</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10] (
          <year>2017</year>
          , June) Smart, Safe and Secure
          <string-name>
            <surname>Platform</surname>
          </string-name>
          (
          <year>S3P</year>
          ). [Online]. http://www.esterel
          <article-title>-technologies.com/S3P-en</article-title>
          .html
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11] (
          <year>2017</year>
          , June) Intel Edison Board. [Online]. https://software.intel.com/enus/iot/hardware/edison
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <article-title>(2017, June) Open Source Data Distribution Service (DDS)</article-title>
          . [Online]. http://www.prismtech.com/dds-community
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13] (
          <year>2017</year>
          , June) MicroEJ Platforms. http://developer.microej.com/index.php?resource=JPF [Online].
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>A.</given-names>
            <surname>Bassi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Bauer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Fiedler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Kramp</surname>
          </string-name>
          , R. van Kranenburg, and
          <string-name>
            <given-names>S. Langeand S.</given-names>
            <surname>Meissner</surname>
          </string-name>
          , Enabling things to Talk. Berlin, Heidelberg: Springer,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>A.</given-names>
            <surname>Cimatti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E. M.</given-names>
            <surname>Clarke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Giunchiglia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Giunchiglia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Pistore</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Roveri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Sebastiani</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Tacchella</surname>
          </string-name>
          ,
          <article-title>"NuSMV 2: An OpenSource Tool for Symbolic Model Checking,"</article-title>
          <source>in Proceedings of the 14th International Conference on Computer Aided Verification (CAV '02)</source>
          ,
          <year>2002</year>
          , pp.
          <fpage>359</fpage>
          -
          <lpage>364</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>A.</given-names>
            <surname>Gyrard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. K.</given-names>
            <surname>Datta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Bonnet</surname>
          </string-name>
          and
          <string-name>
            <given-names>K.</given-names>
            <surname>Boudaoud</surname>
          </string-name>
          ,
          <article-title>"Cross-Domain Internet of Things Application Development: M3 Framework and Evaluation,"</article-title>
          <source>in 3rd International Conference on Future Internet of Things and Cloud</source>
          , Rome,
          <year>2015</year>
          , pp.
          <fpage>9</fpage>
          -
          <lpage>16</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>D.</given-names>
            <surname>Garlan</surname>
          </string-name>
          , S. Cheng, A.
          <string-name>
            <surname>Huang</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Schmerl</surname>
            , and
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Steenkiste</surname>
          </string-name>
          ,
          <article-title>"Rainbow: Architecture-Based Self-Adaptation with Reusable Infrastructure,"</article-title>
          <source>Computer</source>
          , vol.
          <volume>37</volume>
          , no.
          <issue>10</issue>
          ,
          <year>October 2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>Q. Z.</given-names>
            <surname>Sheng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Segev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Liao</surname>
          </string-name>
          ,
          <article-title>"Techniques on developing context-aware web services," Int</article-title>
          .
          <source>Journal of Web Information Systems</source>
          , vol.
          <volume>6</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>185</fpage>
          -
          <lpage>202</lpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>J.</given-names>
            <surname>Zhang</surname>
          </string-name>
          and
          <string-name>
            <given-names>B. H. C.</given-names>
            <surname>Cheng</surname>
          </string-name>
          ,
          <article-title>"Model-based development of dynamically adaptive software," in the 28th international conference on Software engineering</article-title>
          , Shanghai, China,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>T.</given-names>
            <surname>Gu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. K.</given-names>
            <surname>Pung</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D. Q.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <article-title>"A service-oriented middleware for building context-aware services,"</article-title>
          <source>J. Netw. Comput. Appl.</source>
          , vol.
          <volume>28</volume>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>18</lpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>R.</given-names>
            <surname>Rouvoy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Barone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Ding</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Eliassen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Hallsteinsen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lorenzo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Mamelli</surname>
          </string-name>
          , and
          <string-name>
            <given-names>U.</given-names>
            <surname>Scholz</surname>
          </string-name>
          ,
          <article-title>"MUSIC: Middleware Support for SelfAdaptation in Ubiquitous and Service-Oriented Environments," Software Engineering for Self-Adaptive Systems</article-title>
          , vol.
          <source>LNCS 5525</source>
          , pp.
          <fpage>164</fpage>
          -
          <lpage>182</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>W.</given-names>
            <surname>Heaven</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Sykes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Magee</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Kramer</surname>
          </string-name>
          ,
          <article-title>"A Case Study in GoalDriven Architectural Adaptation," Software Engineering for SelfAdaptive Systems</article-title>
          , vol.
          <source>LNCS 5525</source>
          , pp.
          <fpage>109</fpage>
          -
          <lpage>127</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>S. S.</given-names>
            <surname>Andrade and R. J. de Araujo Macedo</surname>
          </string-name>
          ,
          <article-title>"A non-intrusive componentbased approach for deploying unanticipated self-management behaviour," in Software Engineering for Adaptive and Self-Managing Systems (</article-title>
          <source>SEAMS '09)</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>B.</given-names>
            <surname>Morin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Barais</surname>
          </string-name>
          , G. Nain, and
          <string-name>
            <given-names>J.</given-names>
            <surname>Jezequel</surname>
          </string-name>
          ,
          <article-title>"Taming Dynamically Adaptive Systems using models and aspects,"</article-title>
          <source>in the 31st International Conference on Software Engineering</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>M.</given-names>
            <surname>Salehie</surname>
          </string-name>
          , and
          <string-name>
            <given-names>L.</given-names>
            <surname>Tahvildari</surname>
          </string-name>
          ,
          <article-title>"Self-adaptive software: Landscape and research challenges,"</article-title>
          <source>ACM Trans. Auton. Adapt. Syst</source>
          , vol.
          <volume>4</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>42</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>M.</given-names>
            <surname>Fowler</surname>
          </string-name>
          ,
          <article-title>"UML Distilled: A Brief Guide to the Standard Object Modeling Language (3 ed</article-title>
          .).
          <source>,"</source>
          , Boston, MA, USA,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          [27]
          <string-name>
            <given-names>B.</given-names>
            <surname>Morin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Barais</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.M.</given-names>
            <surname>Jezequel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Fleurey</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Solberg</surname>
          </string-name>
          ,
          <article-title>"Models@ Run.time to Support Dynamic Adaptation,"</article-title>
          <source>Computer</source>
          , vol.
          <volume>42</volume>
          , pp.
          <fpage>44</fpage>
          -
          <lpage>51</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          [28] (
          <year>2017</year>
          , June) AgentV. [Online]. https://github.com/PrismTech/agentv
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          [29] (
          <year>2017</year>
          , June) idlj. [Online]. http://docs.oracle.com/javase/7/docs/technotes/tools/share/idlj.html
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          [30]
          <string-name>
            <given-names>S.</given-names>
            <surname>Gérard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Dumoulin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Tessier</surname>
          </string-name>
          , and
          <string-name>
            <given-names>B.</given-names>
            <surname>Selic</surname>
          </string-name>
          ,
          <article-title>"Papyrus: a UML2 tool for domain-specific language modeling," in International Dagstuhl conference on Model-based engineering of embedded real-time systems (</article-title>
          <source>MBEERTS'07)</source>
          , Berlin, Heidelberg,
          <year>2007</year>
          , pp.
          <fpage>361</fpage>
          -
          <lpage>368</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          [31]
          <string-name>
            <given-names>W.</given-names>
            <surname>Chehade</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Radermacher</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Terrier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Selic</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Gerard</surname>
          </string-name>
          ,
          <article-title>"A model-driven framework for the development of portable real-time embedded systems</article-title>
          .
          <source>," in International Conference on Engineering of Complex Computer Systems</source>
          ,
          <year>2011</year>
          , pp.
          <fpage>45</fpage>
          -
          <lpage>54</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref32">
        <mixed-citation>
          [32]
          <string-name>
            <given-names>J.</given-names>
            <surname>Tatibouet</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Cuccuru</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Gérard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Terrier</surname>
          </string-name>
          ,
          <article-title>"Towards a Systematic, Tool-Independent Methodology for Defining the Execution Semantics of UML Profiles with fUML ,"</article-title>
          <source>in MODELSWARD</source>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>