A apresentação está carregando. Por favor, espere

A apresentação está carregando. Por favor, espere

Software Engineering for Self-Adaptive Systems. Self-Adaptation The complexity of current software-based systems has led the software engineering community.

Apresentações semelhantes


Apresentação em tema: "Software Engineering for Self-Adaptive Systems. Self-Adaptation The complexity of current software-based systems has led the software engineering community."— Transcrição da apresentação:

1 Software Engineering for Self-Adaptive Systems

2 Self-Adaptation The complexity of current software-based systems has led the software engineering community to look for inspiration in diverse related fields (e.g., robotics, artificial intelligence) as well as other areas (e.g., biology) to find new ways of designing and managing systems and services. Self-adaptation –Has become one of the most promising directions. –The capability of the system to adjust its behaviour in response to its perception of the environment. 16/12/20142 Carlos J. P. Lucena © LES/PUC-Rio

3 The Development of Self-adaptive Systems The development of self-adaptive systems can be viewed from two perspectives: top-down when considering an individual system –assess their own behaviour and change it when the assessment indicates a need to adapt due to evolving functional or non- functional requirements bottom-up when considering cooperative systems –The global behaviour of the system emerges from these local interactions. 16/12/20143 Carlos J. P. Lucena © LES/PUC-Rio

4 16/12/20144 Carlos J. P. Lucena © LES/PUC-Rio The Study of Self-Adaptive Systems The topic of self-adaptive systems has been studied within the diferent research areas of software engineering, including, requirements engineering, software architectures, middleware, component-based development, and programming languages (most of these initiatives have been isolated). Other research communities that have also investigated this topic from their own perspective are even more diverse: fault-tolerant computing, biologically inspired computing, multi-agent systems, (distributed artificial intelligence) and robotics, among others.

5 16/12/20145 Carlos J. P. Lucena © LES/PUC-Rio Roadmap Requirements –state of the art –research challenges Engineering –state of the art –research challenges

6 16/12/20146 Carlos J. P. Lucena © LES/PUC-Rio Requirements – State of the Art 1 Requirements engineering is concerned with what a system ought to do and within which constraints it must do it. Requirements engineering for self-adaptive systems, therefore, must address what adaptations are possible and what constrains how those adaptations are carried out.

7 16/12/20147 Carlos J. P. Lucena © LES/PUC-Rio Requirements – State of the Art 2 In particular, questions to be addressed include: What aspects of the environment are relevant for adaptation? Which requirements are allowed to vary or evolve at runtime and which must always be maintained? One of the main challenges that self-adaptation poses is that when designing a self-adaptive system, we cannot assume that all adaptations are known in advance

8 16/12/20148 Carlos J. P. Lucena © LES/PUC-Rio Requirements – State of the Art 3 Requirements engineering for self-adaptive systems must deal with uncertainty because the expectations on the environment frequently vary over time. For example, if a system is to respond to cyber- attacks, one cannot possibly know all attacks in advance since malicious actors develop new attack types all the time.

9 16/12/20149 Carlos J. P. Lucena © LES/PUC-Rio Requirements – State of the Art 4 As a result, requirements for self-adaptive systems may involve degrees of uncertainty or may necessarily be specified as “incomplete". The requirements specification therefore should cope with: –the incomplete information about the environment and the resulting incomplete information about the respective behaviour that the system should expose –the evolution of the requirements at runtime

10 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Requirements – Challenges 1 A New Requirements Language Traditionally, requirements documents make statements such as “the system shall do this". For self-adaptive systems, the prescriptive notion of “shall" needs to be relaxed and could, for example, be replaced with “the system may do this or it may do that" or “if the system cannot do this, then it should eventually do that." This idea leads to a new requirements vocabulary for self- adaptive systems that gives stakeholders the flexibility to account for uncertainty in their requirements documents.

11 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Requirements – Challenges 3 Mapping to Architecture Given a new requirements language that explicitly handles uncertainty, it will be necessary to provide systematic methods for refining models in this language down to specific architectures that support runtime adaptation. One can imagine, therefore, a semi-automated process for mapping to architecture where heuristics and/or patterns are used to suggest architectural units corresponding to certain vocabulary terms in the requirements.

