Comparing

TTCN-3 and TTCN-2
TTCN-3 User Conference
May 3
rd
-May 5
th
,2004
Sophia Antipolis
Ìntroduction
· Standards
· Presentation Formats
· Structure
· Types
· Comparing TTCN-3 and TTCN-2
syntax!
· Migrating to TTCN-3?
· Conclusions
2
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
What's in a Name?
3
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
Standards
4
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)

TTCN-2
ETSI ISO/ITU-T
TR101 666 IS9646-3/
X.292
Tic The Tree and Tabular Combined Notation (TTCN) Ed 2¹¹
TTCN-3
ETSI ITU-T
ES 201 873-1 Z.140 Part 1: TTCN-3 Core Language.
ES 201 873-2 Z.141 Part 2: TTCN-3 Tabular Presentation Format (TFT)
ES 201 873-3 Z.142 Part 3: TTCN-3 Graphical Presentation Format (GFT).
TR 201 873-4 Z.143 Part 4: TTCN-3 Operational Semantics.
ES 201 873-5 Z.144 Part 5: TTCN-3 Runtime InterIace (TRI)
ES 201 873-6 Z.145 Part 6: TTCN-3 Control InterIace (TCI)
TR101-874 -
TTCN-3: TTCN-2 to TTCN-3 Mapping (incomplete details)
Presentation Formats
5
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
TTCN-2
MP/ BNF + $Keywords
TTCN-3
GR / Tabular
Core Notation / Text
TFT / Tabular
GFT / MSC-like
Other Format(s)
Other Format(s) ?
Yes, but.
Structure
6
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
Types
7
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
Types
· TTCN-2 & TTCN-3 are weakly typed
languages
· TTCN-3 provides extensive type compatibility
rules
· TTCN-3 adds several new types
For convenience
For better harmonization with ASN.1
8
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
Basic Types
CIass of type TTCN-3 TTCN-2
integer ÌNTEGER
fIoat -
booIean BOOLEAN
objid OBJECTÌD
Simple basic types
verdicttype R_type
bitstring BÌTSTRÌNG
hexstring HEXSTRÌNG
octetstring OCTETSTRÌNG
charstring -
Basic string types

universaI charstring -
record Structure type
(PDU,ASP,CM)
record of -
set -
set of -
enumerated -
Structured types
union PDU (subset)
Special data types anytype -
address -
port PCO, CP
Special configuration types
component (generic)
Special default types defauIt -

9
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
New TTCN-3 Types
· addressprovides access to SUT internals.
· port replaces TTCN-2 PCO and CP types
· component adds the concept oI component types
· record replaces TTCN-2 structured type. ASN.1
type. and tabular and ASN.1 ASP. PDU and CM
types (8 types in all) (no implicit Iields)
· 'Arrays¨ Although strictly not a type. single and
multi-dimensional support Ior arrays was added
10
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
New Types Ior use with ASN.1
· Adds:
char. charstring. universal charstring.
record |oI| (SEQUENCE |OF|)
set |oI| ( SET |OF|)
union (CHOICE)
Iloat (REAL)
enumerated (ENUMERATED)
Parameterization
12
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
TTCN-2 TTCN-3
Element Pars Element Equiv Permitted
Test Suite Operations
Predefined TSO CBV function predefined in in
TSOP CBV function user defined in in. out. inout
TSO CBV external function in in. out. inout
Constraint CBV template in in
Encoding
variation
CBV with ] variant "variant
rule" ]
in not possible
Invalid encoding

CBV function in in. out. inout
Global Test Steps

CBR
1
altstep in
a
.inout in. out. inout
Local Test Steps
2
CBR
3
altstep in
b
. inout in. out. inout
Default Step CBR default altstep (used in
activate only)
in
4
in. out. inout
5


1 The call by value (CBV) mechanism is used Ior test steps (global or local) with Iormal parameters when they are
reIerenced in a CREATE construct;
2
TTCN-3 does not support local altsteps. This would be a useIul addition;
3
TTCN-3 modules and test cases can be parameterised;
4
TTCN-2 uses CBR and TTCN-3 uses CBV;
5
DeIaults must be replaced with direct altstep reIerences to provide equivalency.

