<!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>Modeling the monitoring and adaptation of context- sensitive systems</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jéssyka Vilela</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jaelson Castro</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Centro de Informática Universidade Federal de Pernambuco Recife</institution>
          ,
          <country country="BR">Brazil</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2015</year>
      </pub-date>
      <volume>978</volume>
      <fpage>55</fpage>
      <lpage>60</lpage>
      <abstract>
        <p>[Context] Context-sensitive systems (CSS) must detect variations in their operating context and adapt their behavior in response to such variations. Hence, their development requires the support of appropriate methods of software engineering. [Objective] This paper describes the activities of the GO2S systematic process to specify the adaptation and monitoring as well as the flow expressions of CSS. [Results] This process guides the software engineer to model the adaptive behavior through contextual design goal models and contextual refinements. [Conclusion] These models explicitly capture what changes in the environment and in the system to be monitored, what to adapt, when to adapt and how to adapt. We illustrate our proposal by applying it to the smart home exemplar.</p>
      </abstract>
      <kwd-group>
        <kwd>Adaptation</kwd>
        <kwd>Context</kwd>
        <kwd>Design Goal Model</kwd>
        <kwd>Monitoring</kwd>
        <kwd>Behavior</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Context-Sensitive Systems use context to provide services and relevant information to
their users. They are flexible, able to act autonomously on behalf of users and
dynamically adapt their behavior. Hence, these systems must have the following
characteristics: monitoring, awareness and adaptability [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Considering the inherent complexity
and variability of context-sensitive applications, their development requires the
support of appropriate methods of software engineering.
      </p>
      <p>
        The specification of adaptive behavior is an issue addressed with different
perspectives. The contexts are used to represent and analyze the variations in i* models
resulting from the domain variability in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. The work of [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] supports the design and
runtime execution of adaptive software systems both at a requirements and
architectural level. Another work [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] describes a systematic methodology to design adaptive
software systems. Finally, a method to derive the adaptive behavior of Dynamically
Adaptive Systems (DAS) from a set of i*models is presented in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>
        In previous works [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ][
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], we proposed the GO2S (GOals to Statecharts) process, a
systematic approach for deriving the behavior (expressed in statecharts) of
contextsensitive systems, from requirements models (described as goal models).
In this paper, we detail two critical sub-process of the GO2S process: the modeling
of the monitoring and adaptation as well as the specification of the flow expressions.
These sub-process define systematic methods to model the system’s adaptation and
monitoring through the elements of an extended (contextual) design goal model
(DGM) and flow expressions [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. We illustrate our proposal by applying it to the
smart home exemplar.
      </p>
      <p>The remainder of this paper is organized as follows. In Section 2, we present our
approach to perform the specification of the adaptation and monitoring as well as the
behavior of CSS following the GO2S process. Section 3 discusses the contributions of
this work and present the venues for future works.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Our proposal</title>
      <p>The GO2S is an iterative process centered on the incremental refinement of a goal
model, obtaining different views of the system (design, contextual, behavioral). The
GO2S process consists of six sub-processes: 1) Construction of design goal model; 2)
Specification of contextual variation points; 3) Specification of monitoring and
adaptation; 4) Specification of flow expressions, 5) Statechart derivation and refinement
and 6) Prioritization of variants. In the next subsections, we detail how to specify the
adaptation and monitoring (sub-process 3) as well as the flow expressions
(subprocess 4) of CSS. The GO2S process assumes that the requirements elicitation and
analysis activities were previously performed and a goal model was generated. It is
out of scope of this paper to present and discuss all activities of the GO2S process.
2.1</p>
      <p>
        Modeling the adaptation and monitoring of context-sensitive systems
We propose that the specification of the adaptation and monitoring of
contextsensitive systems (sub-process 3 of the GO2S process) is performed through
refinements in the design goal model [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] extended with contextual annotations [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] which we
call contextual design goal model.
      </p>
      <p>Accordingly, in this sub-process we add adaptation design tasks in the contextual
