SelfMotion: A declarative approach for adaptive service-oriented mobile applications

https://doi.org/10.1016/j.jss.2013.10.057Get rights and content

Highlights

  • We defined a novel declarative language and a middleware to effectively design adaptive service-oriented mobile applications.

  • We investigated the advantages of the proposed approach w.r.t. existing related solutions.

  • We fully implemented and tested our framework with an existing worldwide distributed mobile application.

  • We performed a series of experiments to evaluate the applicability of the proposed solution in various scenarios.

  • We publicly released the implementation of the proposed approach to facilitate its adoption and allow the replicability of the obtained findings.

Abstract

Modern society increasingly relies on mobile devices. This explains the growing demand for high quality software for such devices. To improve the efficiency of the development life-cycle, shortening time-to-market while keeping quality under control, mobile applications are typically developed by composing together ad-hoc developed components, services available on-line, and other third-party mobile applications. Applications are thus built as heterogeneous compositions, whose characteristics strongly depend on the components and services they integrate. To cope with unpredictable changes and failures, but also with the various settings offered by the plethora of available devices, mobile applications need to be as adaptive as possible. However, mainstream adaptation strategies are usually defined imperatively and require complex control strategies strongly intertwined with the application logic, yielding to applications that are difficult to build, maintain, and evolve. We address this issue by proposing a declarative approach to compose adaptive heterogeneous mobile applications. The advantages of this approach are demonstrated through an example inspired by an existing worldwide distributed mobile application, while the implementation of the proposed solution has been validated through a set of simulations and experiments aimed at illustrating its performance.

Introduction

Software is a fundamental asset of modern society. Nowadays, most human activities are either software enabled or entirely managed by software. The recent massive adoption of mobile devices—such as smartphones and tablet PCs—which support people in their daily tasks, makes this phenomenon even more relevant. Mobile devices make software literally ubiquitous and pervasive, creating an increasing demand for high quality mobile applications to meet societal needs.

“Invented” by Apple for its iOS operating system and successively adopted by Google for the Android OS, apps are driving the growth of this mobile phenomenon. They are usually small-sized, often distributed and single-task applications, which the user may easily download (often for free) and install on her device to empower it with new capabilities with respect to those that come pre-installed.

The mobile market that enables this interaction is an extremely dynamic and vibrant ecosystem characterized by thousands of new apps published worldwide every week. This is posing new challenges to modern Software Engineering, first and foremost the need for effective development strategies centered around strong time-to-market constraints. To answer this challenge while keeping the various qualities of developed software under control, a component-based development process is usually adopted. This is enabled by the same development frameworks that come with modern mobile OSs, which allow components installed on the same device to easily communicate and invoke each other. As a result, most mobile apps are developed by composing together: (1) ad-hoc developed components, (2) existing services available on-line, (3) third-party apps, and (4) platform-dependent components to access device-specific hardware (e.g., camera, GPS, etc.).

The typical approach to develop such heterogeneous software artifacts follows a (possibly iterative) three-step approach. Developers first conceive the list of needed functionality and they organize them in a suitable workflow of execution. Secondly, they evaluate the trade-offs between implementing such functionality directly or resorting to existing services or third-party apps. Finally, they build the app by implementing the needed components and integrating all the pieces together.

Building apps as orchestrations of components, services and/or other third-party applications, however, introduces a direct dependency of the system with respect to external software artifacts which may evolve over time, fail, or even disappear, thereby compromising the application's functionality. Moreover, differently from traditional software systems, the development of mobile apps is characterized by an increased, often explicit dependency with respect to hardware and software settings of the deployment environment. Indeed, even if developed for a specific platform (e.g., iOS or Android), the same app may be deployed on a plethora of different devices characterized by heterogeneous hardware and software configurations (e.g., available sensors and networking hardware, list of pre-installed components, OS version, etc.). As an example, consider the case of an iPhone application using the built-in camera. The current iPhone has an auto focus camera while previous versions, still in widespread use, were equipped with fixed focus cameras. As we will show in our running example, this difference, albeit apparently minor, if left unmanaged may impact the application's ability to satisfy its requirements.

To cope with these peculiarities apps need to be adaptive (Cheng et al., 2009, McKinley et al., 2004), both with respect to the heterogeneous deployment environments and with respect to the external services and apps they rely upon. The traditional way to achieve this goal is to explicitly program the needed adaptations by heavily using branches in the execution flow and exception handling techniques to manage unexpected scenarios when they occur. This is not easy to do and results in complex code that intertwines the application logic with the logic to cope with the peculiarities of each device and with unexpected situations that may happen at run-time. This brings further complexity, resulting in hard to read and maintain code.

