63
1

1. 11th TTCN-3 User Conference Implementing TTCN-3 Bangalore, June 2012

Embed Size (px)

Citation preview

1

11th TTCN-3 User Conference

Implementing TTCN-3

Bangalore, June 2012

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.©

Implementing TTCN-3?

We have selected the protocol or application to test

the test access UDP, IPv4, Ethernet

3

Ethernet

IPv4

UDP

DNS

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.©

Implementing TTCN-3?

We have written TTCN-3 test cases for DNS on an abstract level

We have to care for the concrete technical details like test access

4

Test Access

DNS

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 5

History of

TTCN-3 was published as ETSI standard in October 2000

Works on standardizing the runtime interfaces started immediately

Main driversNOKIA, EricssonTesting Technologies, TelelogicFOKUS, TU Berlin

TRI - TTCN-3 Runtime InterfaceFirst draft released 10/2001First version released 2002Current version dated 06/2011

TCI – TTCN-3 Control InterfacesWork for TCI started after v1.0 of TRIv1.0 of TCI released 03/2003

Ongoing task in the maintenance group

1998

2000

u2002

2003

2006

TC

I

TR

I

u

u

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 6

Standard Overview

SemanticsExecution Environment

Language Mappings

TTCN-3 Concepts and Syntax

Presentation Formats

1.

2.

3.

4.

5.

6.

7.

8.

9.

10. …

Core Language

Tabular Presentation Format

Graphical Presentation Format

Operational Semantics

TTCN-3 Runtime Interfaces (TRI)

TTCN-3 Control Interfaces (TCI)

ASN.1 to TTCN-3

IDL to TTCN-3

XML to TTCN-3

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 7

A TTCN-3 Test System

TE – TTCN-3 Executable

TM – Test Management

TL – Test Logging

CD – Codec

CH – Component Handling

SA – System Adapter

PA – Platform Adapter

SUT – System Under Test

ETSI ES 201 873-1 TTCN-3 Core Language (CL)ETSI ES 201 873-5 TTCN-3 Runtime Interface (TRI)ETSI ES 201 873-6 TTCN-3 Control Interfaces (TCI)

TM: Management TL: Logging

TE

CD

: C

odec

CH

: C

omp

onen

tH

andl

ing

SA: System Adapter PA: Platform Adapter

TRI

TCI

Test System User

System Under Test (SUT)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 8

Implementation

ATS

TE

SUT Communication

+TE

Test System

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 9

Steps to Implement TTCN-3

Translate TTCN-3 into executable code

Adapt runtime environment to test management

Implement communication and test platform aspects

Translate TTCN-3 into executable code

Adapt runtime environment to test management

Implement communication and test platform aspects

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 10

Translate TTCN-3 Into Executable Code

Reads module definitions written in the TTCN-3 core notation

Generates code and compiles it into executable code

Runtime support through runtime libraries

F:\AB>TTthree DNSTest

exampleModule.ttcn3

RuntimeLib

Compilation

TE

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 11

Steps to Implement TTCN-3

Translate TTCN-3 into executable code

Adapt runtime environment to test management

Implement communication and test platform aspects

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 12

TCI – Distribution, Management and Codec Adaptation

Facts on the TTCN-3 Control Interfaces (TCI)

Standardized (part 6)

Language independent specification using IDL

Multi-vendor support

TM: Management TL: Logging

TE

CD

: C

odec

CH

: C

omp

onen

tH

andl

ing

SA: System Adapter PA: Platform Adapter

TRI

TCI

Test System User

System Under Test (SUT)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 13

Common Structure of Sub-Interfaces

Have to be provided by the user (i.e. called by TE)

Required functionality of the TE (i.e. called by the user)

Applies to all TCI interfaces

TciCH RequiredTciCH Provided

TE

TciCD Required TciCD Provided

CD:Codec

CH:Component

Handling

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 14

A TTCN-3 Test System

ETSI ES 201 873-1 TTCN-3 Core Language (CL)ETSI ES 201 873-5 TTCN-3 Runtime Interface (TRI)ETSI ES 201 873-6 TTCN-3 Control Interfaces (TCI)

TE – TTCN-3 Executable

