Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase...

33
1 Konformancia tesztelés Csöndes Tibor Ericsson Kft., R&D, BME-TMIT [email protected] , [email protected]

Transcript of Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase...

Page 1: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

1

Konformancia tesztelés

Csöndes Tibor

Ericsson Kft., R&D,

BME-TMIT

[email protected],

[email protected]

Page 2: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

2

Protokoll technológia

(Protocol Engineering)

Szöveges protokoll

leírás

Formális protokoll

specifikáció

Teszt készlet

Protokoll

implementáció

Specifikálás

Konformancia

vizsgálatok

ImplementálásVerifikálás

Tesztsorozat

generálás

Validálás

Page 3: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

3

Kapcsolat a különböző

leírónyelvek között

TTCNSDL

UML

MSC ASN.1

Megvalósítás Tesztrendszer

Követelmények

definiálása

Követelmények

definiálása

Követelmények

definiálása

Validáció

Tesztgenerálás

Újra

felhasználás

Kódgenerálás

Konformancia teszt

Újra

felhasználás

Validáció

Kódgenerálás

Page 4: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

› White box testing – typically during development

– Access to code

– Access to development environment

› Black box testing

– Internal structure of the code is not known/interested

– Checks the communication between the tested entity and its

environment

– IUT/SUT – Implementation/System Under Test

– Tester – may be decomposed

– PCO – Point of Control and Observation

White and Black box testing

4

Page 5: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

› Black box testing

– Implementation/System

Under Test

– Point of Control and

Observation

› Not possible to test all the

situations

– Test Purposes

Black Box Testing

5

IUT

PCO

! A

? B

Verdict:

pass,

fail,

inconclusive

Page 6: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

› Checks if IUT

conforms to its

specification

› Experiments

programmed into Test

Cases

conformance Testing

6

Informal

specification

Formal

specification

Implementation Test cases

Page 7: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

› Implementation of a Test Purpose

– TP defines an experiment

› Focuses on a single requirement

› Returns verdict (pass, fail,

inconclusive)

› Typically a sequence of action-

observation-verdict update:

– Action (stimulus): non-blocking

(e.g. transmit PDU, start timer)

– Observation (event): takes care of

multiple alternative events (e.g.

expected PDU, unexpected PDU,

timeout)

Test cases in black-box test

7

alternatives

alternatives

P

P F I

IF

non-blocking

Stimulus non-blocking

blocking events

blocking events

Page 8: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

8

Conformance Testing Methodology and

Framework (CTMF)

• A szabványokat eredetileg OSI protokollok tesztelésére

fejlesztették ki

ISO/IEC ITU-T Title

9646-1 X.290 General Concepts

9646-2 X.291 Abstract Test Suite Specification

Multi-protocol Testing

Multi-party Testing

9646-3 X.292 TTCN Notation

Concurrent TTCN

Encoding and Modular TTCN

9646-4 X.293 Test Realization

9646-5 X.294 Requirements on Test Laboratories and Clients for

the Conformance Assessment Process

9646-6 X.295 Protocol Profile Test Specification

9646-7 X.296 Implementation Conformance Statements

Page 9: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

9

Terminológia

• ASP Abstract Service Primitive

• ATM Abstract Test Method

• CP Coordination Point

• IUT Implementation Under Test

• LT Lower Tester

• PCO Point of Control & Observation

• PCTR Protocol Conformance Test Report

• PICS Protocol Implementation Conformance Statement

• PIXIT Protocol Implementation Extra Information for Testing

• PDU Protocol Data Unit

• SCS System Confomance Statement

• SCTR System Conformance Test Report

• SUT System Under Test

• TCP Test Coordination Procedure

• UT Upper Tester

Page 10: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

10

• Az IUT egy fekete doboz

• Látható viselkedés PCO-kon

keresztül vezérelhető és

megfigyelhető

• A PDU-k ASP-be beágyazva

kerülnek küldésre és fogadásra a

felső (UT) vagy az alsó (LT) teszter

által