This paper precisely addresses this issue by proposing a different approach. We abandon the mainstream path in favor of a strongly declarative alternative, called SelfMotion,1 which allows apps to be modeled by describing: (1) a set of Abstract Actions, which provide a high-level description of the elementary activities that realize the desired functionality of the app, (2) a set of Concrete Actions, which map the abstract actions to the actual steps to be performed to obtain the expected behavior (e.g., invoking an external service or calling a pre-installed, third-party application), (3) a QoS Profile for each concrete action that models its non-functional characteristics (e.g., energy and bandwidth consumption), and (4) the overall Goal to be met and the QoS Policy to be adopted in reaching such goal (e.g., minimizing power consumption).

SelfMotion apps are then executed by a middleware that leverages automatic planning techniques to elaborate, at run-time, the best sequence of abstract actions to achieve the goal, mapping them to the concrete actions to execute in accordance with the specified QoS Policy. Whenever a change happens in the external environment (e.g., a service becomes unavailable) that prevents successful completion of the defined plan of execution the middleware automatically—and transparently with respect to the user—builds an alternative plan toward the goal. This reifies in a nice and effective self-healing behavior that allows the app to seamlessly continue its execution.

In this paper we describe our approach in details, and we show, through a set of experiments, its effectiveness and its performance, showing how the approach based on a planner scales well even when the goal becomes complex and requires, to be satisfied, several activities (i.e., abstract and concrete actions) to be called in the correct order.

SelfMotion brings several contributions and advantages with respect to the existing solutions in the area of self-adaptive and context-aware mobile apps:

  • 1.

    The proposed solution represents the first attempt to support the design and development of adaptive mobile apps that relies on planning as well as on a declarative language.

  • 2.

    SelfMotion represents a novel approach to adaptive mobile apps that conjugates functional adaptivity and non-functional awareness. More precisely, the former is achieved through planning, while the latter is obtained with QoS profiles and policies.

  • 3.

    We contribute to the area of mobile development investigating the intersection of mobile app and services and in particular shedding light on the adaptivity of mobile apps achieved via service re-binding.

SelfMotion was initially introduced in Cugola et al., 2012b, Cugola et al., 2012c. Beyond a significantly more detailed description of the approach, this paper reports on several new contributions and experiments. First, we extended SelfMotion by introducing the support for QoS policies and profiles. This is the subject of Sections 3.2.4 QoS profiles, 3.2.5 QoS policies. Second, we extended and improved our validation of the approach, using not only a real-world mobile application to qualitatively evaluate the approach, but also running several synthetic simulations aimed at stressing its scalability and performance. This is the subject of Section 5. More precisely, for a clear and effective explanation of the proposed approach, we rely on a realistic mobile app illustrated in Section 2 and used as a reference example throughout the paper. The SelfMotion approach is described in detail in Section 3, while Section 4 discusses its advantages with respect to the state of the art. Section 5 evaluates the performance of SelfMotion in several scenarios of growing complexity, while Section 6 discusses related work. Finally, Section 7 draws some conclusions and briefly illustrates future work.

Section snippets

A motivating example: the ShopReview app

Let us now introduce ShopReview (SR), the mobile app we will use throughout the paper. SR is inspired by an existing application (i.e., ShopSavvy2) and it allows users to share various information concerning a commercial product. In particular, an SR user may use the app to publish the price of a product she found in a certain shop (chosen among those close to her current location). In response, the app provides the user with alternative nearby places where the same

The SelfMotion approach

Here we introduce the SelfMotion approach and explain how to design an app like SR to achieve a form of self-adaptation that overcomes the problems discussed above.

Advantages of the SelfMotion approach

This section describes the main advantages of our approach with respect to the development process usually adopted for apps. The discussion refers to the SR example.

Validating the SelfMotion approach

To validate the SelfMotion approach, we implemented a publicly available open-source tool where the implementation the SR app can also be found (see Section 7). Although our approach is general and applies with limited technological modifications to several existing mobile frameworks, we focused on the Android mobile platform (Rogers et al., 2009) for our prototype.

The initial validation we report in this section consists of a testing campaign we performed, exploiting the Android emulator as

Related work

The recent massive adoption of mobile devices generated an increasing interest on engineering mobile applications. A lot of research is focusing on the effective and efficient development of such systems, as summarized by Dehlinger and Dixon (2011) and Wasserman (2010). Existing works span a wide range of approaches: from how to achieve context-aware behavior (e.g., Gonzlez et al., 2011) to how to apply agile methods in the mobile domain (e.g., Abrahamsson et al., 2004).

Conclusions and future work

