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

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

Testes de Software em Sistemas Multi-Agentes

Apresentações semelhantes


Apresentação em tema: "Testes de Software em Sistemas Multi-Agentes"— Transcrição da apresentação:

1 Testes de Software em Sistemas Multi-Agentes
Andrew Diniz da Costa

2 Por quê testar? Manter alta qualidade Prevenir e encontrar defeitos
Ganhar confiança sobre o nível de qualidade e prover informações.

3 Tipos de teste Teste de unidade/componente Teste funcional
Testes não funcionais É o teste de “como” o sistema trabalha. Teste de performance Teste de carga Teste de portabilidade Teste de usabilidade ...

4 Função do Analista de Teste/Testador
Identificar quais testes devem ser feitos Saber lidar com o esforço dos testes Criar o design Criar o script automatizado, quando necessário. Quais são os teste de regressão, novos e impactados? Cadastrar/Atualizar Bugs Aplicar “psicologia para testes”

5 Criação de designs

6 Modelagem em Testes Há diversas abordagens que propõem formas de modelar testes UML Testing Profile (padrão da OMG)* AGEDIS modeling language (AML) Unified Test Modeling Language UML Testing Profile Define um profile para ser aplicado em UML Atributos + estereótipos 1) OMG - Object Management Group, UML Testing Profile, version 1, 2) AGEDIS - Automated Generation and Execution of Test Suites for DIstributed Component based Software, 3) UTML - The Unified Test Modeling Language for Pattern-Oriented Test Design,

7 UML Testing Profile

8 Sistemas Multi-Agentes
Sistemas com agentes devem ser testados Tipos de teste? Testes triviais Testes complexos Thread © LES/PUC-Rio

9 JAT: A Test Automation Framework for Multi-Agent Systems
Roberta Coelho, Elder Cirilo, Uirá Kulesza Arndt von Staa, Awais Rashid , Carlos Lucena

10 Agents – A new Level of Abstraction
Problem Domain R1 R3 R5 R7 R2 R4 R6 Agent Oriented Agent Roles Messages Organization Protocols Which agents? R8 functions files modules Procedural How? Object Oriented Object Attribute Method Class What? If we are using a procediral paradigm to build a software we will look at the problem and think about how it can be implemented. We will end up with a set of files modules and funciotns. According to the Procedural Paradigm we look at the problem and think obout How we can solve it? Thus we implement a set of modules and functions to adress all requirements. According to oo paradigm we should look at the problem that extract the main elements (classes) that take part in it. So we devise a set of classes, relations, attrubutes from it. We look at the same problem but in dferent levels of abstraction.

11 Agent-related new abstractions  new sources of bugs
Fault Model Message ordering Message content Increases on message delay Faults in agents beliefs Faults in internal procedures Agent-related new abstractions  new sources of bugs

12  Agent Definition Agent:
is an autonomous entity that executes a plan to achieve a goal based on its beliefs (attributes) communicates asynchronously (message based) Autonomy –> certo grau de não-determinismo Different set of actions may achieve the same goal System Garcia, A., Lucena, C., Cowan D. Agents in Object-Oriented Software Engineering. Software Practice & Experience, Elsevier, 34 (5), pp , 2004. An agent is an autonomous, adaptive and interactive element that has a mental state. The mental state of an agent is comprised by: beliefs, goals, plans and actions. Every agent of the MAS plays at least one role in an organization. One of the attributes of a role is a number of protocols, which define the way that it can interact with other roles. The interface consists in the set of messagens that I can receive and the set of messages that I can receive. An agent is an autonomous and interactive element. The agent’s beliefs include what the agent knows (internal attributes) and its perceptions about what happens in MAS. Plans define a sequence of actions that is executed by an agent to achieve goals. Agents are goal oriented. Each agent in a MAS has one responsibility. This responsibility is represented by the roles it should play in the system.

13 We defined an approach for building and running MAS tests.
The Approach We defined an approach for building and running MAS tests. It relies on Aspect Oriented Programming to: Control the test input Observe the output units under test It was implemented on top of JADE: Middleware for agent-based applications developed in Java.

14 JADE Agent Testing (JAT) Framework
JAT enables: the creation of JUnit-style tests for JADE systems. JAT is used: as a generic testing framework for JADE developers same as JUnit is for Java developers

15 Using Agents to test Agents:
Ideas Using Agents to test Agents: Mock Agent a fake implementation of a real agent sends messages to an agent under test (AUT) and checks its response: content, delay, type, ordering.

16 Ideas Monitoring Agents Agents are autonomous
The developer need to know agents state ex: to answer: output == expected output? Monitor Aspect observes and stores information about agents state transitions (ex: running, dead). Agent state machine is a crosscutting abstraction public aspect AgentStateMachine { pointcut created():call(public ContainerController.createNewAgent(..)); pointcut from_created_to_running(Agent o): execution(protected void Agent.setup()) && target(o); pointcut from_running_to_dead (Agent o): execution(public void Agent.doDelete()) ... } running created waiting dead

