Oracles in TTCN-3 and UTP Ina Schieferdecker 2012, May 22nd, CREST - - PowerPoint PPT Presentation

oracles in ttcn 3 and utp ina schieferdecker
SMART_READER_LITE
LIVE PREVIEW

Oracles in TTCN-3 and UTP Ina Schieferdecker 2012, May 22nd, CREST - - PowerPoint PPT Presentation

Oracles in TTCN-3 and UTP Ina Schieferdecker 2012, May 22nd, CREST Workshop, London Outline Oracles, Test Automation and (Test) Models Oracles in TTCN-3 Test Automation (Oracle) Examples Test oracle as part of a test case A test


slide-1
SLIDE 1

Oracles in TTCN-3 and UTP

2012, May 22nd, CREST Workshop, London

Ina Schieferdecker

slide-2
SLIDE 2

Outline

  • Oracles, Test Automation and (Test) Models
  • Oracles in TTCN-3
  • Test Automation (Oracle) Examples
slide-3
SLIDE 3

Test oracle as part of a test case

  • A test case is a tuple of

Pre-, post- and side conditions

Test inputs (stimuli)

Test outputs (expected responses) (see e.g. ISO/IEC CTMF , FMCT or ISTQB)

Do not separate test inputs from oracles Both can/are to be realized by an automated test system

slide-4
SLIDE 4

Test oracle as part of a test automation solution

  • Two principle ways

“Liveness” checking

 logical description  used in monitoring, passive testing, active testing

TTCN-3 for passive and active testing, but also “logical complement/extension TTCN-3” for continuous invariant checking during test execution

“Safety” checking

 declarative description  used in active testing

just TTCN-3

slide-5
SLIDE 5

Test oracle as part of a generic automated test solution

  • Oracles can be part of generic test automation solution

Specify expected responses

Evaluate received responses

Decide about end of test case or if and how to continue

If possible, help the tester to find the place of mismatch in expected and received system responses

  • However, need to differentiate test case verdict determination (the oracle) and system

under test evaluation (the overall test result)

slide-6
SLIDE 6

Test Case Oracle and System Oracle

  • Compare test results with the defined test objective

 individual test results (given by oracle and arbitrated wrt. test

  • bjective) are consolidated into overall test result

 system oracle needed

  • Checking test logs against the exit criteria

 system oracle (like a test oracle) needs to decide about test

campaign termination or continuation

  • Test case arbiter  test (case) verdict evaluation scheme
  • Test case oracle  test (case) verdict production
  • System arbiter  test result evaluation scheme
  • System oracle  test result production

Analysis and Design Implementation and Execution Test Closure Start Finish Evaluation and Report Planning and Control

slide-7
SLIDE 7

Expressiveness of test case oracles

  • Oracles

Need to be “weak or strong” as required

Should produce the test case verdict automatically based on an arbitration relating to the test objectives

Are potentially not just saying “yes/no”, but rather provide also hints/guidance what to test in addition in order to say yes/no

slide-8
SLIDE 8

Oracle hierarchy

  • Basic oracle

 predefined fixed set of response accepting  often used in software testing and embedded systems testing, applicable for offline

and online test result analysis

  • Dynamic oracle

 set of responses accepting that are parameterized with SUT response elements  smarter way of determining acceptable system responses, basically used to improve

test efficiency; required if responses depend on stimuli

 often used in protocol and service testing and in testing of distributed systems,

applicable for offline and online test result analysis

  • Interactive oracle

 in addition, set of stimuli providing that are parameterized with SUT response

elements, which are needed to complete test evaluation

 same as above, but applicable for online test result analysis only

  • Composite oracle

 several (different) oracles (with potentially different arbitration) contributing to test

result

slide-9
SLIDE 9

Oracle determination

  • Oracles can be

Generated from models  model-based testing

Extracted from code  oracle mining

Specified  test modeling

  • Oracles need to be

Validated  empirics

Verified  power, correctness, completeness

slide-10
SLIDE 10

Test Execution with TTCN-3

  • Official web page: http://www.ttcn-3.org
  • Standard: http://www.ttcn-3.org/StandardSuite.htm
  • Tool: TTworkbench: http://www.testingtech.com/
  • TTCN-3: Testing and Test Control Notation
  • Abstract test specification
  • Data templates allow structuring,

parameterization, construction and reuse of test data

  • Matching mechanism are the main concept

to define oracles

  • Interaction with SUT: at message-based and

procedure-oriented ports

  • Test behavior: sequential, branching and

recursive in a test component, parallel between test components

  • Concrete test implementation
  • Adapter and codec
  • Logging interface

