context variability for context-aware systems

3
0018-9162/14/$31.00 © 2014 IEEE Published by the IEEE Computer Society FEBRUARY 2014 85 SOFTWARE TECHNOLOGIES Context Variability for Context-Aware Systems Rafael Capilla, Rey Juan Carlos University, Spain Óscar Ortiz, Universidad Politécnica de Madrid, Spain Mike Hinchey, Lero—the Irish Software Engineering Research Centre Many software systems must adapt to suit the particular context in which they are operating. Runtime variability mechanisms are suitable for systems that must configure optimally during execution. A s they become smarter and more adaptive, critical systems must increasingly rely on contextual awareness to success- fully adapt to changing conditions. A combination of knowledge and monitoring (E. Vassev et al., “Awareness in Software-Intensive Systems,” Computer , vol. 45, no. 12, 2012, pp. 84–87), contextual aware- ness enables systems to interact with the real world by determining the degree of adaptation the envi- ronment requires. RUNTIME ADAPTATION Autonomous, ubiquitous, pervasive, and self-* systems (self-adaptive, self- monitoring, self-healing) make smart self-adaptation possible with little or no human intervention by exploiting contextual properties and demand- ing dynamic runtime reconfiguration. Modern self-aware systems have monitoring and learning capabilities to detect when the context varies and modify system behavior at runtime. Some such systems are capable of launching a new configuration auton- omously without human intervention (in robots, for example); for other sys- tems, users modify system properties in relation to the context (for exam- ple, resetting the time on a mobile phone to reflect the current time zone). Because different events and contextual conditions can provoke different system responses, suitable runtime adaptation mechanisms and intelligent decision making enable systems to successfully handle the demands and complexity of dynamic variability and adaptation. STATIC VERSUS DYNAMIC VARIABILITY MODELS Today, many of the pervasive and software-intensive systems that use contextual properties are based on a software product line approach, which manages the dozens of varia- tions implemented in the software. However, this approach treats variability as a static design artifact that implements the variations in software architecture. Recently, how- ever, a dynamic software product line approach was described as a way to promote runtime variability use (M. Hinchey, S. Park, and K. Schmid, “Building Dynamic Software Product Lines,” Computer , vol. 45, no. 10, 2012, pp. 22–26) and as a mechanism for managing context features dynami- cally to cater to the needs of dynamic adaptation (R. Capilla and J. Bosch, “The Promise and Challenge of Run- time Variability,” Computer, vol. 44, no. 12, 2011, pp. 93–95). Unlike static variability models, in which variants are typically set during the development cycle, runtime variability models offer a dynamic way to change and select variants at different binding times (J. Bosch and R. Capilla, “Dynamic Variability in Software-Intensive Em- bedded System Families,” Computer , vol. 45, no. 10, 2012, pp. 28–35). Contemporary runtime variability

Upload: mike

Post on 22-Mar-2017

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Context Variability for Context-Aware Systems

0018-9162/14/$31.00 © 2014 IEEE Published by the IEEE Computer Society FEBRUARY 2014 85

COLUMN SECTION TITLESOF T WARE TECHNOLOGIES

Context Variability for Context-Aware SystemsRafael Capilla, Rey Juan Carlos University, Spain

Óscar Ortiz, Universidad Politécnica de Madrid, Spain

Mike Hinchey, Lero—the Irish Software Engineering Research Centre

Many software systems must adapt to suit the particular context in which they are operating. Runtime variability mechanisms are suitable for systems that must configure optimally during execution.

A s they become smarter and more adaptive, critical systems must increasingly rely on

contextual awareness to success-fully adapt to changing conditions. A combination of knowledge and monitoring (E. Vassev et al., “Awareness in Software-Intensive Systems,” Computer, vol. 45, no. 12, 2012, pp. 84–87), contextual aware-ness enables systems to interact with the real world by determining the degree of adaptation the envi-ronment requires.

RUNTIME ADAPTATION Autonomous, ubiquitous, pervasive, and self-* systems (self-adaptive, self-monitoring, self-healing) make smart self-adaptation possible with little or no human intervention by exploiting contextual properties and demand-ing dynamic runtime reconfiguration. Modern self-aware systems have monitoring and learning capabilities to detect when the context varies and

