Descriptive package calls

Motivation

As a tester, I would like to create a library of generic test sequences that I can reuse flexibly in my test cases. I also want the test steps to be formulated as closely as possible to my specification.

Creating a generic reference package

First I create my library package StartStopEngine.pkg, which starts or stops my engine and checks the success by means of a signal of my choice. I would like to flexibly specify whether I want to start or stop and which signal I want to use to check the success. To do this, I create a parameter EngineRequest of type Enum with the values ‘Start’ and ‘Stop’:

../../_images/StartStopEngine_EngineRequest.png

For reading an arbitrary signal, I add a generic reading test step with the mapping name QuantityToCheck. As the evaluation, I specify that the measured value should either be greater than 0 (when starting) or equal to 0 (when stopping):

../../_images/StartStopEngine_QuantityToCheck.png
Using a reference package with a descriptive name

Now I would like to use my reference package StartStopEngine.pkg in a test case Testpackage.pkg. The first call should start the engine and the successful start should be checked using the VehicleSpeed signal. In the second call, the engine is to be stopped and the success checked using EngineSpeed. Also, I want to be able to differentiate between the two package calls more easily and to recognize from the display name how my library package is parameterized.

To achieve this, I first need to create a mapping entry for my library package StartStopEngine.pkg. This is possible both in the Global Mapping as well as in the Local Mapping of the calling package (here: Testpackage.pkg).

For the purpose of this tutoral, I create an entry in the global mapping. In the mapping edit dialog, I can then assign a Alternative Call Representation. This alternative call representation can reference the values of the parameters and mappings of the referenced package StartStopEngine.pkg. The notation is ${Parameter.My_Parameter} for parameters and ${Mapping.My_Mapping_Entry} for mappings, respectively:

../../_images/EditMappingItem_AltCallRepr.png

For StartStopEngine.pkg, I referenced EngineRequest with ${Parameter.EngineRequest} and QuantityToCheck with ${Mapping.QuantityToCheck}. Their values will be replaced once I insert the mapping entry into Testpackage.pkg and parameterized the package call.

Next, I drag the package mapping into my Testpackage.pkg and parameterize it as desired:

../../_images/TestPackage.png

The display name of my reference package StartStopEngine.pkg in Testpackage.pkg now also contains the alternative call representation with the parameterized values. I can see at a glance what my package call will be doing.