<!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>A Uni¯ed Approach to Model Non-Functional Properties of Mobile Context-Aware Software ?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Luca Berardinelli</string-name>
          <email>luca.berardinelli@univaq.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vittorio Cortellessa</string-name>
          <email>vittorio.cortellessa@univaq.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Antinisca Di Marco</string-name>
          <email>antinisca.dimarco@univaq.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dipartimento di Informatica Universitaμ dell'Aquila Via Vetoio</institution>
          ,
          <addr-line>67010 Coppito (AQ)</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Modeling context-awareness is becoming a primary activity for software engineers that design applications for mobile devices. In fact, software applications running on such devices need to be aware of their context (that may rapidly change) to adapt their services and o®er the best quality (intended as a combination of non-functional properties) in any context. Thus the need of instruments to manage mobility, context-awareness and non-functional characteristics is critical to build software systems in ubiquitous and mobile domain. In this paper we introduce a framework to uniformly model di®erent types of mobility and context-awareness so that the modeling and analysis of non-functional properties of such systems can be supported in an integrated environment. To enable non-functional analysis, we devise the integration of non-functional parameters in the modeling framework. In particular, we present an UML implementation of our framework within the MagicDraw modeling environment, with the support of existing UML pro¯les for modeling context-awareness and non-functional properties. We ¯nally show an example of modeling and analysis of reliability in the eHealth domain.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>The evolution of portable devices and their increasing pervasiveness in everyday
life have motivated a growing interest for methodologies, techniques and tools
that allow to e®ectively develop and analyze software systems running on such
devices. The main characteristics of portable devices are mobility and limitation
of hardware resources. Both these aspects require speci¯c characteristics of the
deployed software systems that must be considered along the whole software
lifecycle, starting from the architecture design phase.</p>
      <p>
        Mobility can be either physical or logical. Physical mobility takes into account
the transfers of a portable device among a certain number of physical locations.
Logical mobility is achieved through online re-deployment actions on software
components [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ].
      </p>
      <p>The limitation of hardware resources has brought to develop speci¯c releases
of software products. The available amount of such resources can vary at runtime,
thus new approaches have been introduced to produce software able to adapt to
changes in the available resources (and in the execution environment).</p>
      <p>Mobility and limited resources obviously have a large impact on the quality of
software systems (intended as a combination of non-functional properties). Their
bad e®ects are today passively accepted as unavoidable fees to pay in the domain
of advanced portable systems. As opposite, if opportunely managed, they can
become powerful instruments in the hands of software developers to maintain
an acceptable level of user-perceived quality even in presence of changes and
degradations in the surrounding environment.</p>
      <p>Goal of this paper is to introduce an unifying framework to model mobility
and context-awareness aspects of software systems. The framework is aimed at
producing software models that embed, beside these two aspects, the parameters
needed to non-functional analysis. Beside the speci¯c characteristics of mobility
and context-awareness, in this framework the interdependencies between them
can be captured and the cross-e®ects can be considered. Thus certain types of
analysis, that were not feasible with speci¯c models, are enabled in our
framework 1.</p>
      <p>
        In Figure 1 we represent our idea of context, as the combination of attributes
that can come from di®erent domains. In particular, in this paper we focus on
physical and logical location-awareness and hardware platform awareness. Our
approach [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] does not limit the context de¯nition to these domains, as it is
extensible to any attribute or set of attributes that may contribute to the context
de¯nition. This modular approach allows also to provide restricted context
representations in all cases where only few context attributes are necessary (e.g.,
logical mobility is not allowed).
      </p>
      <p>
        Non-functional properties of mobile context-aware software systems
obviously also depend on the characteristics of software services provided in each
speci¯c context. Di®erent implementations of the same service may be available,
possibly exploiting code mobility paradigms [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], so they can be dynamically
1 Our approach has been conceived for multiple types of non-functional analysis [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ],
although in this paper (for sake of space) we only provide an example of reliability
analysis.
chosen in order to provide the service implementation that better ¯ts the
execution context 2. We name context-aware, adaptable applications the software
systems able to provide services in these settings.
      </p>
      <p>The paper is organized as follows: Section 2 brie°y describes the basic ideas
behind our framework, Section 3 presents the UML implementation of the
framework driven by an eHealth application example, in Section 4 we show how to
conduct a reliability analysis, Section 5 introduces the related work, and ¯nally
Section 6 concludes the paper.
2</p>
    </sec>
    <sec id="sec-2">
      <title>A Unifying Modeling Approach to the</title>
    </sec>
    <sec id="sec-3">
      <title>Context-Awareness</title>
      <p>In our approach, context-awareness is intended as the property of software to
manage knowledge related to the context, where the context is de¯ned here as
a combination of (physical and logical) location and hardware platform
characteristics.</p>
      <p>The framework proposes a uniform representation of the location and