DGM. These tasks are required for the adaptation of each requirement that needed to
be monitored. Then, they are refined through tasks in AND/OR decompositions that
represent the adaptation strategies. The activities required for the modeling the
adaptation and monitoring are presented in Fig. 1.</p>
      <p>The input of this sub-process is the contextual design goal model that is used by the
software engineer to define the critical requirements that requires adaptation. The next
activity is the representation of the adaptation management, which we propose to
perform through the following activities:
1. Add a new design task in the root node for adaptation management (This
activity is necessary when the system requires more than one adaptation).
2. Add design tasks in the parent node previously created for the management of
each requirement that must be monitored and adapted (ex: Manage gas leak
(t3) in Fig. 2).</p>
      <sec id="sec-2-1">
        <title>Contexts Refinements</title>
      </sec>
      <sec id="sec-2-2">
        <title>Define the requirements</title>
      </sec>
      <sec id="sec-2-3">
        <title>Adaptation</title>
        <p>needed?
yes</p>
      </sec>
      <sec id="sec-2-4">
        <title>Identify the equipment/ technology needed</title>
      </sec>
      <sec id="sec-2-5">
        <title>Represent the</title>
        <p>adaptation
management
no</p>
      </sec>
      <sec id="sec-2-6">
        <title>Represent the context monitoring</title>
      </sec>
      <sec id="sec-2-7">
        <title>Associate each design task with a context label</title>
      </sec>
      <sec id="sec-2-8">
        <title>Identify the dynamic contextual elements</title>
      </sec>
      <sec id="sec-2-9">
        <title>Contextual Design</title>
      </sec>
      <sec id="sec-2-10">
        <title>Goal Model with monitoring points</title>
      </sec>
      <sec id="sec-2-11">
        <title>Contextual Elements</title>
        <p>3. Add design tasks to represent the adaptation strategies for each monitored
requirement (ex: Turn off the oven (t1) and Call fire department (t2) for the task
Manage gas leak (t3) in Fig. 2).
the cornerstone for adaptability, a system with only one variant cannot be adaptable.
t16 – t17 – t18 – 19 – t20 – t21</p>
        <sec id="sec-2-11-1">
          <title>Monitor t15</title>
          <p>Context
(t9 | t10 | g6)*</p>
          <p>Patient is
entertained</p>
          <p>g4
g1
(g2 – t8)*
Home is
protected
against theft</p>
          <p>g3</p>
          <p>Monitor
visits t21
Monitor use
of stove
t20</p>
          <p>t16
Monitor time</p>
          <p>Monitor
rooms</p>
          <p>t17</p>
          <p>Monitor t18
temperature
Monitor gas
leak
t19
After the identification of the tasks necessary for the system adaptation, the next
activity is to associate each adaptation design task with a context label since these tasks
will executed only in certain contexts. In the smart home example, the Turn off the
oven (t1) design task will be executed when the context C1 holds (the patient finished
using the oven) and the Call fire department (t2) design task will be executed when
the context C2 holds (a gas leak is detected).</p>
          <p>The next step is the identification of the dynamic contextual elements. The
dynamic contextual elements are the properties of real-world presented in the facts of
context refinements that change their values dynamically. Therefore, the changes in the
contextual elements imply in changes in the system context. In our running example,
the dynamic contextual elements are the time, rooms, temperature, gas leak, use of the
stove, and visits for the patient.</p>
          <p>The next activity corresponds to the representation of the context monitoring.
Accordingly, we propose the following activities in order to achieve this:
1.
2.</p>
          <p>Add a new design task in the root node (ex: Monitor Context (t15) in Fig.
2).</p>
          <p>Add design tasks to monitor each dynamic contextual element (ex:
Monitor time (t16), Monitor rooms (t17), Monitor temperature (t18), Monitor gas
leak (t19), Monitor use of the stove (t20) and Monitor visits (t21) in Fig. 2).</p>
          <p>We propose to add the adaptation and monitoring activities in the root node since
we want to improve the system’s modularity and separation of concerns. Accordingly,
the related design tasks will be executed concurrently with the system’s requirements.</p>
          <p>The last activity of this sub-process is the specification of the