• A teszt koordináció többrésztvevős

tesztelés esetén koordinációs

pontokon (CP) keresztül történik

IUT

PCOm

PCOn

ASP1 PDU1 ASP2 PDU2

ASP4 PDU4ASP3 PDU3

UTm

LTn

Conformance Testing

Methodology and Framework - CTMF

Page 11: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

11

Követelmények csoportosítása

• Kötelező (mandatory)

– Mindenképp teljesíteni kell

• Feltételes (conditional)

– Adott feltételektől függően kell teljesíteni

• Opcionális (options)

– Gyártó által szabadon választható

• Pozitív vagy negatív

• Statikus vagy dinamikus

Page 12: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

› Only observes

– waits for error

› no guarantee to happen

› Protocol Analyzer

Passive Tester

12

Protocol

Entity

Protocol

Entity

Protocol

Tester

Page 13: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

› Active

– can send messages

› Valid testing

› Provocative testing

– Invalid

› Sends syntactically incorrect messages

– Improper

› Sends syntactically correct messages, but at wrong time/state

› Test cases are generated before testing starts

Active Tester

13

Protocol

Entity

Protocol

Tester

Page 14: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

14

Konformancia tesztek típusai

• Basic Interconnection Tests– Alapvető konformancia követelményeket teljesíti-e a

rendszer

• Capability Tests– Az alap képességek összhangban vannak-e a ICS-sel

• Behaviour Tests– Igazi tesztek melyekkel a megfigyelhető viselkedést

teszteljük

• Conformance Resolution Tests– Nem szabványos tesztek, protokoll részleteibe menő

tesztelés

Page 15: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

15

Konformancia tesztelés

módszertana• A tesztelés lépései:

1. Tesztelés előkészítése (PICS, PIXIT, parametrizálás)

2. Teszt végrehajtás - test campaign (teszt kiválasztás)

3. Teszt jelentés elkészítése (PCTR, SCTR)

• Teszt cél (Test Purpose): egy vagy több követelmény megfogalmazása

• Teszt eset (Test Case): egy teszt cél megvalósítása (ETSI), ITU-nál nem minden esetben egyértelmű a megfeleltetés

• A teszt esetek teszt csoportokba gyűjthetők az absztrakt tesztsorozatban (ATS)

Page 16: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

16

Conformance assessment

process overview

Page 17: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

17

Konformancia tesztelés

dokumentumai

Conformance

Report

(PCTR)

Protocol

Standards

TSS&TP

PICS

PIXIT

IUT

ATS

Tester equipment

Static Testing Dynamic Testing

Abstract Test Suite Specification in TTCN Test Realisation Conformance Assessment

PICS:Protocol Implementation Conformance Statement ATS:Abstract Test suite

PIXIT: Protocol Implementation eXtra InformaTion PCTR:Protocol Conformance Test Report

Page 18: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

18

Page 19: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

19

Alsóbb réteg-szolgálat

FELSŐ

TESZTELŐ

Absztrakt teszt módszerek egy

résztvevős tesztelés esetén

ALSÓ

TESZTELŐ

PCOn

PCOm

Teszt koordináció

ATMs: Helyi, Távoli, Elosztott és Koordinált (X.290 vagy

ISO9646-1) teszt architektúra

IUT

Page 20: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

20

Teszt módszerek csoportosítása

• Mind az alsó és mind a felső tesztelő PCO-ja elérhető:

– Helyi (Local)

• Felső PCO egy szabványos hardver interfész

– Elosztott (Distributed)

• Felső tesztelő az SUT része (akár szabványos TTCN nyelven)

• Csak az alsó tesztelő PCO-ja érhető el:

– Koordinált (Coordinated)

• Felső tesztelő szabványos teszt menedzsment protokollal vezérelhető

– Távoli (Remote)

• Nincs igazi felső tesztelő vagy nem érhető el, teszt koordináció is esetleges (helyette pl. implicit send lehet)

Page 21: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

21

Page 22: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

22

Page 23: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

23

Page 24: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

24

Page 25: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

