22
INTEGRATION TESTING BASED ON BEHAVIOR DRIVEN DEVELOPMENT Presented by Robin Bussenot © All rights reserved © All rights reserved

INTEGRATION TESTING BASED ON BEHAVIOR … Specific Language « A domain specific language (DSL) is a computer language that's targeted to a particular kind of problem… » Martin

Embed Size (px)

Citation preview

INTEGRATION TESTING BASED ON BEHAVIOR DRIVEN DEVELOPMENT

Presented by Robin Bussenot

© All rights reserved

© All rights reserved

2 © All rights reserved

A survey of testing avionics systems

3 © All rights reserved

• Tests for system integration use a test bench :• To interact with the module under test• To execute a simulation of the environment

• Mapping between variables of test procedures and devices of test benches • Interface Control Document (ICD)

Problems of testing avionics systems

• Some integration tests are described in natural language

• Test execution remains manual

• Testers performing integration tests are not expert in computer science

4 © All rights reserved

Proposal

• Goal

• Formalize and automatize integration tests for different aircraft domains

• Means

• Implement DSTLs to formalize test procedures

• Organize DSTLs in a Behavior Driven Development framework to automatize test procedures

5 © All rights reserved

proposal

Domain Specific Language

« A domain specific language (DSL) is a computer language that's targeted to a particular kind of problem… »

Martin Fowler, 2008.

• Producing a DSL for a specific domain brings many advantages:

• makes easier expressing domain concerns

• can be used by domain experts that do not necessarily have computer knowledge

• can generate many lines of code in GPL from few lines

• improves team communication

• can be managed by specific tools as IDE for GPL

6 © All rights reserved

Behavior Driven Developpment

• Agile methodology designed by Dan North

• Features of a product are linked to testable scenarii corresponding to its acceptance criteria

• Each scenario describes a possible behavior of the feature

• Stakeholders (designers, testers and programmers) share the same vocabulary

• The business vocabulary permeates right into the code of a scenario

7 © All rights reserved

Our proposal: A BDD framework

8 © All rights reserved

Pivot language

Air flow control

IMA

SCXML

Python

Dedicated languagesfor testers of each

domain

A unique and simple procedural language for test

automation

Execution on several test benches

Benefits

• Formalize test procedures in a specific context

• Describe easily tests intention by describing the expected behavior of the SUT

• Use the vocabulary of the business

• Involve domain experts in test design

• Code is business-readable and/or business-writeable

• Easier to debug

• Allow test automation

9 © All rights reserved

A DSTL FOR ATA 21 (AIRFLOW CONTROL)

© All rights reserved

Compared with State Chart XML and Python

© All rights reserved

Airflow control system

11 © All rights reserved

Integration test of the controller

12 © All rights reserved

13 © All rights reserved

from Interface_IRIT_ALYSA import *

alysa=Interface_IRIT_ALYSA("Failure")

def setup():

global alysa

alysa.logger.Notice("TEST INITIALISATION")

application="T"

bus="cabin"

signal="area2"

sig=alysa.formatSignalALYSA(application,bus,signal)

alysa.logger.Notice("SET area2 to 18.0")

alysa.signalSetReal(sig,18.0)

application="Q"

bus="consigne_Area1"

signal="duct1"

sig=alysa.formatSignalALYSA(application,bus,signal)

alysa.logger.Notice("SET duct1 to 0.0")

alysa.signalSetReal(sig,0.0)

application="Q"

bus="consigne_Area1"

signal="duct2"

sig=alysa.formatSignalALYSA(application,bus,signal)

alysa.logger.Notice("SET duct2 to 0.0")

alysa.signalSetReal(sig,0.0)

application="Q"

bus="consigne_Area2"

signal="duct1"

sig=alysa.formatSignalALYSA(application,bus,signal)

alysa.logger.Notice("SET duct1 to 0.0")

alysa.signalSetReal(sig,0.0)

application="Q"

bus="consigne_Area2"

signal="duct2"

sig=alysa.formatSignalALYSA(application,bus,signal)

alysa.logger.Notice("SET duct2 to 0.0")

alysa.signalSetReal(sig,0.0)

application="Model"

bus="environment"

signal="Kp1"

sig=alysa.formatSignalALYSA(application,bus,signal)

alysa.logger.Notice("SET Kp1 to 1")

alysa.signalSetReal(sig,1)

Almost 300 lines of Python code

14 © All rights reserved

More than 1000 of SCXML code

The pivot language (the glue code)

15 © All rights reserved

• 4 kinds of statements:

• Set: statement to assign a value to a parameter

• Verify: statement to ensure that a list of avionics parameters can reach their associated values until an amount of time

• Check: statement to ensure that a list of avionics parameters are in the expected state during an amount of time

• Call: statement to execute a feature of the bench

Set

• T cabin area1 = 20 °C

16 © All rights reserved

Check (assert with stability condition)

• Check that T cabin area1 == 20 °C

[during 2 min]

17 © All rights reserved

Verify (assert with reachability condition)

18 © All rights reserved

• Verify that T cabin area1 == 20 °Cuntil 1 min

A DSTL FOR ATA 42 (INTEGRATED MODULARAVIONICS)

© All rights reserved

A formalization from existing test procedures written in natural language

© All rights reserved

20 © All rights reserved

21 © All rights reserved

Conclusion and perspectives

• ATA 21: Tests generated with our framework have been validated at the final demonstration of the ACOVAS FUI project

• ATA 42: Tests in natural language have been translatedby experts domain into our DSTL

• Participation to a new project with Airbus (Post-doc)

• Automatize tests for ATA 42

• Validate mind maps through ontologies

• Reiterate the processus on another domain

22 © All rights reserved

Reiterate

Reiterate

Reiterate