TTCN-3 Test Case Generation from Message Sequence Charts

Download Report

Transcript TTCN-3 Test Case Generation from Message Sequence Charts

TTCN-3 Test Case Generation
from Message Sequence Charts
Michael Ebner
Institute for Informatics · University of Göttingen · Germany
ISSRE2004 - WITUL
Overview
 Concept
 Mapping of MSC to TTCN-3
 Related Concepts
Graphical Format of TTCN-3 (GFT)
UML Testing Profile (UTP)
Comparison
 Summary
TTCN-3 Test Case Generation from MSCs
2
Unified Modeling Language (UML)
Use Cases
Unit Test
Telephone Catalog
Check Status
Salesperson
Place Order
Classes
Customer
Fill Orders
Shipping Clerk
Establish Credit
Supervisor
cart
Testing
client
ShoppingCart
cartOrder
1
Customer
customerOrder
1
1..*
System Test
0..1
0..*
1
Account
accountOrder
OrderHeader
1
organizationOrder
account
Organization
client
ite
m
Sequences
*
LineItem
serviceItem
service
1
1
productItem
{xor}
1
Service
sd N
1..*
1
order
{xor}
product
1
States
ReadAmountSM
Product
abort
s[u]:B
s[k]:B
selectAmount
otherAmount
m3()
m3()
amount
enterAmount
ok
TTCN-3 Test Case Generation from MSCs
abort
aborted
Integration
Test
3
UML-based Test Specification
UML
map
Class Diagram
WSDL
Sequence, Activity,
and Interaction Overview
Diagram
map
map
IDL
CORBA
use
MSC
generate
TTCN-3
Data
TTCN-3 Test Case Generation from MSCs
TTCN-3
Behaviour
4
Overview
 Concept
 Mapping of MSC to TTCN-3
 Related Concepts
Graphical Format of TTCN-3 (GFT)
UML Testing Profile (UTP)
Comparison
 Summary
TTCN-3 Test Case Generation from MSCs
5
MSC Test Purpose Description
PCOs
SUT
(Points of Control and Observation)
(System Under Test)
PCO_X PCO_Y PCO_Z
TTCN-3 Test Case Generation from MSCs
SUT-P1
SUT-P2
6
Message Descriptions
<message type>
<message value>

[<message type>]
<template
reference>
Matching mechanisms
are only allowed for
messages to be
received from the
SUT.
[<message type>]
<derived template>
TTCN-3 Test Case Generation from MSCs
7
Mapping I
MSC
TTCN-3
Basic MSC
HMSC
instance axis
Testcase(s)
Testcase calls (control part)
represents a port (PCO)
note, comment, text
comment
chart name
instance kind
comment
(ttcn-3,begin,position)
Testcase name
component name or SUT
flow control
instance creation
call or getreply procedure
create component
TTCN-3 Test Case Generation from MSCs
8
Mapping II
MSC
TTCN-3
Message
Flow control
(Synchronise) Condition
Send or receive message
call or getreply procedure
Synchronising
Timer
Action
Coregion
Alternative, Option,
and Exception
Loop
MSC reference
Timer (start, stop, timeout)
TTCN-3 Statements
Interleave
Alternative (incl. sync.)
TTCN-3 Test Case Generation from MSCs
For or While loop (incl. sync.)
Function call
9
Example I – Mapping of MSC
testcase InresRTexample() runs on inres {
var float sendTime1:=-1.0;
var integer iterator1:=0;
for (iterator1:=0; iterator1<100;
iterator1:=iterator1+1) {
if (sendTime1==-1.0) {
sendTime1:=self.now+0.01; }
else {
resume(sendTime1);
sendTime1:=sendTime1+0.01;
}
log(TimestampType:{self.now,"IDATreq1"});
ISAP.send(IDATreq:{"data"});
MSAP.receive(MDATind:{DT,number,"data"});
log(TimestampType:{self.now,"MDATind2"});
MSAP.send(MDATreq:{AK,number});
}
setverdict(pass);
stop;
10
TTCN-3 Test Case Generation from MSCs}
Example II – Mapping of MSC
msc InlineAlt
SUT
syminres
ISAP1
ISAP2
ICONreq
IDATreq
alt
ICONind
IDATind
IDISind
ICONreq
IDATreq
ICONind
IDATind
IDISreq
IDISind
TTCN-3 Test Case Generation from MSCs
testcase InlineAlt()
runs on syminres {
ISAP1.send( ICONreq )
ISAP1.send( IDATreq )
ISAP2.receive( ICONind )
alt {
[] ISAP2.receive( IDATind ){}
[] ISAP1.receive( IDISind )
{
ISAP1.send( ICONreq )
ISAP1.send( IDATreq )
ISAP2.receive( ICONind )
ISAP2.receive( IDATind )
}
}
ISAP2.send( IDISreq )
ISAP1.receive( IDISind )
}
11
Overview
 Concept
 Mapping of MSC to TTCN-3
 Related Concepts
