=== Test Suite Modularization: Module Containment === Modules, whose identifiers contain any of the following substrings, shall contain only certain definition types, permissible for the particular type of module. These substrings will be referred to as "module restrictions" in the following, to establish a unified terminology and simplify the descriptions. All module restrictions are case-sensitive. The configuration entries are following the schema "check{!ModuleRestriction}!ModuleContainmentCheck", where "!ModuleRestriction" is to be substituted with the particular substring. Apart from the permissible definition types, all modules allow the presence of import and group definitions. The output for the quality checks indicates the location/scope of the definition (starting line - end line) violating the particular constraints and the type of module restriction that has been recognized and applied (based on the substring that has been found in the module name). Note that, if a module name contains multiple restrictions, all the checks will be applied individually. This means that a "!TypesAndValuesAndTemplates" module will first be checked for the permissible definition types for a "!TypesAndValues" module and throw a warning on any other definition (be it a definition of the permissible definitions for a "!Template" module), and then the other way around for the permissible definitions in a "!Templates" module. Note that control part definitions are allowed in all the following module containment checks. This may be subject to changes in the future (restricted to the "!TestControl" modules only). The details for the individual module restrictions are outlined below. ==== !TypesAndValues Module Must Contain Only Type and Constant Definitions ==== - '''Symbolic Name in XML Configuration''': checkTypesAndValuesModuleContainmentCheck - '''Dependant Tags in XML Configuration''': - Any module that contains the substring ''!TypesAndValues'' in its name will be analyzed. Only type and constant definitions are permitted within such a module. The example below illustrates a module which will produce warnings if this quality check is enabled. The first three definitions are type and constant definitions. However, templates, testcases, and functions must not be present in such a module. Thus, these last three module definitions will be reported as not of the permissible types. '''Example:''' [[Include(source:trunk/t3q-examples/checkTypesAndValuesModuleContainmentCheck/checkTypesAndValuesModuleContainmentCheckBad.ttcn3, text/x-rst)]] Notes: Component and port type definitions also fall under the generic "type definitions" term. Therefore, they are also allowed in a "!TypesAndValues" module. This may be subject to changes in the future. ==== Templates Module Must Contain Only Template Definitions ==== - '''Symbolic Name in XML Configuration''': checkTemplatesModuleContainmentCheck - '''Dependant Tags in XML Configuration''': - Any module that contains the substring ''Templates'' in its name will be analyzed. Similar to the "!TypesAndValues" module restriction, only template definitions are permitted within such a module. The example below illustrates a module which will produce warnings if this quality check is enabled. The first three definitions are template definitions (one is within a group). The constant and function definitions that follow, however, are not allowed within a "Templates" module and therefore will produce a warning. '''Example:''' [[Include(source:trunk/t3q-examples/checkTemplatesModuleContainmentCheck/checkTemplatesModuleContainmentBad.ttcn3, text/x-rst)]] ==== Functions Module Must Contain Only Function and Altstep Definitions ==== - '''Symbolic Name in XML Configuration''': checkFunctionsModuleContainmentCheck - '''Dependant Tags in XML Configuration''': checkFunctionsModuleContainmentCheckAllowExtFunction Any module that contains the substring ''Functions'' in its name will be analyzed. Similar to the other module restrictions, only function and altstep definitions are permitted within such a module. The example below illustrates a module which will produce warnings if this quality check is enabled. Additionally, external function definitions may (by default) or may not be allowed within such modules, depending on whether '''checkFunctionsModuleContainmentCheckAllowExtFunction''' is enabled or not. '''Example:''' [[Include(source:trunk/t3q-examples/checkFunctionsModuleContainmentCheck/checkFunctionsModuleContainmentBad.ttcn3, text/x-rst)]] ==== Testcases Module Must Contain Only Testcase and Function Definitions That Are Referenced In Start Statements ==== - '''Symbolic Name in XML Configuration''': checkTestcasesModuleContainmentCheck - '''Dependant Tags in XML Configuration''': - Any module that contains the substring ''Testcases'' in its name will be analyzed. Similar to the other module restrictions, only testcase and function definitions that are referenced in start statements are permitted within such a module. The example below illustrates a module which will produce warnings if this quality check is enabled. '''Example:''' [[Include(source:trunk/t3q-examples/checkTestcasesModuleContainmentCheck/checkTestcasesModuleContainmentBad.ttcn3, text/x-rst)]] ==== !ModuleParams Module Must Contain Only Modulepar Definitions ==== - '''Symbolic Name in XML Configuration''': checkModuleParamsModuleContainmentCheck - '''Dependant Tags in XML Configuration''': - Any module that contains the substring ''!ModuleParams'' in its name will be analyzed. Similar to the other module restrictions, only modulepar definitions are permitted within such a module. The example below illustrates a module which will produce warnings if this quality check is enabled. '''Example:''' [[Include(source:trunk/t3q-examples/checkModuleParamsModuleContainmentCheck/checkModuleParamsModuleContainmentBad.ttcn3, text/x-rst)]] ==== Interface Module Must Contain Only Component, Port, and Type Definitions ==== - '''Symbolic Name in XML Configuration''': checkInterfaceModuleContainmentCheck - '''Dependant Tags in XML Configuration''': - Any module that contains the substring ''Interface'' in its name will be analyzed. Similar to the other module restrictions, only component, port, and type definitions are permitted within such a module (or generally speaking any type definition). The example below illustrates a module which will produce warnings if this quality check is enabled. '''Example:''' [[Include(source:trunk/t3q-examples/checkInterfaceModuleContainmentCheck/checkInterfaceModuleContainmentBad.ttcn3, text/x-rst)]] ==== !TestSystem Module Must Contain Only Component and Port Definitions ==== - '''Symbolic Name in XML Configuration''': checkTestSystemModuleContainmentCheck - '''Dependant Tags in XML Configuration''': - Any module that contains the substring ''!TestSystem'' in its name will be analyzed. Similar to the other module restrictions, only component type definitions are permitted within such a module. The example below illustrates a module which will produce warnings if this quality check is enabled. '''Example:''' [[Include(source:trunk/t3q-examples/checkTestSystemModuleContainmentCheck/checkTestSystemModuleContainmentBad.ttcn3, text/x-rst)]] ==== !TestControl Module Must Contain Only Control Part Definition ==== - '''Symbolic Name in XML Configuration''': checkTestControlModuleContainmentCheck - '''Dependant Tags in XML Configuration''': - Any module that contains the substring ''!TestControl'' in its name will be analyzed. Similar to the other module restrictions, only control part definition is permitted within such a module. The example below illustrates a module which will produce warnings if this quality check is enabled. '''Example:''' [[Include(source:trunk/t3q-examples/checkTestControlModuleContainmentCheck/checkTestControlModuleContainmentBad.ttcn3, text/x-rst)]]