TM – Test Management

TL – Test Logging

CD – Codec

CH – Component Handling

SA – System Adapter

PA – Platform Adapter

SUT – System Under Test

TM: Management TL: Logging

TE

CD

: C

odec

CH

: C

omp

onen

tH

andl

ing

SA: System Adapter PA: Platform Adapter

TRI

TCI

Test System User

System Under Test (SUT)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 15

Why Test Management Interface?

Different applications need different test management functionality

Command line test managementGraphical test managementWeb-based test managementIntegration into existing platforms

One TTCN-3 oriented interface needed!

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 16

The Test Management Interface

TM providesUser Interface, incl. error reportingKeeps track of test case executionModule parameter resolvingLogging

TE providesEntry points to the TEStart/stop test caseStart/stop control part

6 operations provided9 operations required

TciTM Provided

TciTM Required

TM

TE

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 17

Dynamics of Test Management (1)

testcase Testcase1() runs on DNSTester{P.send(query);

P.receive(answer);setverdict(pass);

}

TM TE

send

receive

passtciTestCaseTerminated(pass)

tciTestCaseStarted(Testcase1,…,5.0)

tciStartControl()

tciControlTerminated()

tciRootModule(DNSTester)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 18

TM TE

Dynamics of Test Management (2)

testcase Testcase2() runs on DNSTester { var charstring h:= MODULE_PAR ;

log(h);setverdict(pass);

}

MODULE_PAR ??

h:= “HELLO”

pass

tciGetModulePar(MODULE_PAR)

tciTestCaseStarted(Testcase2,…,-)

tciLog(“HELLO”)

tciTestCaseTerminated(pass)

tciStartTestCase(Testcase2)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 19

TM TE

Dynamics of Test Management (2)

testcase Testcase2() runs on DNSTester { var charstring h:= MODULE_PAR ;

log(h);setverdict(pass);

}

MODULE_PAR ??

h:= “HELLO”

pass

tciGetModulePar(MODULE_PAR)

tciTestCaseStarted(Testcase2,…,-)

tciLog(“HELLO”)

tciTestCaseTerminated(pass)

tciStartTestCase(Testcase2)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 20

The TciTMRequired Interface

TE offers the entry point for test case execution and some rudimentary database functionality

Complete set of operationsvoid tciRootModule(moduleId);TciModuleParameterList tciGetModuleParameters(moduleId);TciTestCaseIdList tciGetTestCases();TciParameterTypeList tciGetTestCaseParameters(testCaseId);TriPortIdList tciGetTestCaseTSI(testCaseId);void tciStartTestCase(testCaseId, parameterList );void tciStopTestCase();TriComponentId tciStartControl();void tciStopControl();

TciTM Provided

TciTM Required

TM

TE

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 21

The TciTMProvided Interface

Feedback of the TE to the status of execution or request for module parameters

Complete set of operationsvoid tciTestCaseStarted (testCaseId, parameterList, timerValue);void tciTestCaseTerminated ( verdict, parameterList);void tciControlTerminated ();Value tciGetModulePar (parameterId);void tciLog (testComponentId, message);void tciError (String message);

TciTM Provided

TciTM Required

TM

TE

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 22

A TTCN-3 Test System

ETSI ES 201 873-1 TTCN-3 Core Language (CL)ETSI ES 201 873-5 TTCN-3 Runtime Interface (TRI)ETSI ES 201 873-6 TTCN-3 Control Interfaces (TCI)

TE – TTCN-3 Executable

TM – Test Management

TL – Test Logging

CD – Codec

CH – Component Handling

SA – System Adapter

PA – Platform Adapter

SUT – System Under Test

TM: Management TL: Logging

TE

CD

: C

odec

CH

: C

omp

onen

tH

andl

ing

SA: System Adapter PA: Platform Adapter

TRI

TCI

Test System User

System Under Test (SUT)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 23

Why Logging Interface?

Includes all operations needed to retrieve information about test execution

Controls the detail level of log information performed by

TE, SA, PA, CH, CD

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 24

The TciTLProvided Interface

TciTL Provided

TciTL Required

TL

TE

TciTL contains only Provided sub interface105 operationsExtract of operations

