# module

The principal building blocks of TTCN-3 are modules written as free text files: line breaks or paragraph marks may be used without restrictions.

- A test suite consists of one or more modules; there is no hierarchy between modules;
- a module contains a module definitions and an (optional) module control part;
- In the module definitions part, definitions can be collected in named groups.
- modules can have parameters supplied to the module at run-time and are considered constant during test execution;
- modules can have attributes giving additional information, like coding rules or the size of a table.

Related keywords:

- control
- group
- modulepar
- with

### module module_identifier { [ module_definitions ] [ control {module_control } ] } [ with attributes ]

- The module keyword introduces the module definition.

- module_identifier is the name used to refer to the module. Must begin with a letter, may contain letters, numbers and underscore characters.

- the optional module_definitions part may contain type, constant, template, function, signature, testcase, altstep and group definitions.

- the optional module_control part states the execution order of the test cases (cf. the keyword execute) and may contain local definitions.

- attributes: see the keyword with for details.

Example

module Principal {
modulepar float tsp_hlavni;
modulepar integer tsp_vypinac, tsp_nouzove;
type component CT {};
type enumerated Examplg {jeudi, vendredi, samedi};
testcase tcprov() runs on CT {
/* Imagine Test Case body here */
};
control {execute (tc_prov())}
}

The module Principal declared here has one float (tsp_hlavni) and two integer module parameters (tsp_vypinac, tsp_nouzove), an empty component type (CT) as well as an enumerated type (Examplg) defined in the module definitions part. The control part contains the execution of the test case tc_prov.

BNF definition of module