25

Teszt készlet felépítése

Page 26: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

27

A Test Case consists of...

PREAMBLE: Place the IUT in a desired

stable/idle state

TEST BODY: Implements the test case

purpose. May use test steps, defaults, pseudo-

events, qualifiers, timers, variables, PCOs, CPs,

PDUs, ASPs defined in the ATS Declarations and

Constraints part.

VERIFICATION: Try to determine if the IUT is

in the correct end state following execution of the

test case body (optional).

POSTAMBLE: Return the IUT to a known

stable/idle state

Start-up

State

Typical Test Case Structure

Stable/Idle

State

Test

State

End

State

VERIFICATION

PREAMBLE

TEST BODY

POSTAMBLE

+PREAMBLE

+TEST_BODY

+VERIFICATION

+POSTAMBLE

+POSTAMBLE

optional

Page 27: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

› Abstract test cases should contain

– preamble: sequence of test events

to drive IUT into initial testing state

from the starting stable testing state

– test body: sequence of test events

to achieve the test purpose

– postamble: sequence of test events

which drive IUT into a finishing stable

testing state

› Preamble/postamble may be

absent

Independence and structure of abstract test cases

28

idle

postamble

idle

preamble body

idle

Page 28: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

31

What is Model Based Testing

Conventional Testing vs. Model Based Testing

Manual Design

Model

TC#1

TC#2 TC#N

TestSuite

Specification

Manual Design

TCP Connection establishment

“The active open is performed by the client sending a SYN to the server.

It sets the segment's sequence number to a random value A.

In response, the server replies with a SYN-ACK. The acknowledgment number is set to one

more than the received sequence number (A + 1), and the sequence number that the server

chooses for the packet is another random number, B.

Finally, the client sends an ACK back to the server. The sequence number is set to the

received acknowledgement value, and the acknowledgement number is set to one more

than the received sequence number i.e. B + 1. “

TCP Connection establishment

“The active open is performed by the client sending a SYN to the server.

It sets the segment's sequence number to a random value A.

In response, the server replies with a SYN-ACK. The acknowledgment number is set to one

more than the received sequence number (A + 1), and the sequence number that the server

chooses for the packet is another random number, B.

Finally, the client sends an ACK back to the server. The sequence number is set to the

received acknowledgement value, and the acknowledgement number is set to one more

than the received sequence number i.e. B + 1. “

Model Based Testing

Page 29: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

32

Test

Harness

What is Model Based Testing

Conventional Testing vs. Model Based Testing

Model

Algorithmically

generated

TC#1

TC#1

TC#2TC#N

Algorithmically

generated

TestSuites

Page 30: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

33

The Model

Model description

Model

Pure language based: C++;

Java; C#; TTCN-3

Graphical based: FSM;

Petri Net; Label Transition System

Mixed: Graphical Solution

extended by a language

(c++; java; C#...etc.)

Pro

gra

mm

ing c

om

pete

nce

Page 31: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

34

The Algorithm

Magic Algorithm: describes how to generate the Test cases

Model TC#1 TC#2

TC#N

TestSuites

Coverage:

➢Traverse every state

➢Traverse some state

➢Traverse every link

➢…etc

Page 32: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

35

Model Based Testing on FieldPros and Cons of Model Based Testing

– Reduces fault slip through

Design phase

Design phase

Testing phase

Development time

Testing phase

Model development of the

Design and model

development of the Testing

could take place parallel

model development for

testing verifies the model of

the design

some faults could be

found in the “development

phase”

Reduces development

time

Model Driven Engineering

Page 33: Konformancia tesztelés · –Reduces fault slip through Design phase Design phase Testing phase Development time Testing phase Model development of the Design and model development

36

Model Based Testing Why?

Pros and Cons of Model Based Testing

– Reduces fault slip through

– Maintenance

Model

›If the specification changes

TC#1 TC#2

TC#N

TestSuites

›Change all the affected TestCases +TestHarenss

›Complicated !! ›Easier maintenance!!

Test

Harenss