void tliTcExecute(TString, TInteger, TString, TInteger, TriComponentIdType, TciTestCaseIdType, TriParameterListType, TriTimerDurationType)void tliTcStart(TString, TInteger, TString, TInteger, TriComponentIdType, TciTestCaseIdType, TriParameterListType, TriTimerDurationType)void tliTcStop(TString, TInteger, TString, TInteger,TriComponentIdType)void tliTcStarted(TString, TInteger, TString, TInteger, TriComponentIdType, TciTestCaseIdType, TciParameterListType, TriTimerDurationType)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 25

A TTCN-3 Test System

ETSI ES 201 873-1 TTCN-3 Core Language (CL)ETSI ES 201 873-5 TTCN-3 Runtime Interface (TRI)ETSI ES 201 873-6 TTCN-3 Control Interfaces (TCI)

TE – TTCN-3 Executable

TM – Test Management

TL – Test Logging

CD – Codec

CH – Component Handling

SA – System Adapter

PA – Platform Adapter

SUT – System Under Test

TM: Management TL: Logging

TE

CD

: C

odec

CH

: C

omp

onen

tH

andl

ing

SA: System Adapter PA: Platform Adapter

TRI

TCI

Test System User

System Under Test (SUT)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 26

Why Component Handling Interface?

TTCN-3 suitable for different test applicationsFunctional testingLoad testingInteroperability testing

Need to distribute test components if running short of resources!

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 27

Distributed Testing

Network / Distributed System

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 28

The Component Handling Interface

Management of TTCN-3 componentsNo implementation of TTCN-3 functionalityDistribution of TTCN-3 configuration operationsDistribution of TTCN-3 intercomponent communication

Concept of Distributed TE, i.e. multiple TEsA single component handling entityPresence of a distinct TE*, i.e. the TE where a test case or the control part has been startedDistinct TE* responsible for final verdict calculation

The most complex interface17 required operations 17 provided operations

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 29

Example: DNS Tester Scalability Testing

testcase scalabilityTest() runs on ABClient system ABTester { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

testcase scalabilityTest() runs on MTC system TestSystemInt

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 30

Example: DNS Tester Scalability Testing

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

TE*

tciStartTestCase

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 31

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

Example: DNS Tester Scalability Testing

tciCreateTestComponent

tciCreateTestComponentReq

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

TE*

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 32

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

Example: DNS Tester Scalability Testing

tciStartTestComponent

tciStartTestComponentReq

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

TE*

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 33

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

Example: DNS Tester Scalability Testing

tciTestCaseStarted

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

TE*

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 34

Example: DNS Tester Scalability Testing

tciCreateTestComponentReq

tciCreateTestComponent

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

TE*

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 35

Example: DNS Tester Scalability Testing

tciConnectReq

tciConnect

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

TE*

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.©

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C); abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

36

Example: DNS Tester Scalability Testing

tciStartTestComponentReq

tciStartTestComponent

TE*

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.©

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

37

Example: DNS Tester Scalability Testing

tciSendConnect

tciEnqueueMsgConnected

TE*

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.©

Example: DNS Tester Scalability Testing

TE*

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

setverdict(pass) ; stop ;

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

38

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.©

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

39

Example: DNS Tester Scalability Testing

tciTestComponentTerminated

tciTestComponentTerminatedReq

TE*

all component.done ;

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 40

Example: DNS Tester Scalability Testing

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

tciTestComponentTerminatedReq

tciTestComponentTerminated

TE*

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 41

Example: DNS Tester Scalability Testing

tciTestCaseTerminated

TE*

function clntBehavior(...) { runs on MyPtcType { // Do what you have to do ! setverdict(pass) ; stop ;

}}

testcase scalabilityTest() runs on MTC system TestSystemInt { var integer i;

for(i:=0;i<MAXNUMBER;i:=i+1) { abC[i] := MyPtcType.create; map(abC[i]:S, system:R); connect(mtc:C, abC[i]:C);

abC.start(clntBehavior(USER[i])); C.send(....) to abC[i] ; }

all component.done ;}

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 42

Steps To Implement TTCN-3

Translate TTCN-3 into executable code

Adapt runtime environment to test management