Test Logging(TL)

Component Handling (CH)

Coding Decoding (CD) TTCN-3 Executable (TE)

System Adapter (SA)

Platform Adapter (PA)

TTCN-3 Executable (TE) System under Test

Test System

System Adapter (SA) Test Management (TM)

slide-11
SLIDE 11

IDL XSD

Language mappings

ASN.1

Extensions

Advanced parameteri- zation Behaviour types Static configuration Documentation t3doc

TTCN-3 Structuring: Imports, Groups, Attributes Core language

TTCN-3 Technology Overview

TTCN-3 Behaviour TTCN-3 Data

C C++

TRI/TCI mapping

Java XML C#

Real-time support

Basic and dynamic oracles Interactive oracles Domain-specific oracles

slide-12
SLIDE 12

TTCN-3 Templates

  • Define test data representing stimuli to and responses from the SUT

Template specification

  • Type-based  messages
  • Operation-based  operation invocation, reply, exception

Explicit definition or inline definition

Global or local

Value sets

Parameterized value sets

Function-generating value sets

12

slide-13
SLIDE 13

Basic TTCN-3 Matching Mechanisms

13

slide-14
SLIDE 14

Oracle Specifications in TTCN-3

  • Basic oracles

Values:

template integer valueTempl:= 7;

Value sets:

template integer valueSetTempl_1:= complement(7); template integer valueSetTempl_2:= ?;

  • Dynamic oracles

Parameterization:

template integer valueTemplParam (integer p):= 2*p; template integer valueSetTemplParam (integer p):= complement(2*p);

Template reuse:

template integer TemplOfTemplates:= (valueSetTempl_1, valueSetTemplParam(10))

slide-15
SLIDE 15

Oracle Specifications in TTCN-3

  • Interactive oracles

Template computation together with control and alternative behaviors:

var integer x; // any value, keeping value p.receive(integer: ?) -> value x; // send template depending on received value if (x mod 2 == 0 ) { x:= 2*x } else { x:=0 } p.send(x); // different expectations depending on send value alt { [] p.receive(4*x) {setverdict(pass)} [] p.receive(?) {setverdict(fail)} }

slide-16
SLIDE 16

Since TTCN-3 v3.1.1: Template Computation

  • First-order templates

Template variables  for computation

Template parameters  for reuse

Template returning functions  for computation structuring

  • Template Characterization
slide-17
SLIDE 17

MTC PTC1 PTCN

Verdict returned by the test case when it terminates

P I F

Test Verdict Handling

  • Verdict type with ordered verdict values:

none < pass < inconc < fail < error

  • Each test component has its own local verdict, which can be set (setverdict) and

read (getverdict)

  • Predefined functional/conformance verdict computation, verdict arbitration possible by
  • wn computations
  • A test case returns the test case verdict

I

setverdict(inconc) setverdict(fail)

F P

setverdict(pass)

slide-18
SLIDE 18

Test Logging

  • Used to support the tracing of test runs and the evaluation of the test results
  • Test execution interface for automated logging: TLI

XML based

Can log all test events

Can be filtered

  • Log statements for test case specific logging

literal values

templates and variables

component, port and timer states

slide-19
SLIDE 19

TTworkbench – An Impression of TTCN-3 Tooling

19

Result Analyzer Online Logging, Filter, Reporting Test Report Test Execution Test Campaign Designer (Test Automation) Test Parametrization Developers Perspective for Modification

slide-20
SLIDE 20

Automated Oracle and Evaluation Support

PCD_01

slide-21
SLIDE 21

Example: IHE/HL7 Testing

21

IHE Patient Care Device (PCD) Device Enterprise Communication (DEC)

  • ReTeMes (EU) / TestNGMed (DE) research

project

  • Dec.2007- Sept. 2009
  • TUB, sepp.med, Applied Biosignals, UPB,

InfoWorld

  • Goal: A test methodology (incl. IOT) based
  • n TTCN-3 for automated testing of HL7

based medical systems

IHE IT Infrastructure (ITI) Patient Identifier Cross-Referencing (PIX)

  • PIX IOT Connectathon Test Suite
  • Connectathon 2010, 2011, 2012
  • Fraunhofer FOKUS, ETSI
  • Goal: demonstrate the use of TTCN-3

technology for interoperability of HISs compliance with IHE profiles

  • Results contributed by ETSI to the HITCH

research project

Device

DOR DOF DOC MLLP MLLP

ISO/IEEE 11073

Patient ID Domain B Patient ID Domain A

Patient Registration EHR System

A123 B123 A123

Patient ID Feed Patient ID Query

