7.2 Naming conventions
7.2.1 General guidelines
This test suite follows the naming convention guidelines provided in oneM2M TS-0015 [i.2].
The naming convention is based on the following underlying principles:
- in most cases, identifiers should be prefixed with a short alphabetic string (specified in table 7.2.1-1) indicating the type of TTCN3 element it represents;
- suffixes should not be used except in those specific cases identified in table 7.2.1-1;
- prefixes and suffixes should be separated from the body of the identifier with an underscore ("_");
EXAMPLE 1: c\_sixteen, t\_wait.
- only module names, data type names and module parameters should begin with an uppercase letter. All other names (i.e. the part of the identifier following the prefix) should begin with a lowercase letter;
- the start of second and subsequent words in an identifier should be indicated by capitalizing the first character. Underscores should not be used for this purpose.
EXAMPLE 2: f\_initialState.
Table 7.2.1-1 specifies the naming guidelines for each element of the TTCN3 language indicating the recommended prefix, suffixes (if any) and capitalization.
Table 7.2.1-1: TTCN-3 generic naming conventions
Language element | Naming convention | Prefix | Example identifier |
---|---|---|---|
Module | Use upper-case initial letter | none | OneM2M_Templates |
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_anyUserReply |
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 |
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 for PICS | Use all upper case letters | PICS_ | PICS_DOOROPEN |
Module parameters for other parameters | Use all upper case letters | PX_ | PX_TESTER_STATION_ID |
Formal Parameters | Use lower-case initial letter | p_ | p_macId |
Enumerated Values | Use lower-case initial letter | e_ | e_syncOk |
7.2.2 oneM2M specific TTCN-3 naming conventions
Next to such general naming conventions, table 7.2.2-1 shows specific naming conventions that apply to the oneM2M TTCN-3 ATS.
Table 7.2.2-1: oneM2M specific TTCN-3 naming conventions
Language element | Naming convention | Prefix | Example identifier |
---|---|---|---|
oneM2M Module | Use upper-case initial letter | OneM2M_ | OneM2M_Testcases_ |
Module containing oneM2M types | Use upper-case initial letter | OneM2M_Types | OneM2M_Types |
Module containing types and values | Use upper-case initial letter | OneM2M_TypesAndValues | OneM2M_TypesAndValues |
Module containing Templates | Use upper-case initial letter | OneM2M_Templates | OneM2M_Templates |
Module containing test cases | Use upper-case initial letter | OneM2M_Testcases | OneM2M_Testcases |
Module containing functions | Use upper-case initial letter | OneM2M_Functions | OneM2M_Functions |
Module containing external functions | Use upper-case initial letter | OneM2M_ExternalFunctions | OneM2M_ExternalFunctions |
Module containing components, ports and message definitions | Use upper-case initial letter | OneM2M_TestSystem | OneM2M_TestSystem |
Module containing module parameters | Use upper-case initial letter | OneM2M_Pixits | OneM2M_Pixits |
7.2.3 Usage of Log statements
All TTCN-3 log statements use the following format using the same order:
- The TTCN-3 test case or function identifier in which the log statement is defined.
- One of the categories of log: INFO, WARNING, ERROR, TIMEOUT, NONE.
- Free text.
EXAMPLE 1: **log** ("f\_utInitializeIut: INFO: IUT initialized");
Furthermore, the following rules are applied too:
- All TTCN-3 setverdict statements are combined (as defined in TTCN-3 - ETSI ES 201 873-1 [6]) with a log statement following the same above rules (see example 2).
EXAMPLE 2: **setverdict** (**pass** , "TC\_ONEM2M\_CSE\_DMR\_CRE\_001: Received correct message");
7.2.4 Test Case (TC) identifier
Table 7.2.4-1: TC naming convention
Identifier: | TC_<root>_<gr>_<sgr>_<nn>_<per> | ||
---|---|---|---|
<root> = root | ONEM2M | oneM2M | |
<gr> = group | CSE | CSE testing | |
AE | AE testing | ||
<sgr> = subgroup | REG | Registration | |
DMR | Data Management and Repository | ||
SUB | Subscription and Notification | ||
GMG | Group Management | ||
DIS | Discovery | ||
LOC | Location | ||
DMG | Device Management | ||
CMDH | Communication Management and Delivery Handling | ||
SEC | Security | ||
<nn> = sequential number | 001 to 999 | ||
<per> = permutation | P1_P2_..PN | Permutation parameters |
EXAMPLE: TP identifier: TP/oneM2M/CSE/DMR/CRE/001
TC identifier: TC\_ONEM2M\_CSE\_DMR\_CRE\_001.