Implement communication and test platform aspects

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 43

TRI – Communication Adaptation

Facts on the TTCN-3 Runtime Interfaces (TRI)

Standardized (part 5)Language independent specificationMulti-vendor support

TM: Management TL: Logging

TE

CD

: C

odec

CH

: C

omp

onen

tH

andl

ing

SA: System Adapter PA: Platform Adapter

TRI

TCI

Test System User

System Under Test (SUT)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 44

Why TRI ?

Abstract Test Specifications (ATS) have to run on different test devices of different vendors

Different access to underlying protocol stacks

ATS shall runs against systems in different development stages

SimulationSoftware onlyEmbedded in hardware

ATS can use different communications mechanisms and dynamic test configurations

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 45

Goals of TRI

Specify a small and well-defined runtime interface

for all future TTCN-3 test system implementations

Free TRI definition from any unnecessary restrictions

Exclude test management and data accessExclude communication between test components and their execution model Avoid bias towards any particular programming language

Historical older interfaceReference Implementation Slightly different interface naming

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 46

The TRI Communication Interface

Interface structureDue to historical reasons different namingApplies to all TRI interfacesSA reports status backTE indicates error

TriCommunicationTE

TriCommunicationSA

SA

TE

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 47

control { execute(Testcase1(), 5.0);

}

testcase Testcase1() runs on DNSTester system TSI {

map(mtc:P, system:P);P.send(query);P.receive(answer);setverdict(pass);

}

Dynamics of TRI SA

TE SA

triEnqMsg(mtcId,systemPortId,a,msg)

triExecuteTestcase(Testcase1,TSI)

triSAReset()

SUT

process

triMap(mtcId,systemPortId)

triSend(mtcId,systemPortId,a,msg)

pass

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 48

TriCommunicationSA Interface

Defines setting up configuration and sending of message to and/or calling of operations in the SUT

Complete set of operationsTriStatusType triSUTactionInformal (…);TriStatusType triSUTactionTemplate (…);

TriStatusType triExecuteTestCase(…);TriStatusType triMap(…);TriStatusType triUnmap(…);

TriStatusType triSend(…);TriStatusType triCall(…);TriStatusType triReply(…);TriStatusType triRaise(…);

TriStatusType triSAReset();

TSI

TC TC

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 49

TriCommunicationTE Interface

Defines receiving of messages and/or calling of operations in the TE

Complete set of operationsvoid triEnqueueMsg(…);void triEnqueueCall(…);void triEnqueueReply(…);void triEnqueueException(…);

TSI

TC TC

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 50

The TRI Platform Interface

Interface structureImplementation of time and external functionsPA reports status backTE indicates error

TriPlatformTE

TriPlatformPA

PA

TE

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 51

testcase Testcase2() runs on DNSTester system TSI{var timer t := 5.0 ;t.start ;var octetstring crc := crc32(myData);t.timeout;setverdict(pass);

}

Dynamics of TRI PA

TE PA

triTimeout(t)

triStartTimer(t, 5.0)

triPAReset()

SUT

triExternalFunction(crc32, myData)

calculation

pass

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 52

TriPlatform Interface

Defines control of time and calling of external functions

Complete set of operations (PA)TriStatusType triPAReset();TriStatusType triStartTimer(…);TriStatusType triStopTimer(…);TriStatusType triReadTimer(…);TriStatusType triTimerRunning(…);TriStatusType triExternalFunction(…);

Complete set of operations (TE)void triTimeout(…);

PA

TC TC

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 53

A TTCN-3 Test System

TE – TTCN-3 Executable

TM – Test Management

TL – Test Logging

CD – Codec

CH – Component Handling

SA – System Adapter

PA – Platform Adapter

SUT – System Under Test

ETSI ES 201 873-1 TTCN-3 Core Language (CL)ETSI ES 201 873-5 TTCN-3 Runtime Interface (TRI)ETSI ES 201 873-6 TTCN-3 Control Interfaces (TCI)

TM: Management TL: Logging

TE

CD

: C

odec

CH

: C

omp

onen

tH

andl

ing

SA: System Adapter PA: Platform Adapter

TRI

TCI

Test System User