hardware platform awareness (and the mechanisms that rule them), and allows to
(separately or jointly) manage these properties within the same framework.
Context-awareness of software systems is expressed through a set of attributes
associated to system elements such as software components and hardware
platform devices. The evolution of an attribute (or a set of attributes) is modeled by
a stochastic statechart whose states model the attribute "value" (e.g., the status
of a resource or the logical location for a component) whereas the transitions
model the events (such as location change or resource degradation) triggering the
attribute changes as well as the probability of the event occurrence. Of course,
changes in the context attributes may induce adaptation actions.</p>
      <p>On the basis of the modeling approach introduced above, physical location-,
logical location- and hardware platform-awareness must be properly combined
depending on the type of context-awareness suitable for the modeled application.
Each of them can be de¯ned in isolation or, through remote ¯ring, can a®ect the
other ones. Even for sake of reliability analysis, these facets can be considered
together or in isolation, depending on the facets of interest of the software system.
For example, one can investigate only the system reliability °uctuation due to
an extreme physical mobility of users without considering at all the state of
resources on portable devices.</p>
      <p>Therefore the three types of statecharts have to be lumped, when necessary
for analysis purposes, in one statechart that models the runtime evolution of
a mobile context-aware software system. Each state of such statechart (that
we call superstate) represents a possible context, and it is obtained from the
combination of three states, one for each statechart (i.e. physical mobility, logical
2 Note that our approach in its current version does not intend to address run-time
problems, but it is a support for developing and maintaining such software systems.
Runtime usage of this approach introduces additional issues (such as the complexity
of analysis models) that we devise as future work.
mobility, hardware platform evolution). Obviously not all the combinations are
allowed, for example a certain con¯guration of hardware devices cannot allow
a certain deployment of software components to devices. Therefore, in order to
build a consistent unique model, only superstates that are feasible combinations
of states have to be considered.</p>
      <p>Once this set of superstates has been de¯ned, a list of provided services
and their corresponding behaviors have to be associated to each state. In fact,
if multiple behaviors for some service are available, then the behavior to be
adopted must be speci¯ed in each superstate where the service can be provided.</p>
      <p>In Figure 2 the synthesis of states from the three statecharts into an unique
superstate is represented in an UML-like notation. A superstate represents the
context as partitioned in four sectors, one for each type of awareness plus (at
bottommost of ¯gure) the list of provided services and their behaviors chosen
for the speci¯c superstate. Awareness managers (represented as statecharts) are
introduced in each sector. Across physical and logical location awareness sectors
the Dynamic Deployment Diagram illustrated in Figure 4 is also sketched.</p>
      <p>
        Transitions have to be de¯ned in this unifying statechart. Being each
superstate obtained by lumping three states of their respective statecharts, the
transitions outgoing these latter states have to be opportunely combined (along
with their probabilities) to build up transitions outgoing the superstate. Note
that the problem of lumping di®erent statecharts is very similar to the problem
of combining stochastic behaviors of concurrent processes. The latter has been
faced with di®erent approaches, among which Stochastic Process Algebra seems
to be a promising notation to be applied to our case as well [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ].
      </p>
      <p>
        More details on the notation-independent framework can be found in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
    </sec>
    <sec id="sec-4">
      <title>UML-based modeling of a context-aware software application</title>
      <p>In this section we present the UML 2.0 implementation of our approach to the
modeling of non-functional properties of context-aware software.</p>
      <p>The UML modeling is organized in Service, Component and Deployment
Views, as shown in Figure 3.</p>
      <p>
        The Service View (SV) models the services provided by the software
system as perceived and used by external actors (Use Case Diagram, UCD) along
with their behavioral speci¯cations (Sequence Diagram, SD). A Physical
Mobility Manager is assigned to the nomadic users that exploit the system services
while moving with their mobile devices [
        <xref ref-type="bibr" rid="ref13 ref17">17, 13</xref>
        ].
      </p>
      <p>
        The Component View (CV) represents the software architecture