Patient Registration

Clinical Information System

B123

Patient ID Feed Patient ID Query PIX Manag er Patient ID Domain C Patient Registration PACS

C123

Patient ID Feed

C123

Patient ID Update Notification

slide-22
SLIDE 22

Segment Required Segment Optional […] Group of Segments Optional [{…}] or {[…]}

ADT_A02 Message Structure

HL7 v2.x Messaging Standard

22

HL7 v2.x Message Structure Segments Fields Component Sub- Component Groups Groups Segments

HL7 v2.x. Message Structure

Segment 1 Segment 2 Segment 3 Segment … Field 1 Field 2 Field … Field 1 Field 2 Field … Field 1 Field 2 Field …

… …

ADT Message Types HL7 v2.x

Trigger Events

Example: HL7 v2.5.1 Messages in Numbers

122 Message types 313 Trigger events

153 Segment types

189 Msg. structures

slide-23
SLIDE 23

Possible IOP Problems

23

interaction scenario message type checking fields conditionality message content semantic correlations

<---- 172.16.1.159:3600 MSH|^~\&|PIX_X_REF_MGR_Initiate_COPY_0|Initiate|OTHER_ETSI|ETSI|20100413045234|| RSP^K23^RSP_K23|41|P|2.5 MSA|AA|ETSI‐980403 QAK|Q231235421946|OK QPD|IHEPIXQuery|Q231235421946|101^^^ETOT&1.3.6.1.4.1.21367.2010.2.1.419&ISO^PI PID|||101^^^&1.3.6.1.4.1.21367.3000.1.1&ISO^PI~101^^^&1.3.6.1.4.1.21367.3000.1.2 &ISO^PI~101^^^&1.3.6.1.4.1.21367.3000.1.3&ISO^ PI~L101^^^&1.3.6.1.4.1.21367.3000.1.6&ISO^PI~275^^^&1.3.6.1.4.1.21367.2010.2.1.4 19&ISO^PI||~^^^^^^^S invalid assignment: "S"

slide-24
SLIDE 24

SUT

Example: Performance Testing of Multi-Services Systems

Network 1 Network 1 Network 2 Network 2

Service1 Service2 Service3 service1 service2 service3 service1 service2 service3

. . .

Test System Node1

. . .

Test System Node2

  • How many users?
  • How many calls?
  • How many transactions?
  • How many open calls?
  • etc.
  • Service variability
  • Multiple protocols
  • Different interfaces
  • Random demand
  • Various user times (ringing, talking, etc.)
slide-25
SLIDE 25

preamble stir-time test-time transient- time

Traffic Time Profile

Use cases  User State Machine  Design Objectives  Traffic Set  Traffic Time Profile  Design Objective Capacity  Metrics

Initial Load Increase Rate Preamble Rate Transient Time Steps Number

step-time

Stir Steps

slide-26
SLIDE 26

Performance Metrics

  • Per scenario

TRT – Transaction Response Time

TL – Transmission Latency

  • Global

SAPS – Scenario Attempts per Second

IHS% – Percent of Inadequately Handled Scenarios

RETR – Retransmissions

SIMS – Simultaneous Scenario

CPU – CPU consumption on SUT

MEM – Memory consumption on SUT

Use cases  User State Machine  Design Objectives  Traffic Set  Traffic Time Profile  Design Objective Capacity  Metrics

slide-27
SLIDE 27

Example: ECU Testing

  • Extensions for hybrid systems

– real time systems (RT-TTCN-3) – continuous systems (Continuous TTCN-3)

  • RT-TTCN-3 Concepts

– clock as a common basis for time measurement. – timestamp redirection for exact time measurement of message interaction.

  • Continuous TTCN-3 Concepts

– sampled clock as a common basis for discretization and stream definitions. –

sampled streams that provide a data structure to define, access and manipulate discretized signal values and their history in time.

– hybrid automata that provides a control flow structure to enable and control

the simultaneous stimulation and evaluation of stream ports.

slide-28
SLIDE 28

TTCN-3 Embedded Sample: Vehicle Passing

slide-29
SLIDE 29

TTCN-3 and Vector CanOE

  • Real automotive hardware system
  • Typical automotive test platform (Vector CanOE)
  • Shows TTCN-3 embedded integration
  • Checks functionality and timing
slide-30
SLIDE 30

Summary

  • Need for

Dynamic, interactive and composite oracles

Arbitration

Test case and system-level considerations

  • Presented TTCN-3

Supports different forms of templates and arbitration

Automates the oracle

Supports the test result evaluation

  • An aside: UTP

Addresses issues differently