17 JAT Framework: The Architecture
JADE Middleware JUnit Framework <<crosscuts>> <<crosscuts>> A Aspects <<uses>> <<crosscuts>> M <<crosscuts>> S JAT Framework Legend: M Monitoring Concern A Agent State Machine Concern S Synchronization Concern

18 JAT Framework: Dynamics
AgentStateMachineXPI

19 JAT Framework: Dynamics
AgentStateMachineXPI 1

20 JADETestCase: Code Example
public class BookTradingTesteCase extends JADETestCase { public void testBookTradingScena1(){ //Load Data Repositories startAUT("seller","BookSeller"); startMockAgent("buyer1","BookBuyerMockAgent",FIRST); startMockAgent("buyer2","BookBuyerMockAgent",SECOND); //Blocks until interaction finishes Monitor.aspectOf(). waitUntilTestHasFinished("buyer1"); Monitor.aspectOf(). waitUntilTestHasFinished("buyer2"); //Check Expected Result: assertInteractionOK("buyer1"); assertInteractionOK("buyer2"); Object belief= getBelief(“seller”,“catalogue”); assertEquals(expectedBelief,belief); } ...

21 JAT Framework: Dynamics
Monitoring DataRepository :Synchronizer :Monitor JADETestCase : JADEMockAgent : AUT: JADEAtent 1. testMethod () 2. loadInteraction Order( ) 3. start(params ) 4. start(params ) 5. state = crosscuts ( ) 6. add(state) 7. waitUntilTestFinishes ( ) 8. send(msg ) 9. send(msg ) 10.check(msg) 11. setResult ( ) 12. state = crosscuts ( ) 13. add(state) 14. notifyTestFinished () 16. assertions( ) Legend: join point intercepted join point intercepted object by Monitor aspect by Synchronizer aspect aspect

22 A Framework to Implement Self-Adaptive Agents that Apply Self-Test Andrew Diniz da Costa Viviane Torres da Silva Carlos José Pereira de Lucena

23 Motivação Sistemas Auto-adaptativos
Testar adaptações quando realizada por agentes Agentes podem ter funções que necessitem de adaptações Decision Execution Analyze Monitor IBM, An architectural blueprint for autonomic computing. Technical Report., IBM, 2003.

24 Main Idea New control loop of self-test. Description files (XML)
Test Language (TL) Casos de teste que poderão ser executados Data Language (DL) Dados a serem usados nos testes Control Flow Language (CFL) Fluxo de execução dos casos de teste Case Study: Petroleum system.

25 New Control Loop Johansson, C., Bucanac, C., The V-Model, April 1999.
Graham, D.; Veenendaal, E.; Evans, I.; Black, R.; book: Foudantions of Software Testing - ISTQB Certification

26

27 Estudo de Caso: Sistema de Petróleo
Domínio: Controle de estoque e suprimento de petróleo e produtos derivados do petróleo. Encontrar rotas que atendam um ponto do Brasil. Rota Destino Origem Produto Quantidade desejada Custo

28 Estudo de Caso: Sistema de Petróleo
Dados de Entrada: Destino: TT1 Produto: Gasolina Origem desejada: TA Quantidade: 10 mil t TT 1 (Gasolina) TA 2 3 mil t TA 1 2 mil t REF 1 10 mil t

29 Modelo Conceitual Manager Agent User Interface Terminal Agent
Delivery Local Agent Refinary Agent

30 Escritório de Qualidade - LES

31 Nossos Objetivos Garantir alta qualidade para os sistemas testados.
Preparação de Novos Profissionais Trabalho em equipe Desenvolvimento em Java 6 Acompanhamento Desenvolvimento para Banco Tarefas DBUnit Criação de queries SQL, procedures. Acompanhamento para tirar dúvidas Estudos de caso para projetos finais, dissertações e teses. Motivar criação de novas ferramentas JAAF+T: A Framework to Implement Self-Adaptive Agents that Apply Self-Test ASF: Agent Society Framework – JAT: A Test Automation Framework for Multi-Agent Systems - GearDB: Ferramenta para Geração de Dados Ferramenta para auxiliar o desenvolvimento em DBUnit

32 Divulgação do Nosso Trabalho
Divulgação do nosso trabalho de qualidade Quem somos Experiência, atividades realizadas Cursos oferecidos Ferramentas desenvolvidas pelo LES Artigos, documentos Prover: recomendações de ferramentas; Fórum de discussões sobre qualidade Por quê não nos transformarmos em um ponto de referência na área de qualidade no Brasil? Temos experiência e pessoas qualificadas.  Não temos a divulgação. 

33 Site de Escritório de Qualidade

34

35 Referências http://seleniumhq.org/ - site do Selenium
- documentação do Selenium – extensões do Selenium - XPather - plugin do Firefox para geração, edição, inspeção e extração de expressões em XPath. - Tutorial de XPath - Teste de expressões XPath em um arquivo específico - JUnit web site - DBUnit web site

36 Fim!!


Carregar ppt "Testes de Software em Sistemas Multi-Agentes"

Apresentações semelhantes


Anúncios Google