(Component Diagram, CD). It is integrated with mobility annotations that allow to
distinguish logically mobile from ¯xed software artifacts [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. A Logical Mobility
Manager [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] is associated to each component whose implementation is (even
partially) mobile.
      </p>
      <p>The Deployment View (DV) models: (i) the current/allowed allocation
of software artifacts on execution environments (e.g. handheld devices) that can
physically move across di®erent places (Dynamic Deployment Diagram, dynDD),
and (ii) several detailed hardware device speci¯cations (hwDD). A Hardware
Con¯guration Manager describes a resource whose state (e.g. its current amount)
may vary at runtime.</p>
      <p>&lt;&lt;GaAnalysisContext&gt;&gt;</p>
      <p>System</p>
      <p>ServiceView
PhysicalMobilityManager
SD
UCD</p>
      <p>ComponentView
LogicalMobilityManager
CD</p>
      <p>DeploymentView
HwConfigurationManager
DynamicDD
DeviceSpecs
&lt;&lt;apply&gt;&gt;</p>
      <p>&lt;&lt;profile&gt;&gt;
UML Profilie for
Mobile System
&lt;&lt;apply&gt;&gt;
&lt;&lt;apply&gt;&gt; ContextM&lt;&lt;oprdofeileli&gt;n&gt;gProfile
&lt;&lt;apply&gt;&gt;
&lt;&lt;import&gt;&gt;
&lt;&lt;profile&gt;&gt;
MARTE_Profile
&lt;&lt;import&gt;&gt;
&lt;&lt;import&gt;&gt;
&lt;&lt;profile&gt;&gt;</p>
      <p>DAM</p>
      <p>These views are illustrated in the following subsections through a set of UML
diagrams modeling a eHealth application 3.</p>
      <p>
        The diagrams are suitably annotated with additional information from
several pro¯les to enable model-based reliability analysis [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] of the speci¯ed system.
      </p>
      <p>
        The applied pro¯les are MARTE [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], that includes the Dependability Analysis
Model [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], and the UML Pro¯le for Mobile Systems [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. We have also devised
3 The complete UML model can be
http://www.di.univaq.it/cortelle/docs/eHealthSystemModel.rar.
downloaded
at
and applied a preliminary version of a Context Modeling pro¯le to support the
modeling of the manager statechart 4.
      </p>
      <p>&lt;&lt;CurrentDeployment&gt;&gt;
The reference example is a eHealth system that provides a service called
RequestPatientInfoPage: a doctor is able to retrieve mixed media information on
his/her patients, such as text with or without di®erent kind of images that
refer to their personal data, their medical histories and patient-related diseases
through his PDA (MobileElement )</p>
      <p>
        The RequestPatientInfoPages service is supposed to be the most frequently
invoked (basing on the user pro¯le). In our modeling approach, services are
provided by a component-based system whose architectural description is given
by a Component Diagram (CD). The CD identi¯es the software components,
their interconnections and the executable artifacts implementing them.
Moreover, it speci¯es which component is mobile and the component failure
probability needed for the analysis methodology [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] applied in Section 4.
      </p>
      <p>
        In Figure 4 the dynamic DD of the application is shown. It is inspired to the
diagram introduced in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], and it basically contains two types of information: (i)
the allocation of the software artifacts (SchedulableResources ) on the execution
4 Hereafter the typewritten words are model variables (following the MARTE [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]
recommendations), whereas the italicized ones are stereotypes of pro¯les.
environments (GaExecHost ) through deployment relationships
(CurrentDeployment, AllowedDeployment ) between the Software Artifacts and the Hosts levels,
and (ii) the positioning of the execution hosts (e.g. PDA) on di®erent physical
locations using associations (CurrentLocation, AllowedLocation) between Hosts
and Physical Locations levels. The dynamic nature of the dynDD derives from
the need to change the current and allowed relationships between levels whenever
logical and/or physical mobility events take place.
      </p>
      <p>
        In Figure 4, the RequestPatientInfoPages service on the user-side is available
if the user PDA is able to connect (DaConnector ) to a WAN network (HwMedia).
Di®erent Places can provide di®erent types of network connections (i.e. typed
Ports of the Places), but not all of them are exploitable by the service (such
as the white-colored port 802.11n:LAN at Doctor's Home) due to particular
design choices and/or hardware limitations. Moreover the available connections
can have di®erent non-functional characteristics that a®ect the properties of the
service provision: in our case, the service reliability is in°uenced by the network
failure probability (i.e. PSI WAN) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] whose value is bound to the
CurrentNodeLocation association and varies when the doctor moves across the other allowed
physical locations (i.e. AllowedNodeLocation).
      </p>
      <p>
        Lastly, Figure 5 shows the hardware components making up the doctor's PDA
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. In particular the PDA can connect to a WAN network using its
HwEndPoint 3G card. Indeed we specify that a 3G WAN network is available (i.e.
the black-colored port named 3G:WAN) both when the doctor is at his/her
home or outside, but with di®erent reliability characteristics (see the rede¯ned
PSI WAN variable in Figure 4). We also declare here those variables (e.g. DISK's
memorySize, BATTERY's capacity) that will be referred by the hardware
con¯guration managers (see Section 3.2).
      </p>
      <p>&lt;&lt;hwDMIeSmKory&gt;&gt;
{memorySize = "memorySize",
resMult = 1}
&lt;&lt;HwI/O&gt;&gt;
DISPLAY
{resMult = 1}</p>
      <p>&lt;&lt;GaEPxDecAHost&gt;&gt;
&lt;&lt;hwProcessor&gt;&gt;</p>
      <p>
        CPU
{frequency = "currFrequency" ,
resMult = 1}
&lt;&lt;var&gt;&gt;-currHwConfig : NFP_String [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
&lt;&lt;var&gt;&gt;-currFrequency : NFP_Frequency [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
&lt;&lt;HwSupport&gt;&gt;
&lt;&lt;HwPowerSupply&gt;&gt;
      </p>
      <p>
        BATTERY
{capacity = "capacity",
resMult = 1}
&lt;&lt;var&gt;&gt;-capacity : NFP_Energy [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] = (1100,mAh)
&lt;&lt;var&gt;&gt;-currHwConfig : NFP_String [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
&lt;&lt;HwEndPoint&gt;&gt;
      </p>
      <p>3G Card
{connectedTo = WAN,
resMult = 1}
In this section we model the context-awareness of the eHealth application
following our approach. In Section 3.3, we will describe how the *-awareness can
in°uence di®erent behavior speci¯cations of the same system service.</p>
      <p>
        Physical Location-Awareness - The modeling of the Physical Location
Awareness takes inspiration from some previous works [
        <xref ref-type="bibr" rid="ref13 ref17">13, 17</xref>
        ]. We de¯ne a
Physical Mobility Manager associated to each system nomadic user (i.e. in our case
the doctor).
      </p>
      <p>
        A UML StateMachine is de¯ned where each state represents both the current
physical location (Place) and physical resources in the surroundings (together
referred as physical con¯guration, PhyCon¯g ) at the time when users demand for
services. The transitions are triggered either by physical moves of the nomadic
users or by changes in physical resources in the surroundings. Figure 6 shows
the doctor mobility pattern (i.e. the one of his/her PDA) where the physical
transfer from his/her home to the patient's one is highlighted along with the
probabilities of the moves (GaStep). 5. A PhyCon¯g state de¯nes the actual
ends of the Current- and AllowedNodeLocations relationships among execution
hosts and places on the dynDD (Figure 4, [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]).
      </p>
      <p>
        Logical Location-Awareness - Logical mobility is informally de¯ned as
the capability to dynamically change the bindings between code fragments and
the location where they are executed [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. We adopt the UML-based solution
proposed in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] based on a statechart called Logical Mobility Manager. In a
Logical Mobility Manager a state corresponds to the current allocation
(CurrentDeployment ) of the software components (MobileCode) to the proper execution
platforms (GaExecHost, Figure 4). State transitions represent the possible
redeployment of the mobile software artifacts through the communication channels
(HwMedia on Figure 4) to other platform devices (AllowedDeployment ).
      </p>
      <p>Hardware Platform Awareness - The third dimension of the
contextawareness, as de¯ned in this paper, takes into account the detailed hardware
speci¯cation of the execution environment. We specify in Figure 6(b) the
Hardware Con¯guration Managers for hardware resources of Figure 5 whose internal
con¯guration (HwCon¯g ) can in°uence the service behavior.</p>
      <p>
        Figure 6 illustrates the BATTERY, Display and CPU's managers as
separate statechart that model the states and transitions of corresponding hardware
components (Figure 5). Each state speci¯es a set of nfpConstraints (based on
variables de¯ned on the con¯gured hardware component) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] to hold the current
con¯guration (see the battery manager in Figure 6(b)).
      </p>
      <p>In addition, a remote ¯ring transition (BATTERY2LowPowerDowngrade)
highlights how the remaining BATTERY capacity (currCapacity) in°uences
the status of the CPU by ¯ring a remote transition that limits its clock frequency
(currFrequency).
3.3</p>
      <sec id="sec-4-1">
        <title>Modeling the service behaviors</title>
        <p>The eHealth modeling is completed by the speci¯cation of *-aware service's
behaviors. Figure 7 shows a Interaction Overview Diagram associated to the
RequestPatientInfoPages, with two possible behaviors.
5 Note that self-transitions on all states are represented, because they are implicitly
activated with the remaining amount of probability to achieve 1 on the sum of
outgoing transition probabilities of a state.</p>
        <p>In the Standard Behavior the doctor, once logged in, invokes the distributed
service, and the server-side components DaComponent are in charge of retrieving
data from a local database and, if needed, from a image server for patients' x-rays
or disease-related images. Finally the result is displayed on the client (Figure 7).
The service behavior can be determined by the current context condition (see
Figure 6) de¯ned by the current values of the managers' model variables. Hence,
the same service can have multiple implemented behaviors whose activation is
driven by the logics expressed within the managers.</p>
        <p>Figure 7 shows two alternative behaviors, enabled by conditions that refer
to the actual state of several hardware con¯guration managers. In particular
the StandardBehavior allows the retrieval of both text and images about the
patient only if enough DISK space and BATTERY power are available (reading
the current value of the currHwConfig vars), otherwise the ResourceConstrained
behavior will be executed that excludes the interaction with the image server
(the "white" lifeline and related messages in Figure 7) 6.
3.4</p>
      </sec>
      <sec id="sec-4-2">
        <title>Lumping the awareness in a unique model</title>
        <p>For the sake of the reliability analysis made in Section 4 we lump some of the
awareness managers introduced in Section 3.2 to obtain the unifying (UML)
statechart. In particular, we have considered the doctor's Physical Mobility Manager
and the PDA Display Hardware Con¯guration Manager (both in Figure 6(b)).
This choice allows, on one end to keep the example as simple as possible, and on
the other end to keep into account two di®erent types of awareness, as we will
show in Section 4. The lumping process brings to an unifying statechart with
eight feasible potential superstates, i.e. the cartesian product of the manager
state spaces.
6 For sake of illustration, in Section 4 we simplify the conditions for the activation of</p>
        <p>ResourceConstrained behavior by basing only on the display characteristics.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>An example of reliability analysis</title>
      <p>In this section we show an example of reliability analysis, as a proof of concept
that our approach not only allows to introduce all information necessary to
model non-functional attributes, but it also enables non-functional analysis that
supports critical decisions in a context-aware domain.</p>
      <p>
        The target of our analysis here is a model introduced in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] to study the
reliability of a software architecture as a function of the reliability of its components,
its connectors and other structural parameters. We have tailored that model to
the case of context-awareness and we have used it to estimate the reliability of
an example service (as modeled in Section 3) in di®erent superstates.
      </p>
      <p>As illustrated in Section 2, we assume that the set of services available to
users can be di®erent across the superstates due to changes in the resource
characteristics. Moreover, di®erent implementations of the same services can
be provided in di®erent superstates in order to adapt the service behavior to
di®erent hardware con¯gurations. In order to denote superstate-speci¯c services
(and components implementing them), as well as other system parameters, we
introduce the following notation: xj¾. It denotes the interpretation of term x in
the ¾ superstate.</p>
      <p>Let Sk be one of the system services (e.g. RequestPatientInfoPages of Section
3); let Skj¾ be the implementation of Sk provided in the ¾ superstate; and ¯nally
let Cij¾ (i = 1; : : : ; N ) be the set of components implementing Skj¾.</p>
      <p>Let µij¾ be the probability of failure of Cij¾, and let bpij¾ be the number of
activations of Cij¾ within the dynamics of Skj¾.</p>
      <p>Let Ã&lt;i;j&gt;j¾ be the probability of failure of the connector between Cij¾ and
Cj j¾, and let int&lt;i;j&gt;j¾ be the number of interactions between these two
components within the dynamics of Skj¾.</p>
      <p>
        Hence, we have reformulated the model in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] to the case of context-aware
service reliability as follows:
      </p>
      <p>N
R(Skj¾) = Y(1 ¡ µij¾)bpij¾ ¢
i=1</p>
      <p>Y (1 ¡ Ã&lt;i;j&gt;j¾)int&lt;i;j&gt;j¾
&lt;i;j&gt;
(1)</p>
      <p>In a certain superstate, the reliability of a service is given by the probability
that all components and connectors implementing it do not fail all the times
they are used (i.e. numbers of activations over components and interactions over
connectors).</p>
      <p>The µij¾'s can be extracted from an annotated Component Diagram
modeling the software architecture of the application, Ã&lt;i;j&gt;'s from a Deployment
Diagram like the one in Figure 4, and structural parameters bpij¾ and int&lt;i;j&gt;
from a Sequence Diagram like the one in Figure 7.</p>
      <p>Following the process illustrated in Section 2, the managers introduced for
this example in Section 3 can be lumped in a unique statechart that
represents the context management of the eHealth application. For sake of space we
do not show this process here, but we compute the reliability of
RequestPatientInfoPages service (RPIP-service) in two di®erent contexts, that are:
OpenAir/ColorDisplay (CD) and OpenAir/BWDisplay (BWD). We assume that in
the former context the Standard Behavior of the Application Server is adopted,
whereas the Resource Constrained Behavior is adopted in the latter case, thus
we can show the e®ect of changing context on the service reliability.</p>
      <p>In Table 1 the values adopted for the reliability model parameters have been
summarized, where the parameters referring to the components are placed in the
top rows and the ones referring to the connectors in the bottom rows. Note that
all values are invariant with respect to the context ¾, with the exception of the
number of activations and interactions of the Application Server. This is due to
the di®erent behaviors that this component adopts in the considered contexts.</p>
      <p>By applying the equation (1) the following values for the service reliability
are obtained: R(RP IP ¡ servicejCD) = 0:9386 and R(RP IP ¡ servicejBW D) =
0:9557. The service reliability is higher in the context where a back-and-white
display is used basically due to the adapted behavior of the Application Server
that does not interact with the Image Server to collect the patient's images. This
behavior allows to avoid additional activations and interactions that in the best
case do not increase the service reliability, and in all other cases (due to non-zero
failure probabilities of components and connectors) worsen it, as shown in this
simple numerical example.</p>
      <p>This example results would be even di®erent if superstates with di®erent
physical locations of a mobile device are considered, as in that case the failure
probabilities of connectors may also change. Yet many other scenarios can be
studied by simply comparing the service reliability in di®erent contexts (e.g. the
failure probability of components may change if di®erent versions of the same
service are implemented with di®erent types of components).</p>
      <p>Beyond the numerical analysis shown in this section, our approach opens
multiple possibilities for the system analysis. The construction of a single
statechart for context management allows to make analysis across di®erent contexts.
For example, by solving the lumped statechart as a Markov Chain, the steady
state probabilities can be obtained that represent the probability to sojourn in
each state. The average reliability of a certain service across contexts can be
simply obtained by summing the service reliability in each superstate weighted
by the steady state probability.
5</p>
    </sec>
    <sec id="sec-6">
      <title>Related work</title>
      <p>
        Several approaches have been introduced in the last few years to manage
mobility and adaptation at the middleware level. Among these, very relevant work has
been done within the framework of the MUSIC project [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. Basing on a
combined resource and context model the MUSIC middleware monitors the context
and the resources to catch their changes and adapts the application to ful¯ll the
users' QoS (Quality of Service) requirements. The approach uses QoS
predictors and utility functions to support the adaptation process. The adaptation is
based on the concept of service plan [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], that is a platform-independent
speci¯cation containing information on service con¯gurations, its dependencies on the
environment and its QoS and characteristics.
      </p>
      <p>
        All the MUSIC contributions can be used at run time given that the
application has been developed to be context-aware and QoS validated. As assessed in
[
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], the information the MUSIC middleware needs to properly work is speci¯ed
in the service plan, but such information is collected at the design time.
      </p>
      <p>
        As opposite to MUSIC project and other middleware contributions (e.g.
ReMMoC [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]), we provide a support to model and analyze non-functional
properties of such systems before their implementation and deployment. For example,
with our framework it would be possible to automatically generate the (MUSIC)
service plan and provide the QoS models that work as predictors in the MUSIC
adaptation process.
      </p>
      <p>
        Another interesting project is DiVA [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], which aims at providing an
integrated framework for managing dynamic variability in adaptive systems.
Di®erently from other approaches where the dynamic adaptation is handled at code
level [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], DiVA exploits both Model-Driven and Aspect-Oriented technologies
to de¯ne an architectural model (including base, variant and adaptation
models) at design time [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. The composition and validation at runtime of alternative
models allow: (i) the choice of the system con¯guration that best adapts to the
changed execution context, and (ii) the deployment and execution of the
chosen con¯guration supported by a re°ective middleware [
        <xref ref-type="bibr" rid="ref18 ref4">18, 4</xref>
        ]. However, such
approach does not provide any support for non-functional analysis.
      </p>
      <p>
        Grassi et al. in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] have proposed a modeling framework for QoS-aware
selfadaptive software applications that present several similarities with our
framework. Such framework, based on the de¯nition of an intermediate pivot language
(i.e. D-KLAPER), is aimed at providing instruments to transform software
models into non-functional models and analyze QoS characteristics while changes in
the application and/or its environment may occur.
      </p>
      <p>
        Our work improves the approach in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] for several aspects: (i)
contextawareness and mobility are based in our approach on a set of attributes whose
evolution is modeled through Statecharts, whereas in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] a set of triggers has to
be speci¯ed in isolation; (ii) the previous di®erence allows us to introduce
dependencies among events that cannot apparently modeled with D-KLAPER; (iii) we
have implemented our approach in UML, so to prove that such language has the
potential to represent triggers and (simple) adaptation mechanisms, whereas this
part of D-KLAPER still does not ¯nd any correspondence in UML. However,
on the other side, the work in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] also presents some advantages, such as: (i) to
explicit represent adaptation actions, (ii) to take into account the non-functional
costs of such actions, (iii) to generate a Markov Reward Model that allows to
study non-functional properties even in non steady states of the system.
      </p>
      <p>
        Finally, our idea of managing all context- and mobility-related aspects with
