Keyword-Based Testing

One of the core features in ecu.test is the use of Package references, i.e. packages being able to call other packages. This enables the encapsulation of special test sequences that can be reused in numerous test cases. Several such helper packages can be combined into libraries, which increases maintainability and ensures clean structuring of test cases.

Info

This concept is to be distinguished from Library workspaces. The library packages refered to here are located in the same workspace as the calling packages.

Keyword-based testing is based on the library packages. Keywords can be used to specify test cases that are universally interchangeable, as they all use the same language. Each keyword describes an input variable (parameter or signal). The keyword thus forms an interface between the test case specification and the implementation.

Usage in ecu.test

Keyword-based testing can be realized in ecu.test within the scope of Package references and with the help of mappings.

Alternative package representation

ecu.test offers the possibility of assigning an alternative call representation in the mapping of a package, which can use placeholders. There are two types of placeholders:

  • With ${Parameter.MY_PARAM} the values of parameters in the referenced package can be accessed.

  • With ${Mapping.MY_SIGNAL} the mapping names of the mappings in the referenced package can be accessed.

The parameters and mappings can be used to write packages generically and to call them with different signals and parameters. To ensure that the placeholders are resolved correctly, all referenced variables must be parameterized correctly in the package call. The name of the test step then corresponds to the scheme <name of the mapping>: <alternative display name>, whereby the placeholders are replaced by the parameterized values. Placeholders that cannot be resolved do not lead to an error message, but aren’t replaced either.

A tutorial on the topic of alternative package representation can be found under Tutorial Keyword-driven Testing.

Package Return Values

Expectations can be defined for the return values of a referenced package. These are then evaluated in the calling package. If all return values correspond to their expected values, the result of the package call will be SUCCESS. If at least one return value does not meet the expectations, the library package is evaluated as FAILED.

The evaluation of the return values can also be linked to time conditions.

A tutorial on the topic of package return values and time options can be found under Tutorial Keyword-driven Testing.