modify system behavior at runtime. Some such systems are capable of launching a new configuration auton-omously without human intervention (in robots, for example); for other sys-tems, users modify system properties in relation to the context (for exam-ple, resetting the time on a mobile phone to reflect the current time zone). Because different events and contextual conditions can provoke different system responses, suitable runtime adaptation mechanisms and intelligent decision making enable systems to successfully handle the demands and complexity of dynamic variability and adaptation.

STATIC VERSUS DYNAMIC VARIABILITY MODELSToday, many of the pervasive and software-intensive systems that use contextual properties are based on a software product line approach, which manages the dozens of varia-tions implemented in the software. However, this approach treats

variability as a static design artifact that implements the variations in software architecture. Recently, how-ever, a dynamic software product line approach was described as a way to promote runtime variability use (M. Hinchey, S. Park, and K. Schmid, “Building Dynamic Software Product Lines,” Computer, vol. 45, no. 10, 2012, pp. 22–26) and as a mechanism for managing context features dynami-cally to cater to the needs of dynamic adaptation (R. Capilla and J. Bosch, “The Promise and Challenge of Run-time Variability,” Computer, vol. 44, no. 12, 2011, pp. 93–95).

Unlike static variability models, in which variants are typically set during the development cycle, runtime variability models offer a dynamic way to change and select variants at different binding times (J. Bosch and R. Capilla, “Dynamic Variability in Software-Intensive Em-bedded System Families,” Computer, vol. 45, no. 10, 2012, pp. 28–35).

Contemporary runtime variability

r2sof.indd 85 1/23/14 4:03 PM

Page 2: Context Variability for Context-Aware Systems

86 COMPUTER

SOF T WARE TECHNOLOGIES

models should include the following properties to efficiently manage sys-tems’ context awareness:

• ability to add, change, or remove variants dynamically with minimal, or even no, human intervention;

• support for multiple binding times and a focus on dynamic binding of context features (multiple binding times enable the transition from one opera-tional mode to another);

• enhanced support for evolution, such as adding new capabilities in a controlled manner at run-time; and

• fast and best-case reaction to varying context conditions.

Runtime variability mechanisms, in combination with context features, offer a good choice for systems that need optimal and valid configura-tion during system execution.

CONTEXT VARIABILITYContext features must be clearly identified, modeled, and managed for self-adaptive and context-aware systems to reason about potential context changes and per-form according to set strategy or

reconfiguration plans. The diversity and combination of context features necessary to satisfy the multiple adaptation scenarios of context-aware systems can be addressed by introducing variability in context properties. Consequently, the notion of context variability (H. Hartmann et al., “Using Feature Diagrams with Context Variability to Model Multiple Product Lines for Software Supply Chains,” Proc. 12th Int’l Software Product Line Conf. [SPLC 08], 2008, pp. 12–21) becomes particularly im-portant for contextualizing those system features directly related to the physical environment.

As context determines the envi-ronment in which a system operates, we use context variability to model those context features intended to be activated or deactivated at run-time, or when a new variant must be added to engage a new functionality. Recent advances in context-aware systems, along with the trend to model and use features dynamically, requires adequate context analysis to identify and represent context feature integrated with those de-scribed in the feature model. Thus, we understand context analysis as a complementary process to tradi-tional domain analysis.

Context feature modelingDesigners of context-aware sys-tems identify the relevant context features used to adapt system be-havior. However, contemporary product line approaches using feature-oriented design analysis (FODA)-based models do not ex-plicitly distinguish these context properties. One approach is to model context features separately but complementarily, anchoring system features in one branch and context features in another. How-ever, this approach overloads the number of relationships between both types of features. Another alternative is to label only those features that relate to context changes and that are managed spe-cifically by a context manager.

However, when the system de-mands incorporation of a new functionality, context features aren't enough. In these cases, dy-namic variability models require specific mechanisms to support runtime changes in structural vari-ability, as they might also affect context features. Taxonomies pro-vide a way to assign features to categories, define compatible types of features according to their func-tionality in the system, and then use these types to add, remove, or change features at runtime. Design-ers must define the appropriate feature taxonomy for each type of system. As Figure 1 shows, we an-ticipate two strategies for modeling a system’s context variability.

Strategy A: two related feature models. The left side of Figure 1 shows a feature model that includes a branch where the designer models context features separately from non-context fea-tures. Dependencies between context and non-context features overload the relationships between features, and such dependencies can be bidirectional. For instance, a feature F may have a different