Graphical Format of TTCN-3 (GFT)
UML Testing Profile (UTP)
Comparison
 Summary
TTCN-3 Test Case Generation from MSCs
12
Overall Picture of TTCN-3
ASN.1 Types
& Values
TTCN-3
Core
Language
IDL Interfaces
& Types
Tabular
Format
XML Types
Graphical
Format
Other Types
& Valuesn
Presentation
formatn
TTCN-3 Test Case Generation from MSCs
TTCN-3
User
13
GFT I
 Provides a test specific profile for
MSC-2000
 Defines generic extensions
 Value returning GFT References
 Hyper GFT
 Hybrid GFT
 Defines test specific extensions, e.g.
 Port instances
 Special Messages for instance handling
 Type and Template definition for messages
 Trigger and check message
 Verdicts as special conditions
 Defaults
TTCN-3 Test Case Generation from MSCs
14
GFT II
 Does not use
Gates
General Ordering
Time Concepts
MSC Reference Expression
Instance Decomposition
 Assumed data types are TTCN-3
data types
TTCN-3 Test Case Generation from MSCs
15
TIMEDGFT-Example
testcase InresRTexample() runs on inres{
var float sendTime1:=-1.0;
var integer iterator1:=0;
for (iterator1:=0; iterator1<100;
iterator1:=iterator1+1) {
if (sendTime1==-1.0) {
sendTime1:=self.now+0.01; }
else {
resume(sendTime1);
sendTime1:=sendTime1+0.01;
}
log(TimestampType:{self.now,"IDATreq1"});
ISAP.send(IDATreq:{"data"});
MSAP.receive(MDATind:{DT,number,"data"});
log(TimestampType:{self.now,"MDATind2"});
MSAP.send(MDATreq:{AK,number});
}
setverdict(pass);
stop;
}
TTCN-3 Test Case Generation from MSCs
16
Overview
 Concept
 Mapping of MSC to TTCN-3
 Related Concepts
Graphical Format of TTCN-3 (GFT)
UML Testing Profile (UTP)
Comparison
 Summary
TTCN-3 Test Case Generation from MSCs
17
The UML 2.0 Testing Profile (UTP)

Profile: UML extension mechanism

Initiated late 2001

Make UML applicable for SW testing by
enhancing UML with test concepts

Enhances reuse of design model

Adopted by OMG in June 2003 and since April
2004 standardized

Allow automated test generation with UML
TTCN-3 Test Case Generation from MSCs
18
UTP Concepts
Architecture
concepts
Behaviour
concepts
Data
concepts
Time
Concepts
SUT
Test objective
Wildcards
Timer
Test
components
Test case
Data partition
Time zone
Test suite
Defaults
Coding rules
Test
configuration
Verdicts
Test control
Arbiter
Utility part
 UML 2.0 based meta-model