statecharts is very close to the concept of modes. Modes has been proposed in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]
to extend the Darwin ADL for modeling Service Oriented Computing systems.
Modes are also language primitives in the Architecture&amp;Analysis Description
Language (AADL) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] for modeling Real-Time&amp;Embedded Systems. In both
cases they can be used to model the structural evolution of software architecture
at runtime. Besides components, AADL allows the modal speci¯cation of all its
modeling elements like system, connectors and properties. Thus, our logical and
hardware managers can be modeled as AADL component's modes whereas the
overall context manager as system's modes. In AADL, it is also possible to model
the physical mobility by means of system's modes. However, in this case, it can't
be associated to a system user as we do associating the manager to UML Actors.
Therefore, di®erently to AADL, our UML-based modeling approach can be (i)
"sized" for di®erent de¯nitions of context and (ii) used as a general
"modalbased" modeling approach for software system of multiple domain.
      </p>
    </sec>
    <sec id="sec-7">
      <title>Conclusions</title>
      <p>We have introduced an unifying approach to the modeling of location- and
hardware platform-awareness aimed at analyzing non-functional properties of
software systems. As a proof of concept, we have provided an example of reliability
analysis.</p>
      <p>One of the peculiar properties of our approach to the context and mobility
modeling is its modularity. We allow to separately model with statecharts any
characteristic (single or multiple attributes) that may change and a®ect
nonfunctional properties. Such separate models can be used in isolation or variously
combined to study the behavior of such system under di®erent types of changes.</p>
      <p>Besides, with previous modeling approaches cross-dependencies among