Scope
13
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
÷ TTCN-2: Two levels of scope
· Global for TSVs*, TSCs, TSPs, TCVs*, and
· Local for variables in TSOPs & ÌFEOD
÷ TTCN-3: Seven levels of scope
· Module
· Control Part
· Components
· Functions
· Altsteps
· Test cases and
· Blocks of statements
TSV: Test Suite Variable
TCV: Test Case Variable
TSC: Test Suite Constant
TSP: Test Suite Parameter
TSOP: Test Suite Operation Procedure
ÌFEOD:Ìnvalid Field Encoding Operation
Description
* Exceptions not visible in:
·constraints,
·TSOPs,
·ÌFEODs
Change = Big Returns?
14
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
· Modernizing: New look & feel
÷ Lower case reserved wordsimproved
readability
÷ Object Oriented-like syntax
÷ Clear separation of TTCN-3 & ASN.1
÷ Removing cryptic & OSÌ centric notation
÷ Eliminating duplicate information
÷ Left to right order of evaluation
÷ Simpler verdict assignment rules
Timers
15
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)

Timer
Name
Duration Unit
1
Comment
MyTimer 1 Duration: integer (optional)

Unit: . . . . s.
(mandatory).
1

Time units include: (picosecond),
(nanosecond), (microsecond), (millisecond),
(second) and (minute).
timer myTimer := 0.001; // TTCN-3 timer 1ms
TTCN-3 timers always have a base unit of second
Send & Receive
16
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
Verdicts
17
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
Current vaIue of New verdict assignment vaIue
Verdict pass inconc faiI none
none pass inconc faiI none
pass pass inconc faiI pass
inconc inconc inconc faiI inconc
faiI faiI faiI faiI faiI