Cf5, Cf6

Cf3, Cf4

Cf1

Cf7

f1=Cf2

Feature or variantVariation pointContext featureContext feature activatedContext feature deactivated

Taxonomy of context featuresType 1: Cf2, Cf3, Cf4Type 2: Cf1, Cf5, Cf6Type 3: Cf7Compatible types: Type 1, Type 3Context  Feature 

Cf5, Cf6 

Cf1 Cf7

Cf2, Cf3, Cf4

f1

Figure 1. Context feature modeling shows alternatives that use a taxonomy of predefined types to support dynamic changes in structural variability.

r2sof.indd 86 1/23/14 4:03 PM

Page 3: Context Variability for Context-Aware Systems

FEBRUARY 2014 87

Selected CS articles and columns are available for free at http://ComputingNow.computer.org.

value depending on the context C (such as a physical location where the product is built), or a particular context feature C (such as the coun-try where the software will run) may need a specific functionality implemented by a feature F.

Strategy B: single feature model. In the alternative shown in the right side of Figure 1, context and non-context features are modeled under the same feature model, which reduces the possible number of dependen-cies between features, such as the relationship between feature f1 and context feature Cf2. Context features are simply labeled in the feature model and classified according to a set of predefined types.

In Figure 1, we show in green and red, respectively, those context features that are activated and de-activated at a given time. We assign different types to classify con-text features under a common or compatible functionality, such as multimedia and security. Strategy A is more reusable when several con-texts are involved, whereas strategy B simplifies the feature model and reduces the number of dependencies among features.

Context analysis Likewise, domain analysis is a major complex human task used to iden-tify objects and operations relevant in an application domain. Context analysis is a complementary activ-ity used to identify and model a system’s context properties and the possible transitions between its op-erational modes. From the dynamic software product line perspective, context analysis should encompass the following tasks:

• Identify system physical prop-erties—the designer identifies system properties pertinent to environmental changes or with which the system interacts.

• Model context features—those

physical properties that vary according to changes in the context are modeled as con-text features using Strategy A or B as previously described. The designer should provide a taxonomy where those context features can be classified or grouped according to different system functionalities.

• Identify features that modify the structural variability dy-namically—in addition to those context features that can be activated and deactivated, the designer must identify those context features that may impact structural variabil-ity when the system needs to modify its functionality.

• Define operational rules—as with the “requires” and “ex-cludes” constraints used in conventional product lines, the operational dependencies guiding the activation and de-activation of context features at runtime must be defined.

• Define multiple binding modes—the designer must define the binding times for each context feature or group to specify the transition be-tween different binding times or between the system’s opera-tional modes.

BUILDING CRITICAL CONTEXT-AWARE SYSTEMSModern mission-critical systems must be able to dynamically adapt their behavior to multiple scenar-ios. Context managers use context features and adaptation rules to handle such dynamic changes as well as when system features bind to new values at runtime. Whereas conventional software performs re-configuration activities in offline mode, a context-aware system can reconfigure itself in online mode. Ideally, dynamic software product lines can overcome three main chal-lenges: identifying and modeling

those context features that can be modified and handled at runtime; defining and selecting the bind-ing times for each feature or group of features, so that the system can change between different opera-tional modes; and developing the most efficient software units and mechanisms to monitor and manage runtime changes.

Context variability extends the traditional perspec-tive of feature modeling

for systems that exploit context properties dynamically. How-ever, the increasing complexity of critical systems that demand more dynamic capabilities requires going beyond simply activating and deac-tivating features. The combination of context features and dynamic variability techniques are an excellent way to supply automatic reconfiguration mechanisms for critical context-aware systems.

Rafael Capilla is an associate professor at Rey Juan Carlos Univer-sity, Madrid, Spain, and heads the Software Architecture & Internet Technologies (SAIT) research group. Contact him at [email protected].

Óscar Ortiz is an associate professor at Universidad Politécnica de Madrid, Spain. Contact him at [email protected].

Mike Hinchey is director of Lero—the Irish Software Engineering Research Centre, and professor of software engineering at the Univer-sity of Limerick, Ireland. Contact him at [email protected].

r2sof.indd 87 1/23/14 4:03 PM