GRAF: Graph-based Runtime Adaptation Framework Mahdi Derakhshanmanesh University of Koblenz-Landau Universitätsstr. 1 Koblenz, Germany manesh@uni-koblenz.de Mehdi Amoui University of Waterloo 200 University Ave W Waterloo, Canada mamouika@uwaterloo.ca Greg O’Grady University of Waterloo 200 University Ave W Waterloo, Canada gdogrady@uwaterloo.ca Jürgen Ebert University of Koblenz-Landau Universitätsstr. 1 Koblenz, Germany ebert@uni-koblenz.de Ladan Tahvildari University of Waterloo 200 University Ave W Waterloo, Canada ltahvild@uwaterloo.ca ABSTRACT One approach for achieving runtime adaptability in software is to use application frameworks that are tailored for the de- velopment of self-adaptive systems. In this paper, we present the Graph-based Runtime Adaptation Framework (GRAF), which enables adaptivity by creating, managing, and inter- preting graph-based models of software at runtime. Hav- ing a generic graph representation in our approach allows for flexible adaptation via query and transformation opera- tions. The framework is especially suited for the migration of legacy applications towards adaptive software and attempts to reduce necessary changes to the original software. As a proof of concept, we conduct a comprehensive case study of migrating the legacy game Jake2 to achieve runtime adap- tivity using GRAF. Categories and Subject Descriptors D.3.3 [Programming Languages]: Language Constructs and Features—Frameworks ; K.6.3 [Management of Com- puting and Information Systems]: Software Manage- ment General Terms Design, Experimentation, Measurement, Performance Keywords Adaptation framework, runtime adaptivity, self-adaptive soft- ware, model transformation, models at runtime Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. SEAMS ’11, May 23-24, 2011, Waikiki, Honolulu, HI, USA Copyright 2011 ACM 978-1-4503-0575-4/11/05 ...$10.00. 1. INTRODUCTION A strong trend in software engineering is to move towards model-based and model-driven engineering. As models pro- vide abstract and customized views of software they can help to reduce complexity by hiding irrelevant details [11]. Accordingly, most ongoing research that is related to self- adaptive software systems (SASS) follows the same trend [4]. In practice though, modeling is one of the major chal- lenges in engineering SASSs [13]. The construction of precise and accurate models of software that address the demands of self-adaptive systems is a hard task, given the highly com- plex and dynamic nature of such systems. Difficulties arise, especially in the area of model-centric runtime adaptation, where we need to generate, manipulate, and manage models at runtime [5, 20]. The most common reference architecture for SASS com- prises two main subsystems: the adaptation manager (au- tonomic manager) and the adaptable software (managed el- ement) [16]. The adaptation manager acts as an external controller that observes the adaptable software for changes in its operating states and selects appropriate adaptive be- havior accordingly. These two subsystems are connected through sensor and effector interfaces, which shapes a closed feedback control loop. In a model-centric approach, an adap- tation manager controls the adaptable software by manip- ulating its runtime model, instead of directly operating on the adaptable software. This reflective architecture [2, 6] is sketched in Figure 1 and demands additional processes to complete the traditional adaptation loop. Adaptable Software Runtime Model Adaptation Manager Sensing Reification Effecting Reflection Controlling Figure 1: Reflective architectural blueprint of a model-centric SASS.