1 Model-Diven Engineeing of Adaptation Engines fo Self-Adaptive Softwae: Executable Runtime Megamodels Thomas Vogel, Holge Giese Technische Beichte N. 66 des Hasso-Plattne-Instituts fü Softwaesystemtechnik an de Univesität Potsdam
3 Technische Beichte des Hasso-Plattne-Instituts fü Softwaesystemtechnik an de Univesität Potsdam
5 Technische Beichte des Hasso-Plattne-Instituts fü Softwaesystemtechnik an de Univesität Potsdam 66 Thomas Vogel Holge Giese Model-Diven Engineeing of Adaptation Engines fo Self-Adaptive Softwae Executable Runtime Megamodels Univesitätsvelag Potsdam
6 Bibliogafische Infomation de Deutschen Nationalbibliothek Die Deutsche Nationalbibliothek vezeichnet diese Publikation in de Deutschen Nationalbibliogafie; detailliete bibliogafische Daten sind im Intenet übe abufba. Univesitätsvelag Potsdam Am Neuen Palais 10, Potsdam Tel.: +49 (0) / Fax: Die Schifteneihe Technische Beichte des Hasso-Plattne-Instituts fü Softwaesystemtechnik an de Univesität Potsdam wid heausgegeben von den Pofessoen des Hasso-Plattne-Instituts fü Softwaesystemtechnik an de Univesität Potsdam. ISSN (pint) ISSN (online) Das Manuskipt ist uhebeechtlich geschützt. Online veöffentlicht auf dem Publikationsseve de Univesität Potsdam URL URN un:nbn:de:kobv:517-opus Zugleich geduckt eschienen im Univesitätsvelag Potsdam: ISBN
7 Abstact The development of self-adaptive softwae equies the engineeing of an adaptation engine that contols and adapts the undelying adaptable softwae by means of feedback loops. The adaptation engine often descibes the adaptation by using untime models epesenting elevant aspects of the adaptable softwae and paticula activities such as analysis and planning that opeate on these untime models. To systematically addess the inteplay between untime models and adaptation activities in adaptation engines, untime megamodels have been poposed fo self-adaptive softwae. A untime megamodel is a specific untime model whose elements ae untime models and adaptation activities. Thus, a megamodel captues the inteplay between multiple models and between models and activities as well as the activation of the activities. In this aticle, we go one step futhe and pesent a modeling language fo ExecUtable RuntimE MegAmodels (EUREMA) that consideably eases the development of adaptation engines by following a model-diven engineeing appoach. We povide a domain-specific modeling language and a untime intepete fo adaptation engines, in paticula fo feedback loops. Megamodels ae kept explicit and alive at untime and by intepeting them, they ae diectly executed to un feedback loops. Additionally, they can be dynamically adjusted to adapt feedback loops. Thus, EUREMA suppots development by making feedback loops, thei untime models, and adaptation activities explicit at a highe level of abstaction. Moeove, it enables complex solutions whee multiple feedback loops inteact o even opeate on top of each othe. Finally, it leveages the co-existence of self-adaptation and off-line adaptation fo evolution. Keywods Model-Diven Engineeing, Modeling Languages, Modeling, Models at Runtime, Megamodels, Model Execution, Self-Adaptive Softwae, Adaptation Engines, Feedback Loops i
9 Contents 1 Intoduction State-of-the-At in Engineeing Adaptation Engines Appoach: EUREMA ExecUtable RuntimE MegAmodels Contibution Outline Teminology, Concepts, and Requiements Feedback Loops Knowledge & Runtime Models Sensos and Effectos & Monito and Execute Layeed Achitectue Off-line Adaptation Modeling a Feedback Loop Oveview of the EUREMA Language Modeling a Single Feedback Loop Tigge fo Feedback Loops Modulaizing Feedback Loop Diagams Modeling Multiple Feedback Loops Independent Feedback Loops Coodination of Multiple Feedback Loops Sequencing Complete Feedback Loops Sequencing Analysis and Planning of Feedback Loops iii
10 5 Modeling Layeed Achitectues Declaative Reflection Use-defined Reflection Models Pocedual Reflection EUREMA-based Reflection Models Modeling Off-line Adaptation 33 7 Execution Metamodel and Execution Semantics (1) Adaptation Activities, Runtime Models, and Feedback Loops (2) Layeed Achitectues (3) Execution Metamodel and Intepete Implementation Discussion and Evaluation Requiements Coveage Application of MDE Techniques in EUREMA Application of the EUREMA Language Rainbow DiVA PLASMA Discussion Runtime Chaacteistics of the EUREMA Intepete Conclusion and Futue Wok 53 Bibliogaphy 55 iv
11 List of Figues 2.1 Extenal appoach MAPE-K Multiple feedback loops and inte-loop coodination Runtime models fo feedback loops Layeed achitectue fo an adaptation engine Off-line adaptation of self-adaptive softwae Feedback Loop Diagam (FLD) fo MAPE-K Laye Diagam (LD) fo MAPE-K FLD fo Self-epai LD fo Self-epai Concete syntax of the EUREMA language fo (a) FLDs and (b) LDs FLD fo the analyze activity of self-epai Complex model opeation FLD fo the Self-epai feedback loop using a complex model opeation depicted in Figue 3.7b to invoke the analysis activity defined in the FLD shown in Figue LD fo Self-epai Vaiability fo a complex model opeation Vaiability fo a model opeation FLD fo Self-optimization LD fo two feedback loops FLD fo Self-management-1: sequencing complete feedback loops by invoking the selfepai loop (Figue 3.8) followed by the self-optimization loop (Figue 4.1) v
12 4.4 LD fo Self-management Analyze and plan activities of (a) self-epai and (b) self-optimization FLD fo Self-management-2: sequencing the analysis and planning activities of the self-epai (cf. Figue 4.5a) and self-optimization (cf. Figue 4.5b) feedback loops LD fo Self-management FLD fo Self-epai-stategies Layeed feedback loops fo self-epai: the :Self-epai-stategies module at Laye-2 senses and effects the :Self-epai module at Laye FLD fo Self-epai-stategies Layeed feedback loops fo self-epai: the :Self-epai-stategies-2 module at Laye-2 senses and effects the :Self-epai module at Laye Sequence diagam descibing the logical behavio of layeed feedback loops Initial LD FLD fo Self-epai-patch The ule to change the initial LD shown in Figue The esult of applying the ule depicted in Figue 6.3 on the LD depicted in Figue Had-wied legacy module EUREMA tigge fo a legacy module Metamodel of the EUREMA language FLD fo Rainbow LD fo Rainbow FLD fo DiVA LD fo DiVA FLD fo the Configuation Manage of DiVA FLD fo the Adaptation laye in PLASMA LD fo PLASMA FLD fo the Planning laye of PLASMA Aveage CPU Load of the code-based solution (Code) and EUREMA (Intepete) Intepete ovehead by means of the diffeences in aveage CPU loads vi
13 Chapte 1 Intoduction Self-adaptation capabilities ae equied fo many moden softwae systems that ae self-awae, contextawae, mission-citical, o ulta-lage-scale in ode to dynamically adapt thei configuation in esponse to changes in the system itself, the envionment, o the equiements [Cheng et al. 2009; de Lemos et al. 2013]. The development of self-adaptive softwae following the extenal appoach [Salehie and Tahvildai 2009] sepaates the softwae into the adaptable softwae and the adaptation engine. In between both, a feedback loop ensues that the adaptation engine dynamically adjusts the adaptable softwae in esponse to changing equiements and obseved changes in the adaptable softwae and its opeational envionment. This sepaation eases the development because it decouples the adaptable softwae fom the adaptation engine, and both ae integated by well-defined senso and effecto intefaces. Howeve, the feedback loop then becomes a cucial element of the oveall softwae achitectue, which has to be undestood and explicitly designed fo engineeing self-adaptive softwae [Shaw 1995; Mülle et al. 2008; Bun et al. 2009]. Additionally, even multiple feedback loops might have to be consideed [Kephat and Chess 2003; Bazie et al. 2009; Weyns et al. 2012]. On the one hand, the adaptation engine may not necessaily employ only a single feedback loop but athe multiple of them in paallel to handle diffeent concens such as self-epai o self-optimization, to distinguish between localized and global adaptation, o to decentalize contol in geneal. On the othe hand, thee ae also cases whee the feedback loops have to opeate on top of each othe as, fo example, needed fo the diffeent layes of the efeence achitectue fo self-managed systems poposed by Kame and Magee . Futhemoe, sepaating the adaptation engine fom the adaptable softwae makes the knowledge about the adaptable softwae, which is used by the adaptation engine, anothe cucial element in developing self-adaptive softwae. This knowledge concens epesentations of the unning adaptable softwae, thei synchonization with the unning adaptable softwae though sensos and effectos, and the way adaptation is analyzed and planned. Regading the analysis and planning of adaptation, this includes the stategic knowledge detemining how to identify and handle adaptation needs like pefomance poblems. While taditionally achitectue desciption languages ae employed fo such epesentations in selfadaptive softwae at untime [Oeizy et al. 1998; Galan et al. 2004; Geogas et al. 2009], untime models [Fance and Rumpe 2007; Blai et al. 2009] that follow model-diven engineeing (MDE) pinciples and that leveage the benefits of MDE fo untime abstactions of the adaptable softwae ae 1
14 2 1 Intoduction emeging today [Moin et al. 2009a; Vogel and Giese 2010; Song et al. 2011]. It is futhe likely that the adaptation engine does not only employ a single untime model but athe multiple and specialized models at the same time to handle diffeent concens such as failues o pefomance. Likewise, Blai et al. [2009, p.25] have obseved that in pactice, it is likely that multiple [untime] models will coexist and that diffeent styles of models may be equied to captue diffeent system concens. This makes it necessay to simultaneously conside multiple untime models and the inteplay between them when engineeing and executing adaptation engines [Vogel et al. 2011]. Finally, it cannot be expected that the self-adaptive softwae automates and takes ove all the adaptation activities that ae usually pefomed off-line in the context of maintenance and evolution. Thus, besides ealizing an adaptation engine fo the self-adaptation, a solution fo the co-existence of such an engine with off-line adaptation, and thus, with typical maintenance and evolution is equied [Gacek et al. 2008; Andesson et al. 2013]. All these aspects constitute coe equiements fo self-adaptive softwae, which have to be consideed when engineeing adaptation engines. 1.1 State-of-the-At in Engineeing Adaptation Engines In the following, we eview state-of-the-at appoaches and show that they do not simultaneously suppot all the coe equiements fo engineeing adaptation engines as just outlined, namely making feedback loops explicit in the design of self-adaptive softwae, and suppoting multiple feedback loops, layeed achitectues fo feedback loops, and the co-existence of self-adaptation and off-line adaptation, while exploiting untime models and MDE. Thee exists a lage body of wok on feedback loops to contol systems. In paticula, autonomic computing has achieved esults by applying concepts of contol theoy to untime paamete adaptation of softwae systems [Koka et al. 1999; Hellestein et al. 2004]. Howeve, self-adaptation oftentimes consides dynamic softwae achitectues in addition to paametes [McKinley et al. 2004], which pevents a diect application of contol theoy concepts and equies new means fo engineeing adaptation engines. A popula way to enginee self-adaptive softwae ae famewok-based appoaches that use some fom of models (cf. [Salehie and Tahvildai 2009]). Fo example, famewoks employ models to specify selfadaptive softwae including the adaptation as mappings of assetions to adaptation actions [Schmidt et al. 2008] o as tansitions between configuations of the adaptable softwae [Bencomo and Blai 2009]. These models ae used fo geneating patial code fo adaptation engines to simplify thei development. The stuctue of the esulting engines suppoting single feedback loops ae static and pe-defined by these famewoks. Moeove, the ceated models do not make the feedback loop explicit and they ae not kept alive at untime, fo example, to execute and dynamically adjust the adaptation engine. In contast, famewoks like Rainbow [Galan et al. 2004], MADAM [Floch et al. 2006], MUSIC [Rouvoy et al. 2009], DiVA [Moin et al. 2008, 2009a,b], o GRAF [Amoui et al. 2012] maintain untime models that specify the adaptation and captue the knowledge used by the feedback loops. These models can be modified at untime by enginees, especially to eplace adaptation stategies to adjust the adaptation logic. Howeve, suppot fo dynamically adjusting a feedback loop is limited since these famewoks suppot only single feedback loops, whose stuctuing of adaptation activities cannot be adjusted at untime in contast to specific models, like adaptation stategies, consumed by the activities. Additionally, the untime models do not explicitly specify complete feedback loops because each of these famewoks pescibe a single feedback loop and just offes customization points, like to inject adaptation stategies. This is motivated by thei focus to educe development effots fo adaptation
15 1.1 State-of-the-At in Engineeing Adaptation Engines 3 engines at the expense of limited flexibility. Thus, when developing a specific self-adaptive softwae, these famewoks do not suppot feedback loops that ae entiely and individually designed by enginees fo the specific case. All the appoaches discussed so fa suppot adaptation engines with single feedback loops and do not addess multiple, inteacting feedback loops. Kephat et al.  conside inteactions between two feedback loops that manage competing concens (enegy consumption vs. pefomance). Fo this specific case, they popose a coodination solution based on utility functions that has been established though tial and eo [Kephat et al. 2007, p.24]. In contast, a geneic synchonization potocol fo multiple feedback loops is pesented by de Oliveia et al. , which suppots mutual exclusive access to knowledge and the asynchonous tiggeing among feedback loops. Howeve, the potocol is esticted since a feedback loop may only tigge anothe loop fom the execute activity but not fom the monito, analyze, o plan activities. Thus, diectly coodinating, e.g., the analysis activities of multiple feedback loops is not suppoted. In [Gueye et al. 2012], the coodination between multiple feedback loops is ealized by a distinct contolle that decides which feedback loop may exclusively pefom an adaptation based on the states of the othe loops. This decision is exactly specified by automata models descibing the states of the feedback loops and by a coodination policy, which ae used fo geneating the contolle. Howeve, these models do not specify the feedback loops and thei coodination at the achitectual level of self-adaptive softwae. Othe appoaches addessing multiple feedback loops ae implementation famewoks that aim at educing development effots without pescibing a specific solution fo the inteaction o coodination. Vomant et al.  povide eusable components that suppot the distibuted communication among multiple feedback loops o adaptation activities. Cheng et al.  povide an abstaction laye between the adaptable softwae and multiple feedback loops. Though this laye, all feedback loops have consistent access and knowledge about the adaptable softwae. Fo a case study, they apply a specific coodination solution fo two feedback loops ensuing that only one loop is active at any time. All of the appoaches discussed so fa, eithe addessing single o multiple feedback loops, eithe povide specific and pe-defined solutions o geneic implementation suppot, which esults in adaptation engines whose stuctue cannot be dynamically adapted at untime. Dynamically adapting feedback loops is addessed by appoaches adopting layeed achitectues, whee a highe-laye feedback loop adjusts the feedback loop at the laye below. In ou pevious wok on Mechatonic UML [Bumeste et al. 2004, 2008] fo the model-diven development of self-optimizing mechatonic systems, we extended UML to specify and geneate a hieachical self-adaptation scheme that addesses contol, had eal-time econfiguation, and soft eal-time planning by distinct feedback loops at diffeent layes [Hestemeye et al. 2004]. Howeve, the adaptation is defined befoe deployment and cannot be evolved though off-line adaptation at untime, among othes, since the models ae not kept alive at untime. Sykes et al.  and Heaven et al.  popose a thee-laye achitectue that distinguishes between component-based contol, achitectual (e)configuation, and high-level task (e)planning. Plans geneated by the highest laye ae executed by the middle laye that geneates new configuations fo the lowest laye. Howeve, the cuent solution focuses on synthesizing initial plans befoe the system is stated, but it does not suppot task eplanning at untime. Thus, the highestlaye feedback loop adapting the middle laye has not been ealized. In contast, PLASMA [Tajalli et al. 2010] suppots eplanning and adapting the middle laye in a simila, layeed achitectue. Howeve, the extent of this adaptation is not clea since the achitectue of the middle laye is pe-defined by enginees. Moeove, the focus of PLASMA is to povide a famewok that automates the geneation and enactment of plans while the employed feedback loops, thei adaptation activities, and knowledge ae not explicitly modeled fo all layes. Finally, the numbe of layes (thee) and the numbe of feedback loops fo each laye (one) seem to be immutable in these appoaches [Sykes et al. 2008; Heaven et al. 2009; Tajalli et al. 2010]. Thus, multiple feedback loops fo a laye, o (dynamically) changing the numbe of layes and feedback loops ae not suppoted.
16 4 1 Intoduction Changing the numbe of layes and feedback loops can be seen as an extensive adaptation evolving the self-adaptive softwae. Besides adapting itself, self-adaptive softwae has to be open fo off-line adaptation by means of maintenance and evolution [Andesson et al. 2013]. Gacek et al.  discuss the idea of having two intetwined feedback loops fo self-adaptation and off-line adaptation, but they do not pesent a solution ealizing this idea. As discussed above, famewoks utilizing untime models often suppot to change those models, e.g., to add o emove adaptation stategies at untime. In this context, though focusing on self-adaptation, Moin et al. [2009a] claim to suppot evolution as changes pefomed manually on untime models, which is not substantiated to an integated co-existence that popely executes those changes to the unning system. In this context, they popose an initial step in [Moin et al. 2009c]: an enginee changes models in the development envionment, while the same kind of models ae also used by the adaptation engine at untime. Assuming thee is no self-adaptation in pogess, these changes ae executed to the unning system only if the system fulfills constaints defined by the enginee. Howeve, changes that affect the stuctue of the adaptation engine s feedback loop, the numbe of feedback loops, o the numbe of layes ae not consideed. All appoaches discussed so fa do not make the feedback loops, thei adaptation activities and (untime) models, and thei inteactions o coodination explicit in the achitectual design of self-adaptive softwae. A few appoaches exist that addess the explicit modeling of feedback loops when designing self-adaptive softwae. In [Hebig et al. 2010], we poposed a UML pofile to make feedback loops and the inteplay of multiple feedback loops explicit in achitectual design and analysis using UML models. A feedback loop is modeled at the abstaction level of contolles, thus abstacting fom individual adaptation activities and untime models. In contast, Weyns et al.  pesent a fomal efeence model fo self-adaptive systems that suppots the desciption of feedback loops including adaptation activities and untime models used by the activities. The goal of the efeence model is to suppot the systematic engineeing of self-adaptive systems by poviding a means to fomally descibe and evaluate design altenatives ealy in the development pocess. The models ceated by both appoaches [Hebig et al. 2010; Weyns et al. 2012] ae used fo the achitectual design when developing self-adaptive softwae, but they ae not used at untime fo opeating o adapting the softwae. Summing up, state-of-the-at appoaches fo engineeing self-adaptive softwae aim at educing development effots by geneating adaptation engines o poviding eusable famewoks fo the engines. The esulting adaptation engines often consist of single feedback loops, whose stuctue is athe static and pe-defined by the famewoks. This limits thei adaptation eithe duing development, dynamically in layeed achitectues at untime, o though evolution (off-line adaptation). In geneal, thee exist only peliminay wok on layeed achitectues fo self-adaptive softwae and on the co-existence of selfadaptation and off-line adaptation. Moeove, appoaches poviding untime suppot fo self-adaptive softwae do not addess the explicit modeling of the feedback loops o thei adaptation activities and knowledge. Thus, even when multiple untime models ae used fo the knowledge within a feedback loop, these models and thei inteplay ae not explicitly addessed duing design and opeation of the self-adaptive softwae. State-of-the-at famewoks do not conside untime models, like untime megamodels, that descibe whole feedback loops and leveage the execution and adaptation of feedback loops. In contast, appoaches tackling the explicit modeling of feedback loops ae focused on the design of self-adaptive softwae and they do not povide any untime suppot that leveage those models at untime fo executing o adjusting the softwae. Thus, state-of-the-at appoaches do not simultaneously suppot all the coe equiements fo engineeing adaptation engines as peviously outlined. 1.2 Appoach: EUREMA ExecUtable RuntimE MegAmodels Fo self-adaptive softwae that is diven by untime models, we poposed in [Vogel et al. 2011] the geneic idea to utilize untime megamodels that have untime models as thei elements and that
17 1.3 Contibution 5 descibe the pocessing of these models by adaptation activities as model opeations. 1 In this aticle, we go one step futhe and pesent a complete MDE appoach called ExecUtable RuntimE MegAmodels (EUREMA) that enables the specification and execution of complex adaptation engines fo self-adaptive softwae diectly suppoting feedback loops and untime models. The EUREMA language consideably eases the development of adaptation engines by suppoting a domain-specific modeling solution and the EUREMA untime intepete suppots the execution of the adaptation engines, in paticula the feedback loops. Moeove, EUREMA explicitly maintains the diffeent untime models, the inteplay between these models, and the model opeations pefoming adaptation activities and woking on these models. Thus, the maintenance of untime models and model opeations continues beyond the initial development-time of the softwae. The poposed EUREMA modeling language is specific fo the development of adaptation engines fo self-adaptive softwae and is based on geneal modeling concepts fo stuctual and behavioal diagams. Theefoe, EUREMA suppots two types of diagams to specify and descibe adaptation engines: A behavioal feedback loop diagam (FLD) is used to model a complete feedback loop o individual adaptation activities and untime models of a feedback loop. An FLD is consideed as a megamodel module that encapsulates the details of a feedback loop o adaptation activities. A stuctual laye diagam (LD) descibes how the diffeent megamodel modules and the adaptable softwae ae elated to each othe in a concete situation of the self-adaptive softwae. Thus, an LD povides an abstact and complete view of an instance of the self-adaptive softwae by eflecting its achitectue. This achitectual view consides feedback loops as black boxes encapsulated in megamodel modules, while white-box views on megamodel modules ae povided by FLDs. Thus, EUREMA models specify feedback loops and thei stuctuing in adaptation engines. Theeby, the models make the feedback loops explicit in the achitectual design of the self-adaptive softwae and they ae kept alive at untime and executed by an intepete, which suppots the design and the execution of adaptation engines. 1.3 Contibution This aticle discusses the EUREMA appoach with the following majo contibutions: (a) we thooughly discuss equiements fo adaptation engines and feedback loops diven by untime models, which has influenced the design of the EUREMA language, (b) using the EUREMA language, feedback loops ae explicitly specified at a highe level of abstaction by captuing the inteplay of adaptation activities and untime models as well as the inteactions between multiple feedback loops, (c) the knowledge used within a feedback loop is efined to multiple untime models that ae captued by EUREMA models, (d) EUREMA models specifying feedback loops ae kept alive at untime, which leveages layeed achitectues fo dynamically adjusting the feedback loops, (e) the co-existence of self-adaptation with off-line adaptation is intoduced to suppot evolution of the self-adaptive softwae by dynamic layes, and (f) we evaluated EUREMA by discussing how EUREMA addesses the equiements, by modeling thee appoaches to self-adaptive softwae fom the liteatue, and by quantifying the untime pefomance of the intepete fo EUREMA models. This aticle is a evised and extended vesion of [Vogel and Giese 2012a] that intoduced the basic concepts of the EUREMA language and theefoe initially addessed the contibutions (b), (c), and (d). In contast, this aticle efines these contibutions by extending the language with tigges fo feedback loops and with laye diagams (LDs) poviding achitectual views of the self-adaptive softwae. Finally, 1 In the eseach field of MDE and in paticula of model management fo model-diven softwae development, a megamodel efes to a model that has models as its elements and that captues the elationships between the contained models by means of model opeations, like model tansfomations (cf. [Babeo et al. 2007; Bézivin et al. 2003, 2004; Fave 2005]).
18 6 1 Intoduction this aticle pesents the novel contibutions (a), (e), and (f) that have not been discussed in the initial pape. In contast to the state-of-the-at in engineeing self-adaptive softwae, we popose a seamless modeldiven engineeing appoach. The modeling language suppots the design as well as the execution of feedback loops in adaptation engines. Theeby, EUREMA impoves the state-of-the-at concening famewoks because it does not pescibe any stuctue of the adaptation activities o feedback loops and it does not limit the numbe of feedback loops o layes in layeed achitectues. In contast to existing modeling languages fo self-adaptive softwae, EUREMA povides impovements by keeping the models alive at untime fo executing and adjusting feedback loops eithe dynamically o by off-line adaptation. 1.4 Outline The est of the aticle is stuctued as follows. The next section discusses in detail the teminology, the basic concepts, and the coe equiements fo self-adaptive softwae. Then, we intoduce the basic EUREMA concepts fo modeling single and multiple feedback loops in Sections 3 and 4, espectively. These concepts ae efined fo layeed achitectues of adaptation engines in Section 5 and fo the coexistence of self-adaptation and off-line adaptation in Section 6. We discuss the execution of EUREMA models in Section 7 and evaluate EUREMA in Section 8. Finally, the aticle concludes and outlines futue wok.
19 Chapte 2 Teminology, Concepts, and Requiements In this section, we claify teminology, intoduce elevant coe concepts of self-adaptive softwae, and efine the coe equiements fo engineeing self-adaptive softwae as outlined in the intoduction (Section 1). The extenal (achitectual) appoach is typically adopted in self-adaptive softwae [Salehie and Tahvildai 2009]. Thus, this aticle consides this appoach as depicted in Figue 2.1. It assumes a basic achitectue that splits the self-adaptive softwae into the adaptation engine and the adaptable softwae while the fome one contols (sensing and effecting) the latte one. The adaptable softwae ealizes the domain logic, and the adaptation engine implements the adaptation logic as a feedback loop, which constitutes self-adaptation. Self-Adaptive Softwae Adaptation Engine (Adaptation Logic) Sensing Effecting Adaptable Softwae (Domain Logic) Fig. 2.1: Extenal appoach Adaptation Engine Analyze Plan Knowledge Monito Execute Sensos Effectos Adaptable Softwae Fig. 2.2: MAPE-K Thus, the engineeing of adaptation engines and feedback loops is essential fo the extenal appoach to self-adaptive softwae. This equies a modeling language to design and specify adaptation engines and elated techniques to suppot the implementation and execution. In the following, we efine the geneal equiements fo self-adaptive softwae as discussed in the intoduction (Section 1) fo the paticula case of a modeling language fo specifying, implementing, and executing adaptation engines. Theefoe, we will discuss equiements with espect to feedback loops and thei explicit specification, untime models used as the knowledge within feedback loops, sensos and effectos, layeed achitectues fo adaptation engines, and the co-existence of off-line adaptation and self-adaptation. 7
20 8 2 Teminology, Concepts, and Requiements 2.1 Feedback Loops The sepaation between the adaptation engine and the adaptable softwae makes the feedback loop between the adaptable softwae and the adaptation engine a cucial element of the oveall achitectue, which has to be made explicit in the design and analysis of self-adaptive softwae (cf. [Shaw 1995; Koka et al. 1999; Hellestein et al. 2004; Mülle et al. 2008; Bun et al. 2009]). Thus, feedback loops have to be explicitly modeled. A moe detailed view of the extenal appoach and the feedback loop between the adaptable softwae and the adaptation engine is povided by the MAPE-K cycle (Monito/Analyze/Plan/Execute- Knowledge) as poposed by Kephat and Chess  and depicted in Figue 2.2. The adaptation engine (called Autonomic Manage in [Kephat and Chess 2003]) is efined to fou adaptation activities shaing a common knowledge base. The adaptable softwae (called Managed System in [Kephat and Chess 2003]) is monitoed and analyzed, and if changes ae equied, adaptation is planned and executed to this softwae. As sketched in Figue 2.2, the modeling language should suppot the specification of adaptation activities that fom a feedback loop. This includes the coodination of activities within one feedback loop, which is called inta-loop coodination by Vomant et al. , by means of the contol flow fo these activities. By explicitly specifying adaptation activities, the contol flow makes the odeing and dependencies between individual activities explicit and it enables the well-defined coodination and execution of a whole feedback loop. Moeove, it has to be specified when a feedback loop should be executed, i.e., the language should captue tiggeing conditions fo initiating the execution of feedback loops. Examples ae time o event-based tigges as well as combinations of them. Additionally, even multiple feedback loops might have to be consideed [Kephat and Chess 2003; Bazie et al. 2009; Weyns et al. 2012]. On the one hand, the adaptation engine may not necessaily employ only a single feedback loop but athe multiple of them in paallel to handle diffeent concens such as self-epai o self-optimization [Kephat et al. 2007; Vogel et al. 2009, 2010; Vogel and Giese 2010; Fey et al. 2012], to distinguish between localized and global adaptation [Cheng et al. 2004; de Oliveia et al. 2012; Gueye et al. 2012], o to decentalize contol in geneal [Vomant et al. 2011; Weyns et al. 2013]. The language should theefoe suppot the modeling of multiple, inteacting, and potentially distibuted feedback loops and thei coodination. Thus, as sketched in Figue 2.3, besides modeling multiple feedback loops also means fo inte-loop coodination (cf. [Vomant et al. 2011]) and distibution ae equied. Analyze Plan Analyze Plan Knowledge Knowledge Monito Execute Monito Execute Adaptable Softwae Fig. 2.3: Multiple feedback loops and inte-loop coodination Futhemoe, besides specifying feedback loops, the language should suppot the execution of feedback loops based on the specifications. This includes concuency to simultaneously execute multiple feedback loops o the incemental execution of adaptation activities within a feedback loop. Moeove, the language suppot fo execution also has to cove the othe cases, like eflection, that ae discussed late.