12 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Requirements – Challenges 4 Managing Uncertainty In general, once we start introducing uncertainty into our software engineering processes, we must have a way of managing this uncertainty and the inevitable complexity associated with handling so many unknowns. Certain requirements will not change (i.e., invariants), whereas others will permit a degree of flexibility. –For example, a system cannot start out as a transport robot and self- adapt into a robot chef! Allowing uncertainty levels when developing self-adaptive systems requires a trade of between flexibility and assurance such that the critical high-level goals of the application are always met.

13 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Requirements – Challenges 6 Online Goal Refinement As in the case of design decisions that are eventually realized at runtime, new and more flexible requirement specifications would imply that the system should perform the RE processes at runtime, e.g. goal-refinement Traceability from Requirements to Implementation New operators of a new RE specification language should be easily traceable down to architecture, design, and beyond. Furthermore, if the RE process is performed at runtime we need to assure that the final implementation or behaviour of the system matches the requirements.

14 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Roadmap Requirements –state of the art –research challenges Engineering –state of the art –research challenges

15 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Engineering: State of the Art & Feedback Loops Preliminary consideration Any attempt to automate self-adaptive systems necessarily has to consider feed-back loops. We focus on the feed-back loop - a concept that is elevated to a first-class entity in control engineering - when engineering self-adaptive software systems. Commonalities of self-adaptive systems What self-adaptive systems have in common is that design decisions are moved towards runtime and that the system reasons about its state and environment. The reasoning typically involves feedback processes with four key activities: collect, analyze, decide, and act

16 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Figure 1: Activities of the control loop.

17 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Example For example, keeping web services up and running for a long time requires: –collecting of information that reflects the current state of the system, –analysis of that information to diagnose performance problems or to detect failures, deciding how to resolve the problem (e.g., via dynamic load-balancing or healing), –and acting to effect the made decision.

18 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Engineering: Generic Control Loop 1 When engineering a self-adaptive system, questions about these properties become important. The feedback cycle starts with the collection of relevant data from environmental sensors and other sources that reflect the current state of the system. Some of the engineering questions that need be answered are: How reliable is the sensor data?

19 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Engineering: Generic Control Loop 2 Next, the system analyzes the collected data. There are many approaches to structuring and reasoning about the raw data (e.g., using applicable models, theories, and rules). Some of the applicable questions here are: How is the current state of the system inferred? How much past state may be needed in the future? What data need to be archived for validation and verification?

20 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Engineering: Generic Control Loop 3 Next, a decision must be made about how to adapt the system in order to reach a desirable state. Approaches such as risk analysis can help to make a decision among various alternatives. Here, the important questions are: How is the future state of the system inferred? How is a decision reached (e.g., with off-line simulation or utility/goal functions)?

21 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Engineering: Generic Control Loop 4 Finally, to implement the decision, the system must act via available actuators and effectors. Important questions here are: When should and can the adaptation be safely performed? How do adjustments of different feedback loops interfere with each other? Do centralized or decentralized control help achieve the global goal? The above questions - and many others – regarding the control loop should be explicitly identified, recorded, and resolved during the development of the self-adaptive system.

22 16/12/ Carlos J. P. Lucena © LES/PUC-Rio Autonomic Computing Autonomic computing seeks to improve computing systems with a similar aim of decreasing human involvement. The term “autonomic” comes from biology. –In the human body, the autonomic nervous system takes care of unconscious reflexes, that is, bodily functions that do not require our attention The term autonomic computing was first used by IBM in 2001 to describe computing systems that are said to be self-managing.

23 Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio Autonomic Computing Autonomic computing aims at providing systems with self-management capabilities –self-configuration (automatic configuration according to a specified policy) –self-optimization (continuous performance monitoring) –self-healing (detecting defects and failures, and taking corrective actions) –self-protection (taking preventive measures and defending against malicious attacks)

24 Baldoíno Fonseca Neta JAAF-* UC-Rio 24

25 JAAF JAAF-S é um framework que basea-se na experiência adquirida durante o desenvolvimento do seu antecessor (JAAF 1.0) a fim de fornecer suporte ao desenvolvimento de agentes auto-adaptativos orientados a serviços. A principal diferença entre o JAAF-S e o JAAF 1.0 esta na adição de um conjunto de mecanismos para: –Monitoramento; –Descoberta; –Seleção; –Disponibilização de serviços em tempo de execução. UC-Rio 25

