2012 19th Asia-Pacific Software Engineering Conference
A Problem Oriented Approach to Modeling Feedback Loops for Self-Adaptive Software Systems Chun Liu1, Wei Zhang2, 3, Haiyan Zhao2, 3, Zhi Jin2, 3
1
2
School of Computer and Information Engineering, Henan University, Kaifeng, China Key Laboratory of High Confidence Software Technologies (Peking University), MoE, Beijing, China 3 Institute of Software, School of EECS, Peking University, Beijing, China
[email protected],
[email protected],
[email protected],
[email protected] However, although feedback loops have received considerable attentions, most of efforts are concentrated on the architecture design to realize them. How to model the feedback loops at requirements-level, i.e., how to derive the adaptive requirements behind each feedback loop, is still an issue. By adaptive requirements, we mean such requirements about what to be monitored, what to be adjusted, and what adaptations to be adopted. Although Souza et al. in [9, 10] have presented the awareness requirements which they though as the requirements behind the feedback loops, such information about what to be monitored and what adaptations to be adopted still can’t be modeled in their approach. In this paper, we present a problem oriented approach to model the feedback loops for self-adaptive software systems. We model the system composed by the self-adaptive software and its context explicitly as an adaptive control system from the Cybernetics based view. The system goal is to make true the set of desired domain phenomena at presence of potential context uncertainties. To achieve this goal, such control systems will be equipped with two kinds of feedback loops: the context-aware feedback loops, and the requirements-aware feedback loops. The former is responsible for detecting and responding to the context changes. The latter, supplementing the former, focuses on detecting and responding to the requirements divergence in case that some unknown context changes occur. To represent the adaptive requirements behind the above two kinds of feedback loops, we adopt the way of the problem oriented approach. Specially, we identify five classes of software problems to address the different concerns of the adaptive requirements. The feedback loops can be modeled by composing these classes of problems. The rest of this paper is structured as follows. Section 2 briefly introduces the background knowledge about the software problems and the adaptive control systems. Section 3 presents the proposed approach. Section 4 illustrates the proposed approach through a cruise control system. Finally, the related work and the conclusion are given in the last two sections respectively.
Abstract—Self-adaptive software systems can adjust their behaviors at runtime to respond to the context changes. To operationalize the adaptive mechanism, feedback loops have been advocated in many works. However, most of existing works focus on the architecture design to realize the feedback loops. How to model the required feedback loops remains an issue. In this paper, we propose a problem oriented approach for this issue. This approach models the system composed by the self-adaptive software and its context as an adaptive control system which is equipped with two kinds of feedback loops: context-aware feedback loops and requirements-aware feedback loops. To model the feedback loops, we identify five classes of software problems to address the different concerns of the adaptive requirements behind the feedback loops. We illustrate our idea by applying it to a cruise control system. Keywords-self-adaptive software; software requirements; feedback loop; context-aware; requirements-aware;
I.
INTRODUCTION
According to problem oriented approach [1, 2], a software problem consists of three elements: users’ requirements, problem context, and software system. The problem context is the part of the real world which consists of a set of domains. The users’ requirements express a set of domain phenomena which the users wish to make true by installing a software system. The software system is the solution domain to be designed for the problem. Traditionally, when designing the software system, developers often assume that the problem context is reasonably static and make efforts to determine all decisions for software based on the knowledge on the problem context. However, with the software deeply embedded into the society (e.g., the remote patient care systems, and the intelligent transportation systems), the problem context is seldom static; sufficient knowledge on it is also difficult to obtain. For example, we can’t know exactly when the blood pressure of the patient will elevate. The satisfaction of users’ requirements in this case will be subject to the potential context uncertainties. To tackle the potential context uncertainties, there are growing interests in the self-adaptive software systems which can adjust behaviors at runtime. In general, such systems are required to possess the capabilities of monitoring the problem context and making decisions at runtime. Following that, the monitor-analyze-plan-execute (MAPE) feedback loops have attracted many attentions since they provide general mechanism to operationalize selfadaptability [3-8]. 1530-1362/12 $26.00 © 2012 IEEE DOI 10.1109/APSEC.2012.77
II. A.
SOFTWARE PROBLEMS AND ADAPTIVE CONTROL SYSTEMS
Software problems A software problem refers to a problem which has a software solution [1, 2]. Each software problem ! can be represented as follows: 440
!"###$% ' (
In practice, the controller is designed based on the model of the controlled object. However, it is difficult sometimes to obtain the exact model of the controlled object. To deal with that, adaptive control systems are introduced, which can identify the controlled object’s model and adjust the controller’s control laws accordingly at runtime. Fig.3 shows the architecture of the classical model identification adaptive control (MIAC) systems [3,12]. Different from the systems in Fig.2, an additional kind of feedback loops is introduced in the adaptive control systems to adjust the control laws of the controller online. The system identification component infers the model of the controlled object at runtime, and provides the identified parameters of the controlled object to the adapter which then adjusts the controller accordingly by setting the controller’s parameters.
(1)#
! $ represents the problem context which consists of a set of domains ($ ) *+, % +- % . /). ! ( represents the users’ requirements. ! & represents the software system. ! ! here represents the entailment relationship between $% &% (, which means that once the software solution & is installed into $ , the users’ requirements ( will be met. The software problem can be described in any language. Usually, the problem diagram [1] shown in Fig.1 is used to represent a software problem. To control the analysis complexity and take full use of the existing solutions for some general problems, the problem decomposition and composition techniques are often adopted during the software problem analysis [1, 2].
Figure 3. The architecture of the model identification adaptive control system
III.
MODELING FEEDBACK LOOPS: THE PROBLEM ORIENTED APPROACH
In this section, we first present the Cybernetics based view on the self-adaptive software systems, and then detail the proposed problem oriented approach.
Figure 1. The problem diagram of the cruise control system under an ideal condition
B. Adaptive control systems According to Cybernetics, a control system comprises at least two parts: the controlled object and the controller [11] (see in Fig.2). The system goal is to maintain the specified properties of the output of the controlled object at or sufficiently close to the reference input.
A.
The Cybernetics based view on Self-adaptive software systems Based on Cybernetics, this paper models the system composed by the self-adaptive software system and its context as an adaptive control system (see in Fig.4).
Figure 2. The simplified architecture of the closed loop control system
Fig.2 shows the architecture of the closed loop control systems. These systems are characterized by the feedback loops through which the measured output of the controlled object (i.e., controlled variables) is fed back to the controller continuously. At runtime, the controller is error-driven, i.e., it adjusts the manipulated variables according to the size of the difference between the controlled variables and the reference input. Based on the feedback loops, the closed loop control systems can respond to the effects of the potential disturbances at runtime.
Figure 4. The adaptive control system composed by the self-adaptive software system and its context
In such an adaptive control system, the context is the controlled object. The users’ requirements take the role of the reference input; the set of desired domain phenomena referred by users’ requirements is the output. The system goal is to make true the set of desired domain phenomena.
441
requirements. Given the different values of the context variables, the different combinations of them will feature the different context variants. Step 2: define the context and requirements monitoring problems. While the context is characterized by the context variables, we assume that the users’ requirements are also characterized by a set of requirements variables*21, % 21- % . /, and the divergence can be derived from the values of them. Since the users’ requirements express the desired domain phenomena, the requirement variables, similar with the context variables, also mean the domain phenomena. Sometimes, a requirements variable is also a context variable. Given that, the context and requirements monitoring problems are defined by considering how to monitor each context variable and each requirements variable. Step 3: define the requirements adapting problems. The requirements adapting problems can be defined by considering how to computing the requirements divergence. Step 4: define the basic functional problems. Since the basic functional system is requirements-divergence-driven, this class of problems can be defined by considering what the software should do given the requirements divergence under each context variant. Step 5: define the context adapting problems. This class of problems can be defined by considering how to switch the different basic functional solutions defined in the basic functional problems when the context changes. A context adapting problem is usually the composition of the basic functional problems and the context monitoring problems.
Particularly, the self-adaptive software system in such an adaptive control system now is composed by five conceptual components: basic functional system, context monitor, context adapter, requirements monitor, and requirements adapter. The basic functional system realizes the adjustable functional behaviors, and is requirements-divergence-driven. The context monitor monitors the context and provides the contextual characteristics to the context adapter. The context adapter detects the potential context changes and adjusts the basic functional system. The requirements monitor monitors the desired domain phenomena and provides the state information about them. The requirements adapter computes the requirements divergence. Seen in Fig.4, there are two kinds of feedback loops in such adaptive control systems: context-aware feedback loop and requirements-aware feedback loop. While the former is to detect the context changes and adjust the software behaviors accordingly, the latter is to detect the requirements divergence and adjust the software behaviors accordingly. B.
The problem oriented approach To model the feedback loops shown in Fig.4, we identify the following five classes of software problems: ! Context monitoring problems: A context monitoring problem is characterized by a solution which is to monitor the context. This class of problems addresses what to be monitored about the context. ! Requirements monitoring problems: A requirements monitoring problem is characterized by a solution which is to monitor whether the users’ requirements are met. This class of problems addresses what to be monitored about the users’ requirements. ! Requirements adapting problems: A requirements adapting problem is characterized by a solution which is to detect the requirements divergence. ! Basic functional problems: A basic functional problem is characterized by a solution to meet the users’ requirements under a specific context variant. The composition of this class of problems and the requirements adapting problems addresses how to adapt to the requirements divergence. ! Context adapting problems: A context adapting problem is characterized by a solution which is to adjust software behaviors when the context changes. The composition of this class of problems and the basic functional problems addresses how to respond to the context changes.
IV.
A CASE STUDY
In this section, we take the cruise control system [13] as an example to illustrate the proposed approach. A.
The cruise control system The problem of a cruise control system can be sketched as follows˖Through the cruise control system, the driver can set the desired speed of the vehicle to maintain. And given the specified cruise speed, the vehicle is desired to maintain this speed automatically in a safe manner. If we don’t consider the potential context uncertainties, the problem diagram of this problem can be seen in Fig.1, in which the domains involved in the problem context are shown. There are two users’ requirements: R1: set cruise speed and R2: maintain cruise speed in a safe manner. The cruise control system can meet R1 by receiving the on/off signals from the increase/decrease buttons, setting the value of the cruise speed and sending it to the display. Given the cruise speed, the cruise control system sets the engine’s throttle to affect the driving forces on the vehicle’s wheel, and then R2 is also met. However, it is not the case in practice. For example, the road conditions may vary and the same driving forces may have different effects on the speed of the vehicle under control. Since the satisfaction of R2 is more vulnerable to the context uncertainties than that of R1, this case study focuses on R2, and models the required feedback loops to maintain the satisfaction of R2. So, in the following, the users’ requirements R will only mean R2.
For a self-adaptive software system, the modeling of the required feedback loops is just to define these software problems and compose them. To carry out this task, we propose the following process: Step 1: determine the context and the context variants. To determine the context variants, we assume that the problem context is characterized by a set of independent context variables*01, % 01- % . /whose different values will determine the set of context variants*$, % $- % . /. By context variable, we mean a domain phenomenon that might change during system operations. And, its changes will require the changes of the system behaviors in order to meet the users’
442
K:
B.
Step 1: determine the context and the context variants The context has been shown in Fig.1. To determine the context variants, we identify the context variables shown in Table I in this case study. TABLE I.
where $IJLMNO ) *PH2QA2>#1