System Under Test (SUT)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 54

Why Codec Interface?

TTCN-3 data has to be translated into a representation the SUT understands

Two different tasksEncoding

Internal TTCN-3 data representation to bitstringNeeds access to the TTCN-3 type and value system

DecodingBitstring to TTCN-3 data representationBased upon a decoding hypothesisTE may query multiple times for the decoding of the same bitstring

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 55

The Codec and Value Interface

Management of different codecs

Complete set of provided (TciCDProvided) operationsTriMessageType encode (in Value value)Value decode (in TriMessageType message, in Type hyp)

Facts on the TTCN-3 Type and Value Interface

TE maintains abstract type and data presentationCodec translates betweenabstract and concretepresentation

CD:Codec

TciCD ProvidedTciCD Required

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 56

Dynamics of the Codec (Sending)

control {execute(Testcase1(), 5.0);

}

testcase Testcase1() runs on DNSTester system TSI { map(mtc:P, system:P);

P.send(query);P.receive(answer);setverdict(pass);

}

TE SA SUTCDtriExecuteTestcase(Testcase1,tsiP)

triMap(mtcId,systemPortId)

encode(value) encode

triSend(mtcId,systemPortId,a,msg)

process

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 57

Dynamics of the Codec (Receiving)

control {execute(Testcase1(), 5.0);

}

testcase Testcase1() runs on DNSTester system TSI{ map(mtc:P, system:P);

P.send(query);P.receive(answer);setverdict(pass);

}

TE SA

triEnqMsg(mtcId,systemPortId,a,msg)

SUT

decode(msg,type)

CD

process

try to decode

pass

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 58

The decodingHypothesis

The interpretation of an arbitrary bitstring is context sensitive

Example: What is '56455300'O ?Four bytes as one octetstring: '56455300'OAn integer: 1447383808A charstring: "YES"

Decode() can be read as follows:Try to decode the provided bitstring, with the appropriated decoding rules into a value of given typeIf you succeed, return the valueIf you fail, return NULL

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 59

Access To TTCN-3 Data Types and Values

Formal definitionSpecification of abstract data types

Type for TTCN-3 types Different ADT types for TTCN-3 values

Set of high-level operations define the functionality

Practical usageTTCN-3 environments provide functions/operations to

Access TTCN-3 typesRead existing TTCN-3 values andCreate new TTCN-3 values

Underlying philosophy behind the ADT operations is an object oriented model

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 60

Abstract Data Type: Type

Type represents every TTCN-3 type

Only types defined in TTCN-3 modules can be accessed

No creation of user defined types at the TCI

... but creation of new instances of given type!

type record DNSQuery { charstring hostname, AnswerType answer optional, QueryType qtype}

type union AnswerType { Byte ipAddress[4], charstring hostname}

type integer Byte (0 .. 255);

type enumerated QueryType { A, NS, CNAME, MX}

Type

TciModuleId getDefiningModule()String getName()TciTypeClass getTypeClass()String getTypeEncoding()Value newInstance()

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 61

ADT: Value

UnionValue EnumeratedValue RecordOfValue RecordValue

HexstringValue OctetstringValue CharstringValue BitstringValue

UniversalCharstringValue

Value

Type getType()String getValueEncoding()boolean notPresent()

FloatValue

IntegerValue

BooleanValue

ObjidValue

VerdictValue

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 62

The Codec Interface

Complete set of required (TciCDRequired) operationsType getTypeForName(…)Type getInteger()Type getFloat()Type getBoolean()Type getChar()Type getUniversalChar()Type getObjid()Type getCharstring ()Type getUniversalCharstring ()Type getHexstring ()Type getBitstring()Type getOctetstring ()Type getVerdict()

void tciErrorReq(…)

Copyright Testing Technologies 2012. Confidential Information. All Rights Reserved. More Information at www.testingtech.com.© 63

TE

The Codec and Value Interface

3rd party codec providesOperations to construct valuesOperations to query valuesOperations to encode valuesOperations to decode bitstring TE

CD providesOperations to construct valuesOperations to query values

CD implementation maps TCI value structures into codec value structures

CD

TciCD ProvidedTciCD Requested

3rd Party

Codec