# User guides
TDL and TOP can be used in different ways. Depending on the specific goals, different parts of TDL and TOP may be relevant for a given usage scenario. For different starting points and end goals, the following common use cases may come into question:
- [Selected TOP user scenarios](UserScenarios.md#selected-top-user-scenarios)
- [User control of the analysis level](UserScenarios.md#sec-user-control-of-the-analysislevel)
- [Textual modelling](UserScenarios.md#sec-textual-modelling)
- [TDL Wizards and Perspective](UserScenarios.md#sec-tdl-wizards-and-perspective)
- [Graphical modelling](UserScenarios.md#sec-graphical-modelling)
- [Importing protocol specifications](UserScenarios.md#sec-importing-protocol-specifications)
- [Using TDL with OpenAPI™ Specifications](UserScenarios.md#sec-using-tdl-with-openapi-specifications)
- [Using TDL with ASN.1 Specifications](UserScenarios.md#sec-using-tdl-with-asn-specifications)
- [Using TDL with YANG Specifications](UserScenarios.md#sec-using-tdl-with-yang-specifications)>
- [Creating test objectives based on TDL meta-model](UserScenarios.md#sec-creating-test-objectives-based-on-tdl-meta-model)
- [Unified Definition of Test Puposes and Test Descriptions](UserScenarios.md#unified-definition-of-test-purposes-and-test-descriptions)
- [Generate TD from TO](UserScenarios.md#sec-generate-td-from-to)
- [Export to Word](UserScenarios.md#sec-export-to-word)
- [Conversion to TTCN-3](UserScenarios.md#sec-conversion-to-tttn3)
- [Defining Structured Test Objectives](UserScenarios.md#sec-defining-structured-test-objectives)
- [Defining Test Descriptions](UserScenarios.md#sec-defining-test-descriptions)
[Defining structured test objectives (or test purposes) with the help of TDL-TO.]
- Transforming existing structured test objectives in TDL-TO into TDL test descriptions.
- Defining test descriptions with the help of TDL.
- Transforming existing test descriptions in TDL into TTCN-3 test cases.
- Transforming existing test descriptions in TDL into a target execution language (see clause 9).
- Using existing interface specifications in OpenAPI™ with TDL (see clause 8.2).
- Using existing protocol specifications in ASN.1 with TDL (see clause 8.3).
## Selected TOP user scenarios
6.2
### 6.2.1 Overview
This clause describes a set of user scenarios that illustrate just how the features of the TOP tools can be used for specific testing tasks.
### 6.2.2 User control of the analysis level
1. **Usage scenario:** The user saves and re-opens an incomplete TDL specification. The incomplete specification and associated analysis results are maintained.
2. **Usage scenario:** Incompatible assignment of types, e.g. assignment of a boolean value to integer type or exceeding the limit of a restricted list type (collection).
3. **Usage scenario:** The user may set the level of analysis performed by TOP tool when developing the TDL test model.
From the TDL toolbar shown in [Figure TDL toolbar](#figure-TDL-toolbar) the analysis level of the specification can be set.
| OpenAPI™ | Type in TDL | Constraints | Formats and Patterns |
|---|---|---|---|
| integer | integer | OpenAPIFormat | int32, int64 |
| number | String | OpenAPIFormat | float, double |
| string | String | OpenAPIFormat | e-mail, password |
| boolean | Boolean |
components:
schemas:
LibraryBook:
type: object
properties:
title:
type: string
authors:
type: array
items:
type: string
reviewers:
type: array
items:
type: string
Library:
type: object
properties:
address:
type: string
books:
type: array
items:
$ref: '#/components/schemas/LibraryBook'
Type LibraryBook (
String title,
LibraryBook___authors authors,
LibraryBook___reviewers reviewers
)
Collection LibraryBook___authors of String
Collection LibraryBook___reviewers of String
Type Library (
String address,
Library___books books
)
Collection Library___books of LibraryBook
Use "mapping_conventions.yaml" as SOURCE_MAPPING
Use "generated/java" as TARGET_MAPPING
Map LibraryBook to "#/components/schemas/LibraryBook"
in SOURCE_MAPPING as LibraryBook_SOURCE_MAPPING
Map LibraryBook to "LibraryBook"
in TARGET_MAPPING as LibraryBook_TARGET_MAPPING
Map Library to "#/components/schemas/Library"
in SOURCE_MAPPING as Library_SOURCE_MAPPING
Map Library to "Library"
in TARGET_MAPPING as Library_TARGET_MAPPING
| ASN.1 Type | Type in TDL | Constraints | Patterns | Examples |
|---|---|---|---|---|
| BITSTRING | BITSTRING | ASN1String | [0|1]+'B | "1101'B", also "Named BITS" () |
| OCTETSTRING | OCTETSTRING | ASN1String | [A-F|0-9]+'H | "A3B2'H", "10010'B" |
| BMPString | BMPString | ASN1String | 16 bit Character | |
| IA5String | IA5String | ASN1String | 8 bit ASCII | "Hallo" |
| GeneralString | GeneralString | ASN1String | all graphic/character sets, SPACE, DELETE | |
| NumericString | NumericString | ASN1String | [0-9, SPACE]+ | "34 8" |
| PrintableString | PrintableString | ASN1String | [a-z,A-Z,'()+,-.?:/=,SPACE] | |
| TeletexString | TeletexString | ASN1String | CCITT T.101 | |
| T61String | T61String | ASN1String | CCITT T.101 | |
| UniversalString | UniversalString | ASN1String | ISO10646 | |
| UTF8String | UTF8String | ASN1String | ASCII + Control | |
| VideotexString | VideotexString | ASN1String | CCITT T.100, T.101 | |
| VisibleString and ISO646String | VisibleString | ASN1String | ASCII Printing | |
| UTCTime | UTCTime | ASN1DateTime | YYMMDDhhmm[ss]Z | "991231235959+0200" |
| GeneralizedTime | GeneralizedTime | ASN1DateTime | YYYYMMDDHH[MM[SS[.fff]]]Z (ISO 8601 [i.38]) | "20200425175522.214+0200" |
| DATE | Date | ASN1DateTime | YYYY-MM-DD | "1636-09-18" |
| TIME-OF-DAY | TimeOfDay | ASN1DateTime | HH:mm:ss | "18:30:23" |
| DATE-TIME | DateTime | ASN1DateTime | YYYY-MM-DDThh:mm:ss | "2000-11-22T18:30:23" |
| INTEGER | Integer | |||
| REAL | String | ASN1Real | ||
| BOOLEAN | Boolean | |||
| NULL | Null | |||
| OBJECT IDENTIFIER | ObjectIdentifier | ASN1ObjectIdentifier | id-ssp OBJECT IDENTIFIER ::= { itu-t (0) identified-organization (4) etsi (0) smart-secure-platform (3666) part1 (1) } |
|
| RELATIVE OBJECT IDENTIFIER | ObjectIdentifier | ASN1ObjectIdentifier | Relative_id_ssp RELATIVE-OID ::= { smart-secure-platform (3666) part1 (1) } |
NodeDescriptor ::= SEQUENCE
{
aNodeName NodeName, -- Node name
aShortName UUID, -- Short node name
aNode CHOICE
{
aLink SEQUENCE
{
aLinkedFileIdentity NodeIdentity, -- Identity of the linked SSP file
aLinkedFileSize FileSize -- Size of the linked SSP file
},
aFile SEQUENCE
{
aFileSize FileSize -- Size of the SSP file
},
aDirectory SEQUENCE
{
}
},
aMetaData SEQUENCE OF MetaDatum OPTIONAL, -- Optional meta data
aACL SET OF AccessControl OPTIONAL -- Access Control List attribute
}
/* Node identity */
NodeName ::= UTF8String (SIZE(1..16)) -- node name encoded in UTF-8
NodeReference ::= SEQUENCE (SIZE(1..6)) OF NodeName -- pathname and node name
NodeIdentity ::= CHOICE
{
aShortName UUID, -- UUID of file reference using absolute pathname
aNodeReference NodeReference -- Node reference
}
Type NodeDescriptor (
aNodeName of type NodeName,
aShortName of type UUID ,
aNode of type NodeDescriptor___aNode ,
optional aMetaData of type NodeDescriptor___aMetaData ,
optional aACL of type NodeDescriptor___aACL
);
Type NodeDescriptor___aNode { union } (
aLink of type NodeDescriptor___aNode___aLink,
aFile of type NodeDescriptor___aNode___aFile ,
aDirectory of type NodeDescriptor___aNode___aDirectory
);
Collection NodeDescriptor___aMetaData of type MetaDatum;
Collection NodeDescriptor___aACL of type AccessControl;
Type NodeIdentity { union } (
aShortName of type UUID,
aNodeReference of type NodeReference
);
Collection NodeReference of type NodeName;
Type NodeDescriptor___aNode___aLink (
aLinkedFileIdentity of type NodeIdentity,
aLinkedFileSize of type FileSize
);
Type NodeDescriptor___aNode___aFile (
aFileSize of type FileSize
);
Library ::= SEQUENCE {
address UTF8String DEFAULT "Sophia-Antipolis, France",
documents SEQUENCE OF Document
}
Document ::= SEQUENCE {
title UTF8String (SIZE(1..128)),
status ENUMERATED {draft, published, historical},
authors SEQUENCE OF UTF8String,
number CHOICE {
es INTEGER,
eg INTEGER,
tr INTEGER
} OPTIONAL,
updated DATE
}
Type Library (
address of type UTF8String,
documents of type Library___documents
);
Type Document (
title of type UTF8String,
status of type Document___status ,
authors of type Document___authors ,
optional number of type Document___number ,
updated of type Date
);
Collection Library___documents of type Document;
Collection Document___authors of type UTF8String;
Type Document___number { union } (
es of type Integer,
eg of type Integer ,
tr of type Integer
);
Enumerated Document___status {
Document___status draft;
Document___status published;
Document___status historical;
}
Use "example-1-library.asn" as SOURCE_MAPPING;
Map Library to "Library" in SOURCE_MAPPING as Library_MAPPING;
Map Document to "Document" in SOURCE_MAPPING as Document_MAPPING;
Objective TO_MOVE_OBJECT_UNIFIED {
Description: "Move object to destination with unified test purpose description."
}
Test Purpose Description TP_MOVE_OBJECT_UNIFIED {
Objective: TO_MOVE_OBJECT_UNIFIED
Configuration: basic
Expected behaviour
ensure that {
when {
perform action: "the Controller sends the starting position"
} then {
perform action: "the Object moves to the requested position"
}
}
}
Test Purpose Description TP_MOVE_OBJECT_UNIFIED {
Objective: TO_MOVE_OBJECT_UNIFIED
Configuration: basic
Expected behaviour
ensure that {
when {
perform action: "the Controller sends the starting position"
controller::wifi sends "x=21, y=21" to object::wifi
} then {
perform action: "the Object moves to the requested position"
controller::wifi receives "x=21, y=21" from object::wifi
}
}
}
Test Purpose Description TP_MOVE_OBJECT_UNIFIED {
Objective: TO_MOVE_OBJECT_UNIFIED
Configuration: basic
Expected behaviour
ensure that {
when {
perform action: "the Controller sends the starting position"
controller::wifi sends position (x = 21, y = 21) to object::wifi
} then {
perform action: "the Object moves to the requested position"
controller::wifi receives position (x = 21, y = 21) from object::wifi
}
}
}
Objective: TO_MOVE_OBJECT_UNIFIED
Test Description TP_MOVE_OBJECT_UNIFIED uses basic {
@Expected behaviour
{
@when
{
perform action : "the Controller sends the starting position"
controller::wifi sends position ( x = 21, y = 21 ) to object::wifi
}
@then
{
perform action : "the Object moves to the requested position"
object::wifi sends position ( x = 21, y = 21 ) to controller::wifi
}
}
}
Domain {
pics:
- NONE
;
entities:
- EPC_PCRF_A
- EPC_PCRF_B
- EPC_PGW_A
- EPC_PGW_B
- EPC_MME_A
- EPC_MME_B
- IMS_HSS_A
- IMS_HSS_B
;
events:
- receives
- sends
- triggers
- detachment
- invokes
- create_session_request
- delete_session_request
- termination_SIP_signalling_session
;
Data {
type DiameterMessage;
}
Configuration {
Interface Type defaultGT accepts DiameterMessage;
Component Type DiameterComp with gate g of type defaultGT;
Test Configuration CF_VxLTE_INT
containing
Tester component EPC_PGW_A of type DiameterComp
Tester component EPC_PCRF_A of type DiameterComp
SUT component IMS_A of type DiameterComp
connection between EPC_PGW_A.g and EPC_PCRF_A.g
;
Test Configuration CF_VxLTE_RMI
containing
Tester component EPC_PCRF_A of type DiameterComp
Tester component EPC_PCRF_B of type DiameterComp
SUT component IMS_A of type DiameterComp
connection between EPC_PCRF_A.g and EPC_PCRF_A.g
;
}
Package TP_RX {
import all from Sip_Common;
import all from Diameter_Common;
Test Purpose {
TP Id TP_RX_PCSCF_STR_05
//TP_EPC_7002_21 from ETSI TS 103 029 V5.1.1
Test objective "Verify that IUT after reception of 486 response sends an ST-Request at originating leg."
Reference
"ETSI TS 129 214 (V15.6.0) [i.27], clauses 4.4.4"
Config Id CF_VxLTE_INT
PICS Selection NONE
Initial conditions with {
the UE_A entity isAttachedTo the EPC_A and
the UE_A entity isRegisteredTo the IMS_A
}
Expected behaviour
ensure that {
when {
the IMS_P_CSCF_A entity receives a 486_Response_INVITE
from the IMS_S_CSCF_A entity
}
then {
the IMS_P_CSCF_A entity sends the STR containing
Session_Id_AVP;
to the EPC_PCRF_A entity
}
}
}
}
Package data {
Data {
type float;
type position with x of type float, y of type float;
float -22;
float -21;
position startingPosition containing x indicating value -21;
}
}
Package data {
Type float ;
Type position ( x of type float , y of type float ) ;
float -22 ;
float -21 ;
position startingPosition ( x = -21 ) ;
}
when {
the Controller entity sends the start position containing
x indicating value 22,
y indicating value 21
;
} then {
the Object entity moves_to the received start position
}
Package inferred_data {
Type inferred_simple ;
Type inferred_position ( x of type inferred_simple, y of type inferred_simple) ;
inferred_simple 22 ;
inferred_simple 21 ;
inferred_position inferred_start_position ( x = 22, y = 21 ) ;
}
Package base_configuration {
import all from data;
Configuration {
Interface Type wireless accepts position;
Component Type unit with gate wifi of type wireless;
Test Configuration basic containing
Tester component controller of type unit
SUT component object of type unit
connection between controller.wifi and object.wifi
;
}
}
Package base_configuration {
Import all from data ;
Gate Type wireless accepts position ;
Component Type unit having {
gate wifi of type wireless ;
}
Test Configuration basic {
create Tester controller of type unit ;
create SUT object of type unit ;
connect controller.wifi to object.wifi ;
}
}
Package inferred_configuration {
Import all from data
Gate Type inferred_gate_type accepts inferred_position ;
Component Type inferred_component_type having {
gate inferred_gate of type inferred_gate_type ;
}
Test Configuration inferred_move_object {
create Tester Controller of type inferred_component_type ;
create SUT Object of type inferred_component_type ;
connect Controller.inferred_gate to Object.inferred_gate ;
}
}
Test Purpose {
TP Id TP_MOVE_OBJECT_LITERAL
Test objective "Move object to destination with literal values."
Expected behaviour
ensure that {
when {
the Controller entity sends the start position containing
x indicating value 22,
y indicating value 21
;
} then {
the Object entity moves_to the received start position
}
}
}
Action move_to (position of type inferred_position);
Test Description TD_MOVE_OBJECT_LITERAL uses configuration inferred_move_object {
Controller.inferred_gate sends inferred_start_position to Object.inferred_gate;
perform action move_to (position = inferred_start_position) on Object;
}
Action move_to (position of type inferred_position);
Test Description TD_MOVE_OBJECT_LITERAL_INLINE uses configuration inferred_move_object {
Controller.inferred_gate sends new inferred_position (x = 22, y = 21) to Object.inferred_gate;
perform action move_to (position = new inferred_position (x = 22, y = 21)) on Object;
}
the IUT entity receives a SUBSCRIBE message containing
payload containing
filterLength corresponding to TOPIC_FILTER_LEN_SEC_CVE_01,
topic_filter corresponding to TOPIC_FILTER_LEN_SEC_CVE_01;;
from the ATTACKER_CLIENT entity
Data {
UTF8String TOPIC_FILTER_SEC_CVE_01; // topic filter used in TP_MQTT_BROKER_SEC_CVE_001
Int16 TOPIC_FILTER_LEN_SEC_CVE_01; // corresponds to lengthof(TOPIC_FILTER_SEC_CVE_01) + 1
}
Type SUBSCRIBE_message (
payload of type SUBSCRIBE_message_payload
) ;
Type SUBSCRIBE_message_payload (
filterLength of type Int16 ,
topic_filter of type UTF8String
) ;
Test Description TC_MOVE_TO (target_position of type inferred_position)
uses configuration inferred_move_object {
Controller.inferred_gate sends parameter target_position to Object.inferred_gate;
perform action move_to (position = parameter target_position) on Object;
}
Test Description TC_MOVE_AROUND
uses configuration inferred_move_object {
execute TC_MOVE_TO (target_position = start_position);
execute TC_MOVE_TO (target_position = open_position);
execute TC_MOVE_TO (target_position = closed_position);
execute TC_MOVE_TO (target_position = end_position);
}
//data types
Type SESSIONS (id1 of type Integer, id2 of type Integer);
Type MSG (ses of type SESSIONS, content of type String);
//data instances
SESSIONS s1(id1 = 1, id2 = 2);
SESSIONS s2(id1 = 11, id2 = 22);
MSG msg1(ses = s1, content = m1);
//value data instances
SESSIONS c_s1(id1 = 1, id2 = 2) with {VALUE;};
MSG c1(ses = s1, content = c1) with {VALUE;};
Component Type ct having {
//variables
variable v1 of type MSG with {VALUE;};
variable v2 of type MSG;
gate g of type gt;
}
//data types
type record SESSIONS {
integer id1,
integer id2
}
type record MSG {
SESSIONS ses,
charstring content
}
//templates
template SESSIONS s1 := {id1:=1, id2:=2}
template SESSIONS s2 := {id1:=11, id2:=22}
template MSG msg1 := {ses := s1, content := "m1"}
//value -> constant
const SESSIONS c_s1 := {id1:=1, id2:=2}
const MSG c1 := {ses := c_s1, content := "c1"}
type component ct {
//variables
var MSG v1;
var template MSG v2;
port gt g;
}
Gate Type defaultGT accepts
ACK, PDU, PDCCH, C_RNTI, CONFIGURATION ;
Component Type defaultCT having {
gate g of type defaultGT;
}
Test Configuration defaultTC {
create Tester SS of type defaultCT;
create SUT UE of type defaultCT ;
connect UE.g to SS.g ;
}
type port defaultGT_to_map message {
//this is a port type for SUT-Tester connections
inout charstring, PDCCH /* ACK, PDU, C_RNTI, CONFIGURATION ; */
}
type port defaultGT_to_connect message {
//this is a port type for Tester-Tester connections
inout charstring, PDCCH /* ACK, PDU, C_RNTI, CONFIGURATION ; */
}
type component MTC_CT {
//component type for MTC
//variable for the PTC(s) --TESTER component(s) in TDL
var defaultCT TESTER_SS;
}
type component defaultCT {
port defaultGT_to_map g_to_map;
port defaultGT_to_connect g_to_connect;
}
function defaultTC() runs on MTC_CT {
// Test Configuration defaultTC, mappings, connections
TESTER_SS := defaultCT.create;
map (TESTER_SS:g_to_map,system:g_to_map);
}
Test Description Implementation TD_7_1_3_1
uses configuration defaultTC {
SS.g sends pdcch (c_rnti=ue) to UE.g;
SS.g sends mac_pdu to UE.g;
UE.g sends harq_ack to SS.g with {
test objectives : TP1 ;
};
set verdict to PASS ;
SS.g sends pdcch (c_rnti=unknown) to UE.g;
SS.g sends mac_pdu to UE.g;
alternatively {
UE.g sends harq_ack to SS.g ;
set verdict to FAIL ;
} or {
gate SS.g is quiet for five ;
set verdict to PASS ;
} with {
test objectives : TP2 ;
}
}
altstep to_handle_deviations_from_TDL_description_AS () {
[] any port.receive {
setverdict(fail);
mtc.stop;
}
//if nothing happens, a timer is started
//before every receive instruction
//and the timer is here
//or we can leave the timeout for
//the execute instruction called with the optional
//timer parameter - but in this case
//the final verdict will be 'error'
}
altstep quiescence_handler_AS (timer quiescence) {
//for all quiescence that is not connected to a gate
[] any port.receive{
setverdict(fail);
mtc.stop;
}
[] quiescence.timeout {
setverdict(pass);
}
}
function behaviourOfTESTER_SS() runs on defaultCT {
timer quiescence;
activate(to_handle_deviations_from_TDL_description_AS());
g_to_map.send(modifies pdcch := {c_rnti := ue})
g_to_map.send(mac_pdu);
g_to_map.receive(harq_ack);
setverdict(pass);
/*Test Objective Statisfied: TP2 */
g_to_map.send(modifies pdcch := {c_rnti := unknown});
g_to_map.send(mac_pdu);
quiescence.start(five);
alt{
[] g_to_map.receive(harq_ack){
setverdict(fail);
}
[] quiescence_handler_AS(quiescence);
/*Test Objective Statisfied: TP2 */
}
}
testcase TD_7_1_3_1() runs on MTC_CT
system defaultCT
{
activate(to_handle_deviations_from_TDL_description_AS());
defaultTC();
TESTER_SS.start(behaviourOfTESTER_SS());
all component.done;
}