TTCN-3 Test Case Generation from MSCs
19
sd
sdTestRoaming_noWarning():Verdict
BT-Roaming
sd Conf_Default
<<testcomponent>>
<<testcomponent>>
<<testcomponent>>
Master1_BT
<<SUT>>
: Slave
: Slave
sa: Slave
sr: Slave
BTRoaming
Application
Application BTRoaming
<<testcomponent>>
<<default>>
: Slave
hw:
Slave
BT-HW
BT-HW
: co:
Location
TestServer
Coordinator
M1
: Master
:BT-HW
Master
T(6s)
ref
<<testcomponent>>
<<testcomponent>>
Master2_BT
alt
self M3
M2
: Master
: Master BT-HW : Master
con_confirm(*)
<<validationAction>>
Connect_To_Master(M1)
fail
data
data
*
ref
Good_Link_Quality
<<validationAction>>
inconc
ref
Bad_Link_Quality
con_request
con_request
con_request
con_request
con_accept
con_confirm
con_confirm
con_confirm(M3)
<<default>>
Conf_Default
ref
ref
makeList
roamingList(RList,Slave)
roamingList(RList)
T
<<validationAction>>
pass
TTCN-3 Test Case Generation from MSCs
20
UTP Outlook
 Upcoming tool support:




IBM/Rational: Eclipse Project Hyades
Telelogic: Tau G2
Microsoft: Visual Studio
Daimler/FOKUS/Nokia/TestingTech:
ITEA-Project TT-Medal
TTCN-3 Test Case Generation from MSCs
21
Overview
 Concept
 Mapping of MSC to TTCN-3
 Related Concepts
Graphical Format of TTCN-3 (GFT)
UML Testing Profile (UTP)
Comparison
 Summary
TTCN-3 Test Case Generation from MSCs
22
Comparison I
 all three concepts were based on MSC
 support of graphical test development
 differ in deepness of test features
MSC
GFT
UTP
TTCN-3 Test Case Generation from MSCs
23
Comparison II
 Test Case Generation from MSCs







centred on test purposes
is focussed on manual, scenario testing
abstracts from details
no support of all TTCN-3 features
direct mapping to test case templates
requires less knowledge about TTCN-3
timedTTCN-3 support
 GFT




MSC based representation format for TTCN-3
has to present all TTCN-3 features
timedTTCN-3 support
not desired as graphical specification language
TTCN-3 Test Case Generation from MSCs
24
Comparison III
 UTP
 representation and specification of all
aspects
 independent of TTCN-3
 no complete mapping to TTCN-3
 enhanced testing concepts
 better integration to UML
 meta-model for testing
 wide application area (mapping to JUnit and
TTCN-3)
TTCN-3 Test Case Generation from MSCs
25
Summary
 MSC as powerful means for test
purpose and test case specifications
 MSC like presentation formats
 Test case generation from MSC test
