5.6 Test strategy

This clause introduces the test strategy being used for the TTCN-3 test cases. The chosen strategy permits to have a clear structure of the code that facilitates an easy navigation throw the different test steps.

The use of the TTCN-3 MTC and PTC(s) is as depicted in figure 5.6-1.

Figure 5.6-1: Use of TTCN-3 components

Figure 5.6-1: Use of TTCN-3 components

At the start of the test case execution, the MTC is created. Then, the MTC executes the following steps:

  • Step 1) initialization of the master PTC.
  • Step 2) initialization of some parameters if required for the permutation test cases.
  • Step 3) running of the appropriate function on the master PTC. The function run on the master PTC implements a given Test Purpose. Such function follows a code structure as indicated here below:

    • Local Variables, declaration of local variables.
    • Test Control, checking IUT capability parameters required for the proper execution of the test.
    • Test Component Configuration, that initializes the given test component and other test components acting as slave PTC(s) as required by a given configuration.
    • Test adapter configuration, that configures the test adapter throw the acPort if required.
    • Preamble, that implements the necessary test steps as described in the Initial conditions of a Test Purpose. It may also implement additional test steps which are required for the correct execution of the test.
    • Test body, that implements the test steps as described in the Expected behaviour of a Test Purpose.
    • Postamble, that implements the necessary test steps to bring the IUT back to the initial state.
    • Tear down, that finalizes properly the TTCN-3 ports used by the different test components depending on the configuration.

While master PTC follows the test structure described above, slave PTC(s) run only certain procedures, usually one by one, as mandated by the master PTC.

A procedure usually implements a oneM2M request-response exchange between a given PTC and the IUT, although it can implement any other specific action (sending or reception of a message, several request-response exchanges, etc.).

  • Step 4) checking of some parameters if required for the permutation test cases.

This test strategy may slightly vary for certain cases where specific requirements need to be fulfilled.