On naming conventions
TTCN-3 can be considered a programming language where
users should consider best programming practices when developing code.
The selection of common naming conventions for identifiers are for
example one simple and often used
mechanism to implement test suites which are consistent,
maintainable, and understandable to multiple users involved in a project.
ETSI has investigated this issue and developed the
naming conventions which are shown here in the context of the IP testing
project. The use of these particular naming conventions is not binding
when using TTCN-3. They are just
intended to give visitors of this site an idea of how they could develop
their own naming conventions. Next to such general naming conventions it is
also wise to develop more project specific naming conventions for, e.g.,
application or protocol specific identifiers, etc.
Example 1: ETSI Generic
Naming Conventions
|
Language element |
Naming convention |
Prefix |
Example identifier |
Notes |
|
Module |
Use upper-case initial letter |
none |
IPv6Templates |
|
|
Group within a module |
Use lower-case initial letter |
none |
messageGroup |
|
|
Data type |
Use upper-case initial letter |
none |
SetupContents |
|
|
Message template |
Use lower-case initial letter |
m_ |
m_setupInit |
Note 1 |
|
Message template with wildcard or matching
expression |
Use lower-case initial letters |
mw_ |
mw_anyUserReply
|
Note 2 |
|
Modifying message template |
Use lower-case initial letter |
md_ |
md_setupInit |
Note 1 |
|
Modifying message template with wildcard or matching
expression |
Use lower-case initial letters |
mdw_ |
mdw_anyUserReply
|
Note 2 |
|
Signature template |
Use lower-case initial letter |
s_ |
s_callSignature |
|
|
Port instance |
Use lower-case initial letter |
none |
signallingPort |
|
|
Test component instance |
Use lower-case initial letter |
none |
userTerminal |
|
|
Constant |
Use lower-case initial letter |
c_ |
c_maxRetransmission |
|
|
Constant (defined within component type) |
Use lower-case initial letter |
cc_ |
cc_minDuration |
|
|
External constant |
Use lower-case initial letter |
cx_ |
cx_macId |
|
|
Function |
Use lower-case initial letter |
f_ |
f_authentication() |
|
|
External function |
Use lower-case initial letter |
fx_ |
fx_calculateLength() |
|
|
Altstep
(incl. Default) |
Use lower-case initial letter |
a_ |
a_receiveSetup() |
|
|
Test case |
Use ETSI numbering |
TC_ |
TC_COR_0009_47_ND |
Note 3 |
|
Variable (local) |
Use lower-case initial letter |
v_ |
v_macId |
|
|
Variable
(defined within a component type) |
Use lower-case initial letters |
vc_ |
vc_systemName |
|
|
Timer (local) |
Use lower-case initial letter |
t_ |
t_wait |
|
|
Timer (defined within a component) |
Use lower-case initial letters |
tc_ |
tc_authMin |
|
|
Module parameters |
Use all upper case letters |
none |
PX_MAC_ID |
Note 3 |
|
Formal Parameters |
Use lower-case initial letter |
p_ |
p_macId |
|
|
Enumerated Values |
Use lower-case initial letter |
e_ |
e_syncOk |
|
|
NOTE 1: This prefix must be used for all
template definitions which do not assign or refer to
templates with wildcards or matching expressions, e.g.
templates specifying a constant value, parameterized
templates without matching expressions, etc.
NOTE 2: This prefix must be used in
identifiers for templates which either assign a wildcard or
matching expression ( e.g., ?, *, value list, ifpresent,
pattern, etc) or reference another template which assigns a
wildcard or matching expression.
NOTE 3: In this case it is acceptable to
use underscore within an identifier.
Example 2: WiMax
Project Specific Naming Conventions
The table below shows how the WiMAX project uses the Generic
TTCN-3 Naming Conventions. Any changes to the Generic TTCN-3
Naming Conventions are marked in red. In addition to these
naming conventions, the WiMAX project has defined its
project specific naming conventions which can be consulted
in the appropriated documents.
|
Language element
|
Naming convention
|
Prefix
|
Example
|
Notes
|
|
Module
|
Use upper-case initial letter
|
none
|
WMx_NCT_CommonFns
|
|
|
Group within a module
|
Use lower-case initial letter
|
none
|
messageGroup
|
|
|
Data type
|
Use upper-case initial letter
|
none
|
SetupContents
|
|
|
Message template
|
Use lower-case initial letter
|
m_
|
m_setupInit
|
|
|
Message template with wildcard or matching
expression
|
Use lower-case initial letters
|
mw_
|
mw_setupBasic
|
|
|
Signature
|
Not used.
|
|
Port instance
|
Use lower-case initial letter
|
none
|
signallingPort
|
|
|
Test component instance
|
Use lower-case initial letter
|
none
|
userTerminal
|
|
|
Constant
|
Use lower-case initial letter
|
c_
|
c_maxRetransmission
|
|
|
Function
|
Use lower-case initial letter
|
f_
|
f_authentication()
|
|
|
External function
|
Use lower-case initial letter
|
xf_
|
xf_calculateLength()
|
NOTE 1
|
|
Altstep
|
Use lower-case initial letter
|
a_
|
a_receiveSetup()
|
|
|
Test case
|
Use ETSI numbering
|
TC_
|
TC_SS_CDM_CDC_DL_BV_H002
|
|
|
Variable (local)
|
Use lower-case initial letter
|
v_
|
v_basicCid
|
|
|
Variable (defined within a component)
|
Use lower-case initial letter
|
vc_
|
vc_ssSimu
|
|
|
Timer
|
Use lower-case initial letter
|
t_
|
t_wait
t_auth_min
|
NOTE 2
|
|
Timer (defined within a component)
|
Use lower-case initial letter
|
t_
|
t_wait
|
NOTE 1 |
|
Module parameters
|
Use all upper case letters
|
none
|
PIC_T7 PXT_TNOAC
|
|
|
Formal Parameters
|
Use lower-case initial letter
|
p_
|
p_macId
|
|
|
Enumerated Value
|
Use lower-case initial letter
|
e_
|
e_synCpk
|
|
|
NOTE 1: Inherited from
former ETSI HiperLAN test suite
naming conventions
NOTE 2: In case of
a time window "_min" or "_max" suffixes are
appended
Example 3: 3GPP LTE/SAE UE
Conformance
Test Suite
Specific Naming Conventions
|
Language
Element
|
Naming
Convention
|
Prefix
|
Example
Identifier
|
Notes
|
|
Module
|
upper-case
initial letter
|
none
|
EUTRA_ASP_TypeDefs
|
|
|
Group within
a module
|
upper-case
initial letter
|
none
|
LocalFunctions
|
|
|
Data type
|
upper-case
initial letter; _Type
postfix
|
none
|
SystemConfirmation_Type
|
NOTE 1
|
|
Message template for sending
|
upper-case
initial letter
|
cas_
|
cas_SRB_RrcPdu_REQ
|
ASP
|
|
cms_
|
|
Coordination
message
|
|
cs_
|
|
PDU or any
other template
|
|
cds_
|
|
Modified
template
|
|
crs_
|
|
Exception for
template used for sending and receiving
|
|
Message template for receiving
|
upper-case
initial letter
|
car_
|
car_SRB_RrcPdu_IND
|
ASP
|
|
cmr_
|
|
Coordination
message
|
|
cr_
|
|
PDU or any
other template
|
|
cdr_
|
|
Modified
template
|
|
Signature
template
|
Not used
|
|
Port
instance
|
All upper-case
letters
|
none
|
SYS
|
|
|
Test
component instance
|
All
upper-case letters;
_PTC
postfix
|
none
|
EUTRA_PTC
|
No postfix for MTC and SYSTEM components
|
|
Constant
|
none
|
tsc_
|
tsc_RRC_TI_Def
|
|
|
Local constant
|
upper-case
initial letter
|
const_
|
const_S1A_FC
|
Constant
defined in a function
|
|
External
constant
|
Not used
|
|
Function
|
upper-case
initial letter
|
f_
|
f_PublicFunction
|
|
|
fl_
|
fl_LocalFunction
|
Local
functions shall not to be used by other modules
|
|
External
function
|
upper-case
initial letter
|
fx_
|
fx_ExternalFunction
|
|
|
Altstep
(incl. Default)
|
upper-case
initial letter
|
a_
|
a_DefaultBehaviour
|
|
|
Test case
|
(see
Notes)
|
TC_
|
TC_8_1_1
|
Identifier reflects clause in 36.523-1
|
|
Variable (local)
|
upper-case
initial letter
|
v_
|
v_MyVariable
|
Note 2
|
|
Variable
(defined within a component type)
|
upper-case
initial letter
|
vc_
|
vc_EUTRA_Global
|
All component variables are gathered in one
record
|
|
Timer (local)
|
upper-case
initial letter
|
t_
|
t_Wait
|
|
|
Timer
(defined within a component type)
|
Not used
|
|
Module
parameters
|
(see
Notes)
|
pc_
|
pc_1xRTT
|
PICS
parameter as defined in 36.523-2 and 34.123-2
|
|
px_
|
px_eAuthRAND
|
PIXIT
parameter as defined in 36.523-3 and 34.123-3
|
|
Formal
parameters
|
upper-case
initial letter
|
p_
|
p_MyParameter
|
|
|
Enumerated
values
|
none
|
none
|
ps, cs, FDD, TDD
|
|
NOTE 1: ASP
types use
all
upper-case letters and typically have postfix _REQ, _CNF or _IND;
RRC and NAS protocol types are extracted
from standards and therefore do not
have a _Type postfix
NOTE 2: Counter variables do not need to
have a prefix but may single characters like I, K, L, M, N
|