purposes
TTCN-3 Test Case Generation from MSCs
26
TTCN-3 Test Case Generation
from Message Sequence Charts
Michael Ebner
Institute for Informatics · University of Göttingen · Germany
WITUL 2004 (IEEE Conference ISSRE)
END
TTCN-3 Test Case Generation from MSCs
28
Backup
TTCN-3 Test Case Generation from MSCs
29
Autolink - Process
Test Purpose
Specification
Automatic
Computation
Interactive
Simulation
Manual
Specification
MSC
Test Purpose
Test Case
Generation
State Space
Exploration
Direct
Translation
Dynamic
Behaviour
Test Suite
Production
Constraints
TTCN-2Test Suite-Export
Test Architecture
TTCN-2Test Suite
TTCN-3 Test Case Generation from MSCs
30
Example III – Mapping of MSC
msc NamingServiceExample
SUT
Naming
Client1
testcase NamingServiceExample()
runs on Naming {
Client2
Client1.call( bindingContext )
Client1.call( bind )
Client2.call( resolve )
bindContext
bind
alt {
[] Client1.catch(InvalidName)
{
Client1.call( bind )
Client2.catch(NotFound)
Client2.call( resolve )
}
[else] {}
}
resolve
opt
InvalidName
NotFound
bind
resolve
Client1.call( unbind )
unbind
TTCN-3 Test Case Generation from MSCs
}
31
GFT Example – timedTTCN-3
Test purpose
MSC
Test behaviour
generate
mapping
TIMEDTTCN-3
Core notation
TTCN-3 Test Case Generation from MSCs
TIMEDGFT
Presentation format
32
Test Purpose Example
TTCN-3 Test Case Generation from MSCs
33
Generated Testcase
testcase InresRTexample() runs on inres {
var float sendTime1:=-1.0;
var integer iterator1:=0;
for (iterator1:=0; iterator1<100;
iterator1:=iterator1+1) {
if (sendTime1==-1.0) {
sendTime1:=self.now+0.01; }
else {
resume(sendTime1);
sendTime1:=sendTime1+0.01;
}
log(TimestampType:{self.now,"IDATreq1"});
ISAP.send(IDATreq:{"data"});
MSAP.receive(MDATind:{DT,number,"data"});
log(TimestampType:{self.now,"MDATind2"});
MSAP.send(MDATreq:{AK,number});
}
setverdict(pass);
stop;
34
TTCN-3 Test Case Generation from MSCs}
sd
sdTestRoaming_noWarning():Verdict
BT-Roaming
Master1_R
<<testcomponent>>
Master2_R
<<testcomponent>>
<<testcomponent>>
<<testcomponent>>
<<testcomponent>>
<<testcomponent>>
Master1_BT<<testcomponent>>
Master2_BT
<<SUT>>
: Slave
: Slave
sa: Slave
sr: Slave
Application BTRoaming
Application BTRoaming
<<testcomponent>>
: hw:
Slave
BT-HW
BT-HW
: co:
Location
TestServer
Coordinator
M1
: Master
:BT-HW
Master
M1 M2
M2
: Master
: Master M3: Master
: Master
: Master
BTRoaming
BTRoaming
: Master BT-HW : Master
con_request
con_accept
con_confirm
con_confirm
connected(Slave)
Connect_To_Master(M1)
ref RList:=
makeList
(Slave)
roamingList(RList,Slave)
roamingList(RList)
data
data
{0.5s
..0.5s}
get_link_quality
Good_
Link_Quality
quality(good)
get_link_quality
Bad_
Link_Quality
quality(bad)
ref newMaster:=
Search_NewMaster()
TTCN-3 Test Case Generation from MSCs
35
Use of SDL and MSC
Specification
Ideas
Customer
used to
create
modelled by
Design
Design
Interpreted as
Implementation
used to
produce
Tools
Engineers
Software
Engineers
TTCN-3 Test Case Generation from MSCs
SDL-2000
MSC-2000
executes
as
transformed
by
C++ etc.
Product
36
UML-based Test Specification I
UML
WSDL
map
map
IDL
CORBA
use
MSC
generate
ooTTCN-3
TTCN-3
TTCN-3 Test Case Generation from MSCs
37
Graphical Format for TTCN-3 (GFT)
 Provides a test specific profile for
MSC-2000
Uses a subset of MSC-2000
Defines test specific extensions
Defines general extensions
 Formerly called Test Sequence
Charts (TSC)
 Supports different forms to
represent test cases
TTCN-3 Test Case Generation from MSCs
38
UTP Methodology Wrap-Up
 Test preparations
 Define a test package with a test suite.
 Determine SUT and import its implementation.
 Determine test objectives.

Test configuration
 Assign roles: SUT, test components, utility part.
 Attach stereotypes.

Test cases






Group instances.
Attach stereotypes.
Define re-usable test fragments to functions.
Assign verdicts.
Specify timers.
Specify default behaviours
TTCN-3 Test Case Generation from MSCs
39
Use of Inline Expressions and HMSCs
 Problem
 Several alternative test sequences referred
to in one diagram.
 Two possibilities
 All alternatives are put in one test case.
 For each alternative a separate test case is
generated.
 Strategy
 Alternatives described in form of HMSCs are
translated into separate test cases.
 Alternatives described by inline expressions
are put into the same test case.
TTCN-3 Test Case Generation from MSCs
40
ToC der Dissertation
1.Introduction
2.A General Metamodel For Testing
3.Graphical Test Development (with case
study)
 With TTCN-3
 With U2TP (UML Based Metamodel)
 Relationship and Mapping Between TTCN3 and U2TP
4.Graphical Realtime Testing with TTCN-3
and U2TP (with case study)
5.Conclusion
TTCN-3 Test Case Generation from MSCs
41
UTP Outlook
 FTF submission: April 2004
 Upcoming tool support:




IBM/Rational: Eclipse Project Hyades
Telelogic: Tau G2
Microsoft: Visual Studio
Daimler/FOKUS/Nokia/TestingTech:
ITEA-Project TT-Medal
 Automated test generation