equipments/technology necessary for monitoring the contexts. In the smart home, the
technologies needed are some mechanism to information storage and different types of
sensors (presence, temperature, gas leak, stove and luminosity sensors). The outputs
of the sub-process 3 of GO2S are the contextual design goal model refined and the
contexts refinements.</p>
          <p>Having defined the adaptation strategies and the contextual elements that need to
be monitored, we can now move on to specify the order of execution of tasks and
goals. For this, we rely on flow expressions. This sub-process is described in the next
section.
2.2</p>
          <p>Modeling the behavior of context-sensitive systems</p>
          <p>
            The goal of the sub-process 4 (Specification of flow expressions) of the GO2S
process is to refine the contextual DGM with flow expressions. Flow expressions are a
set of enrichments to a goal model that allow specification of the runtime behavior
through the execution order of its elements [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ]. These expressions are used in the
GO2S process as an intermediary model in order to derive the statechart [
            <xref ref-type="bibr" rid="ref4 ref5">4-5</xref>
            ].
          </p>
          <p>The input of this sub-process is the contextual DGM previously obtained. The first
activity is to assign an identification (ID) to each goal and task in the model. Their
identification is necessary for reference in the flow expression later. Gi was used as
ID for goals and Ti for tasks and design tasks where i is the number of the task.
n
o
it
iac sn
if
:ecs4pS irsseexpo
s w
rceop lffoo Contextual Design Goal Model
bu with monitoring points
S</p>
          <p>Assign an
identification</p>
          <p>Determine
the flow
expressions</p>
          <p>Specify
idle states
Behavioral Contextual</p>
          <p>Design Goal Model</p>
          <p>
            After the IDs assignment, the next activity is to define the flow expression for each
parent node which describes the behavior of its children elements using the symbols
proposed by [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ]. The strategy of specifying the children behavior of a parent node can
be bottom-up or top-down, the result will be the same. Thereafter, when we reach the
root goal, we have the flow expression from the entire system. The resulting flow
expressions should be annotated in the contextual DGM as demonstrated in Fig. 2.
          </p>
          <p>A common practice when creating statecharts is to use intermediate states as a
point where the system is idle, waiting for some input, such as input selection by the
user or for a context to hold. Considering how frequently these states appear, and
aiming to reduce visual pollution in the behavioral contextual DGM, such states must
be inserted directly in the flow expressions identified as iX, where X is an integer.</p>
          <p>The output of this activity is the behavioral contextual DGM. It is the contextual
design goal model annotated with flow expressions. This model can represent in
unified way all the views developed in the GO2S (contextual, design and behavioral).
3</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Ongoing and Future Work</title>
      <p>We conducted a controlled experiment in order to evaluate our process. This study
was performed using 18 undergraduate and graduate students enrolled in a
requirements engineering course divided into two groups with nine subjects each. Each
subject of the first group constructed a statechart of the smart home system following
the GO2S process (the GO2S group) and each subject of the second group
built/developed a statechart without guidance (the control group).</p>
      <p>
        The experiment results are encouraging since the structural complexity of the