We presented SelfMotion, a declarative approach supporting systematic development of mobile apps, modeled in terms of goals, abstract and concrete actions. The approach exploits automatic planning techniques to elaborate, at run-time, the best sequence of activities to achieve the app's goal. In addition, the proposed approach also allows to annotate the actions that compose the final apps with a description of their non-functional behavior (i.e., their QoS profile). By exploiting such

Acknowledgments

This research has been funded by the EU, Programme IDEAS-ERC, Project 227977-SMScom and FP7-PEOPLE-2011-IEF, Project 302648-RunMore.

Gianpaolo Cugola received his Dr.Eng. degree in Electronic Engineering from Politecnico di Milano. In 1998 he received the Prize for Engineering and Technology from the Dimitri N. Chorafas Foundation for his Ph.D. thesis on Software Development Environments. He is currently Associate Professor at Politecnico di Milano where he teaches several courses in the area of Computer Science. He is co-author of tens of scientific papers published in international journals and conference proceedings. His

References (51)

  • M.H. Burstein et al.

    DAML-S: web service description for the semantic web

  • M. Calisti et al.

    Goal-oriented autonomic process modeling and execution for next generation networks.

  • L. Capra et al.

    CARISMA: context-aware reflective middleware system for mobile applications

    IEEE Trans. Softw. Eng.

    (2003)
  • D. Chakraborty et al.

    Service composition for mobile environments

    Mobile Netw. Appl.

    (2005)
  • B. Cheng et al.

    Software engineering for self-adaptive systems: a research roadmap

  • G. Cugola et al.

    Process programming in the service age: old problems and new challenges

  • G. Cugola et al.

    DSOL: a declarative approach to self-adaptive service orchestrations

    Computing

    (2012)
  • G. Cugola et al.

    Adaptive service-oriented mobile applications: a declarative approach

    Service-Oriented Computing

    (2012)
  • G. Cugola et al.

    SelfMotion: a declarative language for adaptive service-oriented mobile apps

  • G. Cugola et al.

    Qos-aware adaptive service orchestrations

  • J. Dehlinger et al.

    Mobile application software engineering: challenges and research directions

  • T. Erl

    Service-oriented architecture: concepts, technology, and design

    The Prentice Hall Service-Oriented Computing Series from Thomas Erl Series

    (2005)
  • C. Ghezzi et al.

    Improving interaction with services via probabilistic piggybacking

  • C. Ghezzi et al.

    Uncertainty management via model-driven adaptivity

  • S. Gonzalez et al.

    Subjective-C

  • Cited by (9)

    View all citing articles on Scopus

    Gianpaolo Cugola received his Dr.Eng. degree in Electronic Engineering from Politecnico di Milano. In 1998 he received the Prize for Engineering and Technology from the Dimitri N. Chorafas Foundation for his Ph.D. thesis on Software Development Environments. He is currently Associate Professor at Politecnico di Milano where he teaches several courses in the area of Computer Science. He is co-author of tens of scientific papers published in international journals and conference proceedings. His research interests are in the area of Software Engineering and Distributed Systems. In particular, his current research focuses on middleware technology for largely distributed and highly reconfigurable distributed applications with a special attention to the issue of Complex Event Processing..

    Carlo Ghezzi is an ACM Fellow, an IEEE Fellow, a member of the European Academy and of the Italian Academy of Sciences. He received the ACM SIGSOFT Distinguished Service Award. He is the current President of Informatics Europe. He is a regular member of the program committee of flagship conferences in the software engineering field, such as the ICSE and ESEC/FSE, for which he also served as Program and General Chair. He has been the Editor in Chief of the ACM Trans. on Software Engineering and Methodology and is currently an Associate Editor of the Communications of the ACM, IEEE Trans. on Software Engineering, Science of Computer Programming, Computing, and Service Oriented Computing and Applications. Ghezzi's research has been mostly focusing on different aspects of software engineering. He co-authored over 200 papers and 8 books. He coordinated several national and international research projects. He is currently the PI of the ERC Advanced Grant SMScom.

    Leandro Sales Pinto received the MSc degree in computer science from the Universidade de Fortaleza - Brazil. He received the PhD degree in computer science engineering at Politecnico di Milano, where his main focus was on Self-adaptive systems and service compositions.

    Giordano Tamburrelli received the MSc degree in computer science from the University of Illinois at Chicago, and the MSc degree in computer science engineering from the Politecnico di Milano in a joint degree program. He received the PhD degree in  computer science engineering at Politecnico di Milano and, currently, he is Marie Curie Fellow at the University of Lugano. His research interests focus on runtime modeling and  verification of systems and software, non-functional requirements, and service-based architectures.

    View full text