TTCN-3 Test Case Generation from MSCs
42
ToC der Dissertation
1.Introduction
2.A General Metamodel For Testing
3.Graphical Test Development (with case
study)
 With TTCN-3
 With U2TP (UML Based Metamodel)
 Relationship and Mapping Between TTCN3 and U2TP
4.Graphical Realtime Testing with TTCN-3
and U2TP (with case study)
5.Conclusion
TTCN-3 Test Case Generation from MSCs
43
Unified Modeling Language (UML) …
Anwendungsfälle
Entwickler
Einheitentest
Telephone Catalog
Check Status
Salesperson
Place Order
Klassen
Customer
Fill Orders
Shipping Clerk
Establish Credit
Supervisor
cart
Testen
client
ShoppingCart
cartOrder
1
Customer
customerOrder
1
1..*
Systemtest
0..1
0..*
Integrator
1
Account
accountOrder
OrderHeader
1
organizationOrder
account
Organization
client
ite
m
Sequenzen
*
LineItem
serviceItem
service
1
1
Zustände
productItem
{xor}
1
Service
sd N
1..*
1
order
{xor}
product
1
ReadAmountSM
Product
abort
s[u]:B
s[k]:B
selectAmount
otherAmount
m3()
m3()
Systemintegrator
TTCN-3 Test Case Generation from MSCs
amount
enterAmount
ok
abort
aborted
Integrationstest
44
... und Testen
Anwendungsfälle
Entwickler
Einheitentest
Telepho ne Catalo g
Check Statu s
Sal esperso n
Place O rd er
Klassen
Customer
Testen
Sh ipp ing Clerk
F ill Orders
Establ ish Cred it
Sup ervisor
cart
client
ShoppingCart
cartOrder
1
Customer
customerOrder
1
1..*
Systemtest
0..1
0..*
Integrator
1
Account
accountOrder
OrderHeader
1
order
{xor}
1..*
1
organizationOrder
account
Organization
client
ite
m
Sequenzen
LineItem
serviceItem
service
Service
sd N
*
1
1
productItem
{xor}
1
product
1
Zustände
ReadAmountSM
Product
abort
s[u]:B
s[k]:B
selectAmount
m3()
m3()
Systemintegrator
TTCN-3 Test Case Generation from MSCs
amount
otherAmount
Integrationstest
enterAmount
ok
abort
aborted
45
TTCN-3 Test Case Generation from MSCs
46
TTCN-3 Übersicht
ASN.1 Typen
& Werte
TTCN-3
Kernsprache
Tabellarisches
Format
IDL Typen
& Werte
Graphisches
Format
Andere Typen
& Werten
Präsentationsformatn
TTCN-3 Test Case Generation from MSCs
TTCN-3
Benutzer
47
MSC and TTCN (1)
MSC
MSC-based Presentation
Format for TTCN-3
System
specification
Test purpose
Abstract
test case
TTCN-3
Executable
test case
Test results
Assessment
TTCN-3 Test Case Generation from MSCs
48
MSC and TTCN (2)
1. Generation
MSC2000
TTCN-3
2. Presentation
Compilation
ATS
Compilation
Tracing
MSC
Simulator
TTCN-3 Test Case Generation from MSCs
TTCN-3
Validation
ETS
49
Information in MSC Test
Purposes
 Descriptions of messages to be
sent to
and received from the SUT
 Synchronization information
required due
to the partial order semantics
of MSC
TTCN-3 Test Case Generation from MSCs
50
MSC Objectives
 is a scenario language
 supports complete and incomplete
specifications
 is a graphical language
 is widely applicable
 can be used throughout the engineering
process
 supports structured design
 is often used in conjunction with other
methods and languages
TTCN-3 Test Case Generation from MSCs
51
The Tutorial Example
 INRES - Initiator-Responder protocol
 an abridged version of the Abracadabra
protocol used for academic studies and
illustrative
purposes.
 a connection-oriented, asymmetric
communication protocol
 a medium with uncorrupted data, loss
