satel semi automatic testing language university of geneva levi lúcio, didier buchs m-toos,...

23
SATEL Semi Automatic TEsting Language University of Geneva Levi Lúcio, Didier Buchs M-TOOS, Portland 03/21/22

Upload: grayson-alberts

Post on 15-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

SATELSemi Automatic TEsting Language

University of Geneva

Levi Lúcio, Didier Buchs

M-TOOS, Portland 04/18/23

2Portland, 04/18/23

Presentation Plan

CO-OPN and testing; Semi-automatic test selection; Concepts of SATEL; How do we find tests with SATEL; Conclusions.

3Portland, 04/18/23

Presentation Plan

CO-OPN and testing; Semi-automatic test selection; Concepts of SATEL; How do we find tests with SATEL; Conclusions.

4Portland, 04/18/23

CO-OPN Specification Language

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Algebraic Data Type (ADT)

Petri Net (extended)

MethodGate

CO-OPN Class Account

5Portland, 04/18/23

Transactional Semantics and Concurrency

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Concurrency is automaticallymanaged by Petri Nets…

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

A transaction is either possible orthe state of the system is not changed!

Synchronization operators: Sim (//), Seq (..), Alt (+)

6Portland, 04/18/23

CO-OPN Specs as Modelsfor Testing

CO-OPN specs may be seen as reactive systems: Stimulations: method events Observations: method success and gate events (may

be absent…)

We can extend these notions to: Stimulations: simple or synchronized method events Observations: simple or synchronized gate events

7Portland, 04/18/23

Test Representation

A Test is a graphof Stimulation / Observation pairs with a truth value;

The graphs are expressed in Hennessy-Milner (HML) temporal logic: Sequence Negation Conjunction QuickTime™ and a

TIFF (LZW) decompressorare needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

8Portland, 04/18/23

Presentation Plan

CO-OPN and testing; Semi-automatic test selection; Concepts of SATEL; How do we find tests with SATEL; Conclusions.

9Portland, 04/18/23

Why is our Test SelectionSemi-Automatic?

The test engineer employs her semantic knowledge of the SUT to manually: Select execution paths to test (HML formulas); Select the shape of stimulation/observation

synchronizations; Constrain parameters of stimulation/observation pairs.

… and automatically find method parameters that correspond to equivalence classes of the method’s behavior

10Portland, 04/18/23

Test Selection Process

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

“Manual” selection“Automatic” selection

11Portland, 04/18/23

Presentation Plan

CO-OPN and testing; Semi-automatic test selection; Concepts of SATEL; How do we find tests with SATEL; Conclusions.

12Portland, 04/18/23

What are Test Intentions?3x

A test intention selectsa part of the model’s transition system andabstracts it…

Test Intention 1

Test Intention 2

13Portland, 04/18/23

Writing Test Intentions

A SATEL test intention is defined by axioms with constrained variables:

Parameters of methods or gates ADT types or Class types

Stimulations Observations HML formulas

A test intention “produces” a test set!

14Portland, 04/18/23

Language Features

Test intentions described by axioms with constraints over variables;

Recursion for describing repetitive paths in the labeled transition system;

Reuse of test intentions for test composition.

15Portland, 04/18/23

Axiom Structure

hmlFormula in intention cond1 & cond2 & … condn => hmlFormula in intention

HML(<loginUser(usr) with obs> T> in login;

Axioms

Variables obs : observation usr : username (ADT)

Non constrained variablesassume all their possible values

(usr into jean::luc::[]) = true =>HML(<loginUser(usr) with obs> T) in login;

Algebraic conditionconstraining the usr variable

subUniformity(usr) => HML(<login(usr) with obs> in login;

Select one value for “usr” perBehavior of the login operation

16Portland, 04/18/23

All constraints over variables

ADT Class Types

Algebraic conditions defined by term equalities

Equalities between object

identifiersonlySimultaneity bool depth int

onlySequence bool nbEvents int

onlyAlternative boolnbOccurrences (of a method)

int

simpleEvent bool sequence boolnbSynchronizations int positive bool

trace boolonlyConstructor boolonlyMutator boolonlyObserver bool

uniformity uniformity uniformity uniformitysubuniformity subuniformity subuniformity subuniformity

Observations / Stimulations HML Formulas

“Automatic” constraining predicate

17Portland, 04/18/23

Presentation Plan

CO-OPN and testing; Semi-automatic test selection; Concepts of SATEL; How do we find tests with SATEL; Conclusions.

18Portland, 04/18/23

How to find tests

For each test intention:

1. For each axiom find the set of variable substitutions that makes the condition true

Except variables marked with subuniformity

2. Generate per axiom a set of partially instantiated HML formulas

19Portland, 04/18/23

How do we find tests (2)

3. Validate the partially instantiated tests through the Spec’s transition system to find values for the remaining variables…

withdraw(m):(b >= m) => balance b -> balance b-m

Algebraic condition allowing themethod to fire

Petri net pre-conditionPetri net post-conditionAppying a subuniformity predicate on m implies at eachfire of the withdraw calculating one m for each equation:

(b >= m) = true(b >= m) = false

Calculated through logic programming…

20Portland, 04/18/23

Presentation Plan

CO-OPN and testing; Semi-automatic test selection; Concepts of SATEL; How do we find tests with SATEL; Conclusions.

21Portland, 04/18/23

Conclusions

The technique allows model based test generation;

The test engineer specifies customized reusable test intentions;

Abstractions from the transition system are performed automatically!

Work in progress…

22Portland, 04/18/23

Recursive Axioms and Test Intention Reuse

Several axioms may exist for one test intention and they may be recursive:

Variables f : HML

[] in nWrongPins;

f in nWrongPins => f . HML(<login(newUser(mario)) with errorLogin> T) in nWrongPins;

Base case for the recursion(empty test intention)Recursive definition

Axioms may be reused in other test intentions:

f in nWrongPins & nbEvents(f) < 4 => f in 4LessWrongPins

Condition over HML formulaTest intention reuse

23Portland, 04/18/23

“Automatic” Constraints

subUniformity(usr) => HML(<login(usr) with obs> in login;

During the transition induced by the “login” method select one value for “usr” per behavior of the login operation;

This depends on the behavioral axioms defining the method!