26 JAAF 1.0 Fornece mecanismos reutilizáveis para o desenvolvimento de agentes auto-adaptativos como uma extensão do JADE; Arquitetura baseada em Control-loop –Collect –Analyze –Decision –Effector UC-Rio 26

27 JAAF 1.0: Hot-spots e Frozen-spots UC-Rio 27 Agente (classe AdaptationAgent) Planos de Auto-Adaptação (classe AdaptationControlLoop) Atividades (classe Behaviour) Mecanismos de Raciocínio (interface IReasoningStrategy)

28 JAAF 1.0: Diagrama de Classes UC-Rio 28

29 JAAF-S UC-Rio 29 É uma evolução do framework JAAF 1.0; Fornece mecanismos para o desenvolvimento de agentes capazes de realizar as seguintes tarefas relacionadas a Web Service (WS): –Monitoramento; –Detecção de falhas provenientes da sua execução; –Descoberta de novos serviços WS capazes de solucionar tais falhas; –Seleção do melhor dentre os vários descobertos; –Notificações e configurações necessárias para disponibilização do WS selecionado.

30 JAAF-S: Control-loop UC-Rio 30 Collect –Utiliza tecnologias para monitoramento de eventos e WS. Estrutura tais informações de forma que elas possam ser entendidas pelas atividades seguintes; Analyze –Collect e utiliza um conjunto de mecanismos de raciocínio para detecção de problemas e descoberta de novos WS. Decision –Seleciona serviço que melhor solucione os problemas que levaram à necessidade da auto-adaptação; Effector –Realiza as notificações e configurações necessárias para disponibilização do serviço selecionado pela atividade Decision.

31 JAAF-S: Diagrama de Classes UC-Rio 31

32 JAAF-S: Diagrama de Classes UC-Rio 32

33 JAAF-S: Analyze UC-Rio 33

34 JAAF-S: Analyze UC-Rio 34 Raciocínio Baseado em Regras (RBR) –Considere que a atividade Collect esteja monitorando um determinado serviço e as seguintes informações são coletadas: (i) Número de falhas ocorridas durante a sua execução (representada pela variável serviceFailure); (ii) tempo de resposta (representada pela variável responseTime); (iii) autenticações realizadas com sucesso (representada pela variável authenticationErro).

35 JAAF-S: Analyze UC-Rio 35 Raciocínio Baseado em Regras (RBR) R1: If serviceFailure > 0 Then Problem = “serviceFailure” R2: If Problem!=“serviceFailure” AND responseTime > 10 Then Problem = “highResponseTime” R3: If Problem!=“serviceFailure” AND authenticationErro == true Then Problem = “highResponseTime”

36 JAAF-S: Analyze UC-Rio 36 Raciocínio Baseado em Casos (RBC) –Similaridade entre Objetos O objetivo deste mecanismo é encontrar as experiências passadas mais similares com o problema atual. Para tanto, ele estende a API jColibri2, a fim de fazer uso dos algoritmo de similaridade local e global. Tais algoritmos são aplicados entre os dados coletados na atividade Collect, juntamente, com os problemas detectados a partir da aplicação do RBR, e o conjunto de casos (ou experiências passadas) recuperados a partir do banco de dados. –Similaridade entre OWL-S O objetivo do mecanismos em questão é verificar o nível de similaridade entre as soluções enviadas pelo mecanismo anteriormente descrito e um conjunto de Profiles descrevendo serviços atualmente on-line.

37 JAAF-S: Analyze UC-Rio 37 Similaridade entre Objetos

38 JAAF-S: Analyze UC-Rio 38 Similaridade entre Profiles

39 JAAF-S: Decision UC-Rio 39

40 JAAF-S: Decision UC-Rio 40 Função de Utilidade –Avalia e seleciona cada serviço levando em consideração diferentes dimensões de qualidade como tempo de resposta, custo, performance, segurança, escalabilidade, etc. –Exemplo: Serviço Pacote Viagem Nordeste Paraíso –Possui tempo de resposta (t) médio, segurança (s) excelente e escalabilidade (e) médio, com utilidade u t (médio) = 0.5, u s (excelente) = 1 e u e (médio) = 0.5, respectivamente. –Considerando que o tempo de resposta tem peso w t =0.2, segurança w s = 0.4 e escalabilidade w e = 0.4 a importância do serviço é calculada da seguinte forma: –0.2* * *0.5 = 0.7; Reputação –Basea-se na reputação dos serviços para realizar a seleção.