of data, misordering
TTCN-3 Test Case Generation from MSCs
52
INRES Structure
ICONreq,
IDATreq,
IDISreq,
ICONconf,
IDISind
User
ISAP1
Initiator
Responder
MSAP2
MDATreq,
MDATind
Medium
SUT (System under Test) = Initiator and Medium
TTCN-3 Test Case Generation from MSCs
53
Objectives(3)
msc
mi_synch1_conc1
MTC
ISAP1
MSAP2
MTCType
port ISAP1type
port MSAP2type
?
TTCN-3 Test Case Generation from MSCs
54
MSC Test Purpose Development View
Test System
System Under Test
TTCN-3 Test Case Generation from MSCs
55
Objektorientierung für TTCN-3
 Kein Objekttyp und Portinstanzen
können nicht übertragen werden
Objektreferenzen in IUT nicht
handhabbar
 Einführung von Klassen
 Erweiterung vorhandener Konzepte
Vererbung von Templates
 Hierarchie von Komponenten
TTCN-3 Test Case Generation from MSCs
56
Autolink - INAP CS-2 Testzweck
Präambel
SchnittSystem
stellen
SendeEreignis
EmpfangsEreignis
Postambel
TTCN-3 Test Case Generation from MSCs
57
Zusammenfassung und Ausblick
Ausblick
• Testing and Test Control Notation 3 (TTCN-3)
– Universelle Testbeschreibungssprache
– Standardisierung 2001 durch ETSI
– Entwicklung eines TTCN-3-Syntaxcheckers
• Verbesserte Modellierung der Testumgebung
– Praxis: Standard-Werte und benutzerdefinierte
Signale
– Ineffektive Suche, Nachbearbeitung von Testfällen
– Lösung: Symbolische Ausführung
– Entwicklung eines Prototypen
TTCN-3 Test Case Generation from MSCs
58
Ausblick
TTCN-3 Beispiel
TTCN-3 Test Case Generation from MSCs
59
Weitere Arbeiten
Testing and Test Control Notation 3
• Erweiterung der Anwendungsgebiete
– Testarten: Interoperabilitätstest, Performanztests, ...
– Architekturen: CORBA, APIs, ...
• Moderne, allgemeine Sprachkonzepte
–
–
–
–
C/C++-ähnliche Notation
keine OSI-spezifischen Elemente
Erweiterte Kommunikationskonzepte
Dynamische, verteilte Testarchitekturen
• Standardisierung 2001 durch ETSI
TTCN-3 Test Case Generation from MSCs
– Entwicklung des ersten freien TTCN-3-
60
ToC der Dissertation
1.Introduction
2.A General Metamodel For Testing
3.Graphical Test Development (with case
study)
 With TTCN-3
 With U2TP (UML Based Metamodel)
 Relationship and Mapping Between TTCN3 and U2TP
4.Graphical Realtime Testing with TTCN-3
and U2TP (with case study)
5.Conclusion
TTCN-3 Test Case Generation from MSCs
61
How to Test?
System
implementation
SDL/
MSC
MSC
System
specification
identify
Test purpose
TTCN
Abstract
test case
Executable
test case
specify
implement
execute
Test results
evaluate
Assessment
TTCN-3 Test Case Generation from MSCs
62
MSC and TTCN (1)
MSC
MSC-based Presentation
Format for TTCN-3
System
specification
Test purpose
Abstract
test case
TTCN-3
Executable
test case
Test results
Assessment
TTCN-3 Test Case Generation from MSCs
63
MSC and TTCN (2)
1. Generation
MSC2000
TTCN-3
2. Presentation
Compilation
ATS
Compilation
Tracing
MSC
Simulator
TTCN-3 Test Case Generation from MSCs
TTCN-3
Validation
ETS
64
Basic MSC in a Nutshell
MSC diagram
Instance
msc INRES_Example1
User
MSC heading
ISAP1
Message to
the
environment
Idle
ICONreq
MDATind
MDATreq
Condition
ICONconf
Output event
Connected
Instance
end
Input event
TTCN-3 Test Case Generation from MSCs
65
HMSC
HMSC
Start
MSC
Reference
msc INRES_Behaviour
Loop
Idle
Connecting
Connection
Point
Connected
Condition
DataTransfer
Alternative
Connected
Disconnecting
TTCN-3 Test Case Generation from MSCs
67
New challenges for TTCN (1)
 Corba and Internet Testing
 Dynamic configurations
 Addressing entities inside the SUT
 Synchronous communication
 Real-time- and performance- Testing
 Handling of load generators
 Possibility to repeat test runs
 New and improved design techniques
 Smooth interworking with