attributes were hard to capture because they were represented with di®erent
models or not represented at all. With our unifying approach all attributes are
integrated within the same model, dependencies are explicitly modeled, and basic
adaptation actions that derive by context changes can be managed with the
same instruments.</p>
      <p>This work has been conceived to be extendable, and two main directions we
see at the moment for extending it. On one side, the concept of context can
be extended by embedding other attributes that can a®ect non-functional
properties. As long as this evolution can be represented through a state machine,
the mechanisms presented here can be applied to integrate these additional
concepts to the context evolution. We are also working to increase the complexity
of statechart remote ¯ring mechanisms without increasing the complexity of the
lumping step through the support of process algebras-based techniques. On the
other side, these types of analysis can be carried out for other non-functional
properties, such as performance, and further tradeo® analysis between di®erent
attributes can be devised.</p>
      <p>
        As future work we plan to make explicit the adaptation actions (beside the
simple replacement of a service behavior) in order to take into account their
non-functional properties. Also, we are studying the possibility to adopt this
approach at runtime as a support, for example, of self-adaptive systems. Finally,
the idea of using a Markov Reward Model [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] as a general target model is very
interesting to allow more complex types of analysis.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <article-title>1. Architectural and Analysis Description Language</article-title>
          , http://www.aadl.info/ .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>DynamIc</surname>
          </string-name>
          <article-title>VAriability in complex, adaptive systems</article-title>
          , Research Project, http://www.ict-diva.eu/ .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>UML</given-names>
            <surname>Pro</surname>
          </string-name>
          <article-title>¯le for MARTE</article-title>
          ,
          <source>OMG document ptc/08-06-09</source>
          , Object Management Group, Inc. (
          <year>2008</year>
          ), http://www.omgmarte.org/Documents/Speci¯cations/08-06- 09.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Nelly</given-names>
            <surname>Bencomo</surname>
          </string-name>
          .
          <article-title>Supporting the Modelling and Generation of Re°ective Middleware Families and Applications using Dynamic Variability</article-title>
          .
          <source>Phd thesis</source>
          , Computing Department, Lancaster University,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Di</given-names>
            <surname>Marco A. Berardinelli</surname>
          </string-name>
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Cortellessa</surname>
          </string-name>
          <string-name>
            <surname>V.</surname>
          </string-name>
          <article-title>An uni¯ed approach to model non-functional properties of mobile context-aware software</article-title>
          .
          <source>Technical Report 003-2009</source>
          , Computer Science Department, University of L'Aquila, http://www.di.univaq.it/cortelle/docs/report-003-2009.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Simona</given-names>
            <surname>Bernardi</surname>
          </string-name>
          , Jos¶e Merseguer, and
          <string-name>
            <surname>Dorina</surname>
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Petriu</surname>
          </string-name>
          .
          <article-title>Adding dependability analysis capabilities to the marte pro¯le</article-title>
          .
          <source>In Proc. of MoDELS '08</source>
          , pages
          <fpage>736</fpage>
          {
          <fpage>750</fpage>
          . Springer-Verlag,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Vittorio</given-names>
            <surname>Cortellessa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Harshinder</given-names>
            <surname>Singh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>and Bojan</given-names>
            <surname>Cukic</surname>
          </string-name>
          .
          <article-title>Early reliability assessment of uml based software models</article-title>
          .
          <source>In Proc. of WOSP '02</source>
          , pages
          <fpage>302</fpage>
          {
          <fpage>309</fpage>
          . ACM,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. Je® Magee Dan Hirsch, Je® Kramer and
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Uchitel</surname>
          </string-name>
          .
          <article-title>Modes for software architectures</article-title>
          .
          <source>In European Workshop on Software Architecture (EWSA '06)</source>
          , pages
          <fpage>113</fpage>
          {
          <fpage>126</fpage>
          . LNCS 4344,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Franck</given-names>
            <surname>Fleurey</surname>
          </string-name>
          , Vegard Dehlen, Nelly Bencomo, Brice Morin, and
          <string-name>
            <surname>Jean-Marc</surname>
            <given-names>J</given-names>
          </string-name>
          ¶
          <article-title>ez¶equel. Modeling and validating dynamic adaptation</article-title>
          .
          <source>Models@Runtime Workshop in conjunction with MODELS</source>
          <year>2008</year>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Alfonso</surname>
            <given-names>Fuggetta</given-names>
          </string-name>
          , Gian Pietro Picco, and
          <string-name>
            <given-names>Giovanni</given-names>
            <surname>Vigna</surname>
          </string-name>
          .
          <article-title>Understanding code mobility</article-title>
          .
          <source>IEEE Trans. Softw</source>
          . Eng.,
          <volume>24</volume>
          (
          <issue>5</issue>
          ):
          <volume>342</volume>
          {
          <fpage>361</fpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. Paul Grace, Gordon S. Blair, and
          <string-name>
            <given-names>Sam</given-names>
            <surname>Samuel</surname>
          </string-name>
          .
          <article-title>A re°ective framework for discovery and interaction in heterogeneous mobile environments</article-title>
          .
          <source>Mobile Computing and Communications Review</source>
          ,
          <volume>9</volume>
          (
          <issue>1</issue>
          ):2{
          <fpage>14</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Vincenzo</surname>
            <given-names>Grassi</given-names>
          </string-name>
          , Ra®aela Mirandola, and
          <string-name>
            <given-names>Enrico</given-names>
            <surname>Randazzo</surname>
          </string-name>
          .
          <article-title>Model-driven assessment of qos-aware self-adaptation</article-title>
          .
          <source>In Software Engineering for Self-Adaptive Systems</source>
          , pages
          <fpage>201</fpage>
          {
          <fpage>222</fpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Vincenzo</surname>
            <given-names>Grassi</given-names>
          </string-name>
          , Ra®aela Mirandola, and
          <string-name>
            <given-names>Antonino</given-names>
            <surname>Sabetta</surname>
          </string-name>
          .
          <article-title>A uml pro¯le to model mobile systems</article-title>
          .
          <source>In UML</source>
          , pages
          <volume>128</volume>
          {
          <fpage>142</fpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>P.</given-names>
            <surname>Inverardi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Mancinelli</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Nesi</surname>
          </string-name>
          .
          <article-title>A declarative framework for adaptable applications in heterogeneous environments</article-title>
          .
          <source>In Proc. of SAC '04</source>
          , pages
          <fpage>1177</fpage>
          {
          <fpage>1183</fpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>IST-MUSIC Project</surname>
          </string-name>
          .
          <article-title>Middleware Support for Self-Adaptation in Ubiquitous and Service-Oriented Environments</article-title>
          . http://www.ist-music.eu/.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Sten</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Lundesgaard</surname>
            , Ketil Lund, and
            <given-names>Frank</given-names>
          </string-name>
          <string-name>
            <surname>Eliassen</surname>
          </string-name>
          .
          <article-title>Service plans for contextand qos-aware dynamic middleware</article-title>
          .
          <source>Distributed Computing Systems Workshops</source>
          , International Conference on,
          <volume>0</volume>
          :
          <fpage>70</fpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17. Antinisca Di Marco and
          <string-name>
            <given-names>Cecilia</given-names>
            <surname>Mascolo</surname>
          </string-name>
          .
          <article-title>Performance analysis and prediction of physically mobile systems</article-title>
          .
          <source>In Proc. of WOSP</source>
          , pages
          <volume>129</volume>
          {
          <fpage>132</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Brice</surname>
            <given-names>Morin</given-names>
          </string-name>
          , Franck Fleurey, Nelly Bencomo,
          <string-name>
            <surname>Jean-Marc</surname>
            <given-names>J</given-names>
          </string-name>
          ¶ez¶equel, Arnor Solberg, Vegard Delhen, and
          <string-name>
            <given-names>Gordon</given-names>
            <surname>Blair</surname>
          </string-name>
          .
          <article-title>An aspect-oriented and model-driven approach for managing dynamic variability</article-title>
          .
          <source>In MODELS'08</source>
          , volume
          <volume>5301</volume>
          /2008 of LNCS, pages
          <volume>782</volume>
          {
          <fpage>796</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19. Rocco De Nicola,
          <string-name>
            <surname>Joost-Pieter</surname>
            <given-names>Katoen</given-names>
          </string-name>
          , Diego Latella, Michele Loreti, and
          <string-name>
            <given-names>Mieke</given-names>
            <surname>Massink</surname>
          </string-name>
          .
          <article-title>Model checking mobile stochastic logic</article-title>
          .
          <source>Theor. Comput. Sci.</source>
          ,
          <volume>382</volume>
          (
          <issue>1</issue>
          ):
          <volume>42</volume>
          {
          <fpage>70</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20. Gian Pietro Picco, Amy L.
          <string-name>
            <surname>Murphy</surname>
          </string-name>
          , and
          <string-name>
            <surname>Gruia-Catalin Roman</surname>
          </string-name>
          . Lime:
          <article-title>Linda meets mobility</article-title>
          .
          <source>In Proc. of ICSE '99</source>
          , pages
          <fpage>368</fpage>
          {
          <fpage>377</fpage>
          , New York, NY, USA,
          <year>1999</year>
          . ACM.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>