experimental group was lower and the mean of behavioral similarity was higher than
control group. Besides, the subjects agreed that the GO2S process is easy to use
indicating that it is understandable. The results of this experiment can be found at [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>
        While statecharts are the industry standard and provide an intuitive representation
of behavior models, formal analysis is limited and difficult. Hence, we are currently
working on an approach to analyze properties of the statecharts generated with the
GO2S process. Moreover, we are also investigating the contributions of using
ontologies to the verification of statecharts considering their empirical benefits for
requirements engineering identified in a previous systematic literature review [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>
        We also expect to develop a case tool to support the process. It should be used to
generate the different views (design, contextual and behavioral) of our process.
Besides, it is important to derive systematically the other architectural views of CSS.
The structural view of context-sensitive systems was already addressed in the work of
[
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] and the GO2S process addressed the behavioral view. The other views can be
incorporated in our process in order to obtain a complete architecture specification.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Klein</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          et al.
          <article-title>A Survey of Context Adaptation in Autonomic Computing</article-title>
          .
          <source>In: 4th International Conference on Autonomic and autonomous Systems (ICAS)</source>
          ,
          <year>2008</year>
          . pp.
          <fpage>106</fpage>
          -
          <lpage>111</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Pimentel</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          et al.
          <article-title>From requirements to statecharts via design refinement</article-title>
          .
          <source>In: proceedings of the 29th SAC</source>
          ,
          <year>2014</year>
          , pp.
          <fpage>995</fpage>
          -
          <lpage>1000</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Ali</surname>
          </string-name>
          , R.;
          <string-name>
            <surname>Dalpiaz</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Giorgini</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <article-title>A goal-based framework for contextual requirements modeling and analysis</article-title>
          .
          <source>Requirements Engineering</source>
          , v.
          <volume>15</volume>
          , n. 4,
          <issue>2010</issue>
          , pp.
          <fpage>439</fpage>
          -
          <lpage>458</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Vilela</surname>
          </string-name>
          , J.;
          <string-name>
            <surname>Castro</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ; Pimentel; J.; Soares,
          <string-name>
            <given-names>M.</given-names>
            ;
            <surname>Lima</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            ;
            <surname>Lucena</surname>
          </string-name>
          ,
          <string-name>
            <surname>M. Deriving</surname>
          </string-name>
          <article-title>the behavior of context-sensitive systems from contextual goal models</article-title>
          .
          <source>In: Proceedings of the 30th SAC</source>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Vilela</surname>
          </string-name>
          , J.;
          <string-name>
            <surname>Castro</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ; Pimentel; J.; Lima.
          <article-title>On the behavior of context-sensitive systems</article-title>
          .
          <source>In proceeding of 18th Workshop on Requirements Engineering (WER)</source>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Boudaa</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Hammoudi</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ; Chikh,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>A. ODM-based modeling for user-centered contextaware mobile applications</article-title>
          .
          <source>IN: 3rd International Conference on Information Technology and e-Services (ICITeS)</source>
          ,
          <year>2013</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>7</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Welsh</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Sawyer</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <article-title>Deriving Adaptive Behaviour from i* models</article-title>
          .
          <source>In: proceedings of the 4th International i* Workshop</source>
          (istar
          <year>2010</year>
          ). pp.
          <fpage>98</fpage>
          -
          <lpage>102</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Pimentel</surname>
          </string-name>
          , J.;
          <string-name>
            <surname>Angelopoulos</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Souza</surname>
            ,
            <given-names>V. E. S.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Mylopoulos</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Castro J. From</surname>
          </string-name>
          <article-title>Requirements to Architectures for Better Adaptive Software Systems</article-title>
          .
          <source>In: proceedings of the 6th International i* Workshop</source>
          (iStar
          <year>2013</year>
          ). pp.
          <fpage>91</fpage>
          -
          <lpage>96</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Dermeval</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Vilela</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ; Bittencourt, Ig.;
          <string-name>
            <surname>Castro</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Isotani</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ; Brito,
          <string-name>
            <given-names>P.</given-names>
            ;
            <surname>Silva</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          <article-title>Applications of ontologies in requirements engineering: a systematic review of the literature</article-title>
          .
          <source>Requirements Engineering</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>33</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Lapouchnian</surname>
            <given-names>A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Mylopoulos</surname>
          </string-name>
          , J. In
          <source>: proceedings of the 5th International i* Workshop</source>
          (iStar
          <year>2011</year>
          ). pp.
          <fpage>96</fpage>
          -
          <lpage>101</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Pimentel</surname>
          </string-name>
          . J. et al.
          <article-title>Deriving software architectural models from requirements models for adaptive systems: the stream-a approach</article-title>
          . Requirements Engineering, v.
          <volume>17</volume>
          , n.4,
          <issue>2012</issue>
          , pp.
          <fpage>259</fpage>
          -
          <lpage>281</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>J. F. F.</given-names>
            <surname>Vilela</surname>
          </string-name>
          .
          <article-title>A systematic process to derive the behavior of context-sensitive systems from requirements models</article-title>
          .
          <source>MSC Dissertation</source>
          , Universidade Federal de Pernambuco, Centro de Informática,
          <year>2015</year>
          . Available at: http://www.cin.ufpe.br/~ler/supplement/istar2015/.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>