41 JAAF-S: Effector UC-Rio 41

42 JAAF-S: Frozen-spots UC-Rio 42 Um control-loop de auto-adaptação representado pela classe ControlLoop. Quatro atividades: Collect, Analyze, Decision e Effector. Um mecanismo para monitoramento de WS e outro para interceptação de eventos. Dois mecanismos de similaridade: –(i) Verifica similaridade entre objetos –(ii) Verifica similaridade entre ontologias OWL-S. Dois mecanismos de seleção : –(i) Função de Utilidade –(ii) Reputação; Três mecanismos relacionados a atividade Effector: –(i) realiza notificação de mudanças; –(ii) realiza as configurações necessárias para disponibilização de novos serviços –(iii) toma as ações necessárias para execução do serviço.

43 JAAF-S: Hot-spots UC-Rio 43 Planos de auto-adaptação (classe abstrata AdaptationConrolLoop) Atividades (classe abstrata Behaviour) Monitoramento (classe abstrata Monitor) Raciocínios (interface IReasoningStrategy) Técnicas para seleção de serviços (classe abstrata SelectionStrategy) Mecanismos para efetivação da solução (interface Iactuator)

44 Automated Support for Self-Adaptation in Multi-Agent Systems

45 Challenges on Support Self-Adaptation Adaptation policies prescribe a set of rules that guide the behavior of system components Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio Policy P1 { Condition { ! Component.isLoadHigh() } Decision { Component.helloWorld() } Policy P1 { Condition { ! Component.isLoadHigh() } Decision { Component.helloWorld() } Policy P2 { Condition { Component.isLoadHigh() } Decision { “Problem !!", "...") } Policy P2 { Condition { Component.isLoadHigh() } Decision { “Problem !!", "...") }

46 Challenges on Support Self-Adaptation Tight-coupling between application code and adaptation logic 1.Extensive effort to develop the adaptation action 1.Require significant development effort to explicitly model the numerous potential error states and recovery paths from an error state to a correct state Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio Policy P2 { Condition { Component.isLoadHigh() } Decision { !!", "...") } Policy P2 { Condition { Component.isLoadHigh() } Decision { !!", "...") }

47 Our Approach Feature model is the knowledge base that serves all steps of the control loop, instead of fixed adaptation polices Feature model defines all possible configurations of the underline system. Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio IDWNNPI Interpolation Spline VegetationSlopeRain Factors GeoRisc CC = {f} | f ∈ FM ∧ f = 1 ∧ CC ⊆ FM

48 Approach Overview When a reconfiguration need emerge, we consider it as an event e over a feature f ∈ FM, in a certain set of conditions C, the multi-agent system derive an adaptation action α. Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio e(f) ∧ C ⇒ α | α ∈ {α h,α o,α c,α p } α({Cp s },{Cp d }) e(f) ∧ C ⇒ α | α ∈ {α h,α o,α c,α p } α({Cp s },{Cp d })

49 Approach Overview Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio IDWNNPI Interpolation Spline VegetationSlopeRain Factors GeoRisc Event Adaptation Polices Feature Model Reconfiguration IDWNNPI Interpolation Spline VegetationSlopeRain Factors GeoRisc Feature Model Adaptation Inference Adaptation selection Structural Constraint Validation Derive a Adaptation Action System Reconfiguration Interpolation Agent Runtime system Architectural Models

50 Feature Model Operations RC takes an inconsistent feature model configuration ψ i and returns a set of valid feature model configuration ψ v. FL takes a feature model configuration ψ and a set of characteristic C as input and returns a set of valid feature model configuration ψ v that satisfies at the same time all feature model constraints and the set of characteristics. Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio RC(ψ i )={ψ v } FL(ψ,C) = {ψ v }

51 Feature Model Reconfiguration OT takes a set of objective functions O and a set of valid feature model configuration ψ c as input and returns a valid feature model configurations ψ o that better satisfies all object functions. Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio OT({ψ c },O) = ψ o

52 Deriving Adaptation Action The problem to find an adaptation action that reaches the requested adaptation is equivalent to find a valid reconfiguration of the feature model and compare it with the current configuration. Let DR denote a derivation operation Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio DR(ψ v,M a,M o,M c, CK) = {Cp} | Cp ⊆ M o

53 Deriving Adaptation Action Healing Optimization Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio α h (DR(RC(CC),Ma,Mo,Mc) – DR(CC,Ma,Mo,Mc), DR(CC,Ma,Mo,Mc) – DR(RC(CC),Ma,Mo,Mc)) α h (DR(RC(CC),Ma,Mo,Mc) – DR(CC,Ma,Mo,Mc), DR(CC,Ma,Mo,Mc) – DR(RC(CC),Ma,Mo,Mc)) α o (DR(OT({ψ c },O),Ma,Mo,Mc) – DR(CC,Ma,Mo,Mc), DR(CC,Ma,Mo,Mc) – DR(OT({ψ c },O),Ma,Mo,Mc)) α o (DR(OT({ψ c },O),Ma,Mo,Mc) – DR(CC,Ma,Mo,Mc), DR(CC,Ma,Mo,Mc) – DR(OT({ψ c },O),Ma,Mo,Mc))

54 Mapping Feature Model to CSP Based on Constraint Programming - Constraint Satisfaction Problem (CSP) –Set of variables –Set of constraints over those variables CSP for Feature Model –Set of variables F representing the features in the feature model –Each configuration is a set of values for these variables fi = 1 (Selected) or fi = 0 (Deselected) Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio

55 Mapping Feature Model to CSP Configuration rules –Set of constraints C associated with each variable f Optional Relation –f1  f Or-relation –f  f1 v f2 v … fn Alternative Relation –f  fi | i [1..n] ( f1  (¬ f2 ^…^¬ fn ^ f ))^( f2  (¬ f1 ^…^¬ fn ^ f ))^…^( fn  (¬ f1 ^…^¬ fn -1^ f )) Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio

56 Mapping Models to CSP CSP for Domain-specific Architecture Models –Set of variables A representing the element in the architecture model –Set of variables D representing the element in the domain-specific architecture model –Each configuration is a set of values for these variables di = 1 (Selected) or di = 0 (Deselected) ai = 1 (Selected) or ai = 0 (Deselected ) Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio

57 Mapping Architectural Models to CSP Configuration Rules –Set of constraints Cf for each variable d which have a feature expression associated Boolean Feature expression  di –Set of constraints Ca for each variable d which have architecture element associated di  ai Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio

58 Working Example - GeoRisc Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio Input Factors to be analyzed Step 1 Data Interpolation Step 2 Landslide risk prediction Output Landslide risk Vegeta tion SlopeRain Factors IDWNNPI Interpolation Spline Preserved Forest Degraded Forest Plantation Vegetati on Floodplain (...) scaleScale SM Generation Process Variabilidades

59 Configuration Knowledge Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio

60 Working Example I - Self-healing Georisc Input  Factors to be analyzed –Different data sources File Data Base Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio Slope Factors FileDataBase Rain FileDataBase Vegetation FileDataBase c:\\GeoRisco\\dados\\rain.shp jdbc:mysql://localhost/olis...

61 Working Example I- public class Rain extends CyclicBehaviour { private GeoRiscAgent private String dataSource =... public class Rain extends CyclicBehaviour { private GeoRiscAgent private String dataSource =... } Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio Monitor Analyzer Data Source Failure Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio Factors Rain FileDataBase x Factors Rain FileDataBase Feature Model Reconfiguration “file://c:\\GeoRisco\\dados\\rain.shp“; Derive adaptation actions “db://jdbc:mysql://localhost/olis“; Failure(Rain)

62 Dynamic Binding Approach Camila Nunes, Elder Cirilo e Ingrid Nunes © LES/PUC-Rio Runtime Environment OSGi JADE JVM Management Server PlanExecuteMonitorAnalyse Feature Model Multi-level Models Knowledge Configuration Model

63 References Software Engineering for Self-Adaptive Systems: A Research Road Map –Betty H.C. Cheng, et. al. A survey of Autonomic Computing—Degrees, Models, and Applications –MARKUS C. HUEBSCHER and JULIE A. McCANN 16/12/ Carlos J. P. Lucena © LES/PUC-Rio

64 Software Engineering for Self-Adaptive Systems


Carregar ppt "Software Engineering for Self-Adaptive Systems. Self-Adaptation The complexity of current software-based systems has led the software engineering community."

Apresentações semelhantes


Anúncios Google