TTCN-3 adopts the preliminary verdicts as used in TTCN-2.
TTCN-3 adds the 'error' verdict which can only be set by the test
System (caused by a test case execution). Cannot be set by use of
setverdict();
NOTE: TTCN-3 does not provide the global R variable as in TTCN-2.
Care must be taken if this is used in a test suite.
Sequential Behaviour
18
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
S1;
S2;
S3;
S4;
S5;
S6;
Or preferably:
S1 S2; S3; S4; S5; S6
TTCN-3 is a free format notation
S1;
S2;
S3;
S4;
S5;
S6;
Or preferably:
S1 S2; S3; S4; S5; S6
TTCN-3 is a free format notation
S1
S2
S3
S4
S5
S6
TTCN-2 uses indentation
S1
S2
S3
S4
S5
S6
TTCN-2 uses indentation
TTCN-3
TTCN-2
S1 S2 S3 S4 S5 S6
S1
S2
S4
S7
S5
S8
S9
S10
S3
S6
S1
S2
S4
S7
S5
S8
S9
S10
S3
S6
Alternative Behaviour
19
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
S1 alt {
[] S2alt {
[] S4S7
[] S5S8alt {
[] S9
[] S10
}
}
[] S3S6
}
S1 alt {
[] S2alt {
[] S4S7
[] S5S8alt {
[] S9
[] S10
}
}
[] S3S6
}
S4
S1
S3
S6
S2
S7
S5
S8
S9 S10
TTCN-3 TTCN-2
S2&S3, S4&S5, and
S9&S10 are alternatives
S1,S2,S4,S7.
S1,S2,S5,S8,S9.
S1,S2,S5,S8,S10. and
S1,S3,S6. are the possible
event sequences.
Why Migrate to TTCN-3?
· TTCN-3 is superior to TTCN-2
· Number oI tool vendors to choose Irom
increasing
· Good tools exist Ior:
Development
Conversion Irom TTCN-2 to TTCN-3
20
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
Why Migrate to TTCN-3?
· TTCN-3`s new look&Ieel and Java/C¹¹ like
syntax is expected to lower developers & testers
resistance to its use.
· Which:
Should help break down the usually disioint product
development/test process
Should encourage re-use. sharing oI tests. and improve
the team`s overall product knowledge
Should improve team Ilexibility (developers/testers
may be interchanged)
Should lead to shorter test suite development time
21
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)
Conclusions
· TTCN-3 is a superior solution to TTCN-2
· TTCN-2 will continue to exist Ior a Iew years
· Migration Irom TTCN-2 to TTCN-3 will be gradual
· To ensure TTCN-3`s evolution and continued success tool vendors
must:
Provide input to. and oIIer continued support to standards bodies.
Provide aIIordable. innovative. & timely solutions which meet user needs.
OIIer user Iriendly. simple to use. & high quality tools.
Promote use oI TTCN-3 by:
· Keeping their tools aligned to the evolving standards.
· OIIering proIessional training and quality support.
· TTCN-3 provides organizations with the ability to design and architect
well engineered test systems!
22
May3rd-May5th. 2004
Comparing TTCN-3 and TTCN-2
(Claude Desroches)

!
# # $ # " " # # & ' # # " %

"

(

) * ( .

+% " -. +% " -. . /) " /) " " /) " /) " /) " /) " 0 0 0 0 0 0 "1 1 1 1 1 #1 + 4 5 ! * 2 0 0 % $ $ ) 3 3 ) !$ $ .!" " ### $ &# # ' % ()& * * + . ! " -. " +% " -. 6 6 . # !" " -. 3 43 ) +% " -. +% " -.

& % . 6" 4% ./ % 0 12 3 45 .- . -( 8 % .$ $. 7 8 9 % 6": . 6" % .

" " # .

. .

. =3 . =3 * > 9 : < . 9 9 ?% ) " * - .7 7 7 8 .

> $ $ - $ . " & ." > 6 " $8 $ . 8/ . ! = > 5? / ! 5! 4 @. 5 4. / 88< . 5! 4 / "" "" . 5! 4 A 8 .@ 6 ! .

% B 0 5 6 ) 0 ?% ) " .9 7 7 7 7 A A A A * 7 C? DA? ?% ) ?% 0 B " 0 6 6 9 " .

= E6 % F +GB+ +E F 53 = E6 % E F F + 53 = H5$ + =6 !+?2 = + B +!? + .9 7 ? 1 6 9 ?% ) " = .

!+? + @I J ) * 9 6 * J 6 * J 9 6 9 6 @! * @IJ 9 6 . K .$ ! ! ! ! $ $ + * . / ! ! .. . ) " . 1 2 " 6 3 4 B " # % &' () ( " " * " " * " " " " 4 " " " " " 0 3 * .

8>+ D ! % .C #4 6 #< + 3 D D E F 6 $ E F 8$ G ! %.8> " " .& D 6 + # # 8$ #! %. 8 > F.8> C + # " # $ # # %" # # #/ 7 D D E+ " E 6 E+ E 6 + " $+ " $ 8$+ " 8 $ ! %.

C< C D ( D B + 3 D 7 7G 3 & G J K G8 ! " D " " " .H/ 5 " # C< 3 6 C 86I 8 C C5 D C.

. 3 D 6 " K " .B " " 1 B 1 ) " " . H . " J - + J KL. . . " + .. .

G5 D "# .

+ . .L - 6 " D " 6 7 " 6 5D 6 " J J ". " .E D M 6 * D 3 & " " 6 J 6 6 J D 8 .

N" ! / " D " # $ "- .

D / ! " % ' & # $ D " ! ( G OG K K K K K D G D PJ Q OJ Q KJ RJ N" 6 J $ $ %& %& %& %& %& %& ! ! %& %& %& %& ' ' ' ' %& %& ' ' $ $ " " # # $ $ ! ! " " # # "& .

M * 6 . .L 7 7 7 4 = = . < 61 6 6 .

= % = % * = % . : 9 6 <* * : 9 ' 6 . 8 7 L = % . ' P M : 86 9 ) O. : . N . . " .L 7 N 9 < < 1 . ' . .

8 *1 . . . * 9 8 K ) ) 6 6 6 * 6 6 6 6 . < 6 69 9 * . 56 6 0 9 6 N . > R 9 * . K 7 Q 7 56 6 7 9 . 0 .7 7 7 7 1 = = = = 0 .