SDL'2000, MSC'2000, ASN.1'99, UML and
IDL
 Adaptation to different application areas
TTCN-3 Test Case Generation from MSCs
68
New challenges for TTCN (2)






Module and Group concept
„New “ data types
Synchronous communication
Less OSI concepts and terms
Introduction of templates
Textual base
TTCN-3 Test Case Generation from MSCs
69
TTCN-3 Test Architecture (2)
Test system
IN
Connected Ports
OUT
MTC
PTC
OUT
IN
OUT
IN
Mapped Ports
Abstract Test System Interface
OUT
IN
Real Test System Interface
System Under Test (SUT)
TTCN-3 Test Case Generation from MSCs
70
TTCN-3 Example
function internetUser () runs on InternetType {
timer Tvisit;
var integer orderNr;
var PizzaDeliveryType thePizza;
activate(StandardDefault, InternetDefault);
Tvisit.start(OverallDuration);
P2.call(StandardINetOrder, maxConnectTime) {
[] P2.getreply (INetOrder:* value *) -> value orderNr {
verdict.set(pass)
}
[] P2.catch (INetOrder, reasonType : *) {
verdict.set(fail)
}
[] P2.catch (timeout) {
verdict.set(inconc)
}
}
TTCN-3 Test Case Generation from MSCs
71
The Development of MSC
MSC-2000
MSC-96
MSC-92
before
1992
object orientation, data,
time, method calls
HMSC, references,
general ordering, inline expressions
instances, messages, events, conditions
dialects of sequence charts
TTCN-3 Test Case Generation from MSCs
72
Object Orientation
 MSC documents define instance kinds
 instance kinds are types suited for object orientation
 Inheritance
 inheritance of instance kinds means inheriting all
contained instances and MSCs
 Virtuality
 Virtual MSCs means that MSCs may be redefined in
specialized instance kinds
 Close correspondance with object orientation
in SDL and other object-oriented languages
such as Java
TTCN-3 Test Case Generation from MSCs
73
Data in MSC-2000
 MSC has no data language of its own!
 MSC can make use of data languages such
that
 fragments of your favorite (data) language can be
used (C, C++, SDL, Java, TTCN-3, ... )
 MSC can be parsed without knowing the details of
the chosen data language
 the data language strings have no unnecessary extra
delimiters
 Mappings to data languages have not yet been
made
 up to any user
 could be standardized in the future
TTCN-3 Test Case Generation from MSCs
74
Use of Data
msc Transmission (isdu: ISDUType; seq_no, try: Integer);
Initiator
Medium
Responder
 Static variables
have MSCs as
homes
seq_no:= 1-seq_no
MDATreq(DT(isdu,seq_no)=:dt)
MDATind(dt=: rec_dt)
(cannot change
 binding
Binding
within the MSC)
Check_Data(rec_dt)
MDATreq(no:=ACK(rec_no))
 Left-hand or right-hand
 in actions
MDATind(rec_no:=ACK(rec_no))
when (seq_no != rec_no)
and (try <4)
 with messages
 with MSC references
TTCN-3 Test Case Generation from MSCs
Transmission
(isdu,seq_no,try+1)
75
Method Calls
 Method Calls
 Blocking (with reply)
 Non-Blocking
 Method calls can be super-imposed
 Used to describe the control flow
between instances
TTCN-3 Test Case Generation from MSCs
76
Summary & Outlook (2)
 MSC as powerful means for test
purpose and test case specifications
in particular, extensions of MSC-2000 such
as data support and method calls are
used
 Test case generation from MSC test
purposes
direct mapping to test case templates
 MSC like presentation format for TTCN3
77
TTCN-3 Test Case Generation from MSCs
Enjoy your lunch
and
have a nice trip home! 
TTCN-3 Test Case Generation from MSCs
78
The UML 2.0 Testing Profile

Profile: UML extension mechanism

Initiated late 2001

Make UML applicable for SW testing

Adopted by OMG in June 2003

At time it is revised by the
Finalization Task Force (FTF)
TTCN-3 Test Case Generation from MSCs
79
Outlook
 FTF submission: April 2004
 Upcoming tool support:




IBM/Rational: Eclipse Project Hyades
Telelogic: Tau G2
Microsoft: Visual Studio
Daimler/FOKUS/Nokia/TestingTech:
ITEA-Project TT-Medal
 Automated test generation
TTCN-3 Test Case Generation from MSCs
80
Outline & Introduction
Test purpose
MSC
Test behaviour
generate
TIMEDTTCN-3
Core notation
mapping
TIMEDGFT
Presentation format
Presented at
1. Instrument functional testcases
to generate timestamps,
2. Execute testcase,
Testcom 2002
(Submitted for
standardisation.)
3. Apply evaluation functions to the generated timestamps,
4. Assign a test verdict.
TTCN-3 Test Case Generation from MSCs
81
TIMEDTTCN-3=TTCN-3+Time
Extensions
1. Local clock
– read (self.now), wait (resume)
2. Logfile
– log, sort, retrieve of structured data
3. Timezones
– specification of clock synchronised test
components
4. Conf-Verdict
– passconfinconcfail
TTCN-3 Test Case Generation from MSCs
82
Test Case Generation
Test purpose
MSC
Test behaviour
generate
mapping
TIMEDTTCN-3
Core notation
TIMEDGFT
Presentation format
1. Using MSC as test purpose:
•
MSC instances represent SUT and TTCN ports.
•
MSC messages depict TTCN send/receive.
2. Generating corresponding TTCN test cases.
TTCN-3 Test Case Generation from MSCs
83
Generating TIMEDTTCN-3 from MSC
 Pure functional test cases: Proven approach
and implemented by TTCN-2 tools, e.g.:
 Autolink (Telelogic)
 ptk (Motorola)
 New: generating TIMEDTTCN-3 test cases.
 MSC allows to attach time constraints to
events:
 Absolute time constraints,
 Relative time constraints,
TTCN-3 Test Case Generation from MSCs
84
Test Purpose Example
TTCN-3 Test Case Generation from MSCs
85
Generated Testcase
testcase InresRTexample() runs on inres {
var float sendTime1:=-1.0;
var integer iterator1:=0;
for (iterator1:=0; iterator1<100;
iterator1:=iterator1+1) {
if (sendTime1==-1.0) {
sendTime1:=self.now+0.01; }
else {
resume(sendTime1);
sendTime1:=sendTime1+0.01;
}
log(TimestampType:{self.now,"IDATreq1"});
ISAP.send(IDATreq:{"data"});
MSAP.receive(MDATind:{DT,number,"data"});
log(TimestampType:{self.now,"MDATind2"});
MSAP.send(MDATreq:{AK,number});
}
setverdict(pass);
stop;
86
TTCN-3 Test Case Generation from MSCs}
Graphical Test Case Specification
Test purpose
MSC
Test behaviour
generate
TIMEDTTCN-3
Core notation
mapping
TIMEDGFT
Presentation format
1. New GFT symbols.
2. One-to-one mapping between
TIMEDTTCN-3 core notation and TIMEDGFT.
TTCN-3 Test Case Generation from MSCs
87
TIMEDGFT-Example
testcase InresRTexample() runs on inres{
var float sendTime1:=-1.0;
var integer iterator1:=0;
for (iterator1:=0; iterator1<100;
iterator1:=iterator1+1) {
if (sendTime1==-1.0) {
sendTime1:=self.now+0.01; }
else {
resume(sendTime1);
sendTime1:=sendTime1+0.01;
}
log(TimestampType:{self.now,"IDATreq1"});
ISAP.send(IDATreq:{"data"});
MSAP.receive(MDATind:{DT,number,"data"});
log(TimestampType:{self.now,"MDATind2"});
MSAP.send(MDATreq:{AK,number});
}
setverdict(pass);
stop;
}
TTCN-3 Test Case Generation from MSCs
88
TIMEDGFT
 Overview: New GFT symbols and
mapping TIMEDTTCN-3 TIMEDGFT:
TIMEDTTCN-3
TTCN-3 Test Case Generation from MSCs
TIMEDGFT
89
TIMEDGFT (continued)
TIMEDTTCN-3
TTCN-3 Test Case Generation from MSCs
TIMEDGFT
90