Stimulation package and analysis package

Using stimulation packages StimulationPackage and analysis packages AnalysisPackage opens up the possibility to separate stimulation and trace analysis in the context of a project. This improves modularity and reusability compared to the common approach of having stimulation and trace analysis within a single package.

The signals used in the analysis packages are usually automatically assigned to the signal groups of the corresponding stimulation package, so there will be no need to adapt the stimulation package if an analysis package using a signal previously not required is added to the project.

Stimulation package

A regular package can be used as a stimulation package StimulationPackage in a project. For this, the package has to be inserted into the project as a stimulation package reference, e.g. via the context menu in the workspace explorer or via the toolbar in the project editor:

../../_images/AddStimulation.png

Insertion of a stimulation package via the workspace explorer (left) or the project editor (right)

If a stimulation package contains one or multiple trace analyses, they will be executed after execution of the stimulation. Signal recording steps that are included in those trace analyses can be used as recording sources for associated analysis packages.

Analysis package

Analysis packages AnalysisPackage can be created via File ‣ New ‣ Analysis package or a right-click within the workspace epxlorer choosing New ‣ Analysis package in the corresponding context menu. They are standalone artifacts with the file ending .ta.

../../_images/NewTA.png

A new analysis package

An analysis package call can be inserted into a project similar to regular package calls, e.g. via drag-and-drop from the workspace explorer or via the toolbar in the project editor.

A newly inserted analysis package will automatically be connected with the preceding stimulation package reference. This connection can be modified in the Edit dialog of the analysis package call.

../../_images/StimulationSettings_TRC.png

Multiple analysis packages can reference one stimulation package.

An analysis package will automatically be executed for all parameter sets of the corresponding stimulation package and using the supplied recordings. Depending on the number of recordings per stimulation package, separate analysis jobs will be created. For example, in the following project both analysis packages would each be executed with both parameter sets:

../../_images/StimulationExample.png

When the analysis is executed, at first, the mapping space of the relevant analysis package (resp. parameter set) is applied. If a mapping refers to a generic or invalid target, the mapping space of the stimulation package (resp. the relevant parameter set) is applied to find a valid mapping. E.g., a generic mapping of an analysis package can be resolved by a local mapping of the stimulation package.

An analysis package can be run for multiple stimulations if the option <all previous> is chosen in the stimulation package selection. Thereby, only stimulation package calls located in front of the analysis package call in the project are referenced. During execution, a project folder containing one analysis package call for each referenced stimulation package call is created in the report.

Assigning signals to signal groups

When executing a project containing stimulation and analysis packages, trace.check will attempt to automatically assign mappings with a signal connection in at least one of the analysis packages to signal groups of the stimulation, such that those are recorded. The determination of the appropriate signal group is attempted based on the following rules in descending priority:

  • A signal group is already supplying the mapping.

    • For concrete mappings, name and target must match.

    • For generic mappings of the analysis package, only the name must match a mapping of the stimulation package.

  • A signal group is named after the system identifier of the addressed mapping target (e.g. ‘A-FlexRay’).

  • A signal group already supplies a mapping with the same system identifier.

  • For mappings of type “Trace file”:

    • If there is only one signal group, it will be used.

    • If the mapping target matches a signal from a signal recording step, this signal group is used.

If none of these rules can be applied, the respective signals must be manually assigned to a signal group via Edit dialog of the stimulation package call in the project:

../../_images/StimulationSignals.png

Manual assigned signals will be displayed using orange-colored font, automatic assigned signals from signal groups of a default package set in the test configuration in petrol and not assigned signals in red.

A generic mapping of an analysis package can neither be resolved automatically nor manually if two signal groups of the stimulation package contain mappings with the same name! In this case, the mapping names in the stimulation package should be adjusted to resolve the naming conflict.

Special signals and recording groups

Signal recording steps

For each signal recording step that is included in the trace analysis of the stimulation package an additional recording group will be shown. The assignment is done via matching mappings, too. Thus, an analysis package has to contain a mapping with the generic signal name of the signal that was calculated and stored as mapping target.

Additionally, the mapping item has to be of type ‘Trace file’ and the mapping target has to be equal to the generic signal name in the trace analysis of the stimulation package.

Pseudo signals

The analysis of pseudo signals such as the signal ‘FrameId’ from an ASC or BLF file, is performed similar to the usage of recorded test case variables. If signals are not assigned to a signal group in the stimulation package, this kind of signals (trace file signals) can usually not be assigned a group automatically. Therefore, the stimulation package reference has to be modified in the project and the signals have to be assigned to the corresponding signal group manually.

If the pseudo signal is to be read from multiple signal groups (e.g. one group for CAN and one group for FlexRay) a conflict will occur during assignment. This can be prevented by creating multiple mappings pointing to the same target, e.g ‘FrameId_CAN’ and ‘FrameId_FLX’, both pointing to ‘FrameId’.

Using return values from stimulation packages in analysis packages

Sometimes it is necessary to transmit information determined in the stimulation package at runtime to an associated analysis package. This use case can be realized using package variables. In the stimulation package, each variable that is to be accessed in the analysis package must be marked as return value. In a parameter set of the analysis package, the return values of the linked stimulation package are available via the identifier stim. With stim.returnVariable e.g. the return value of the variable named returnVariable can be accessed.

In order to reduce the effort of the assignment, there is the option to “Use stimulation return values as standard parameterization”. If the option is enabled and no value has been assigned to a parameter of the analysis package via a parameter set or a project-wide parameterization, it will automatically be replaced by the return value of the stimulation with the same name if existent.

Info

The return value is the value set latest in the stimulation package. Variables can be set either in the test case or one of the following trace analyses. Within a trace analysis, the value must be set explicitly via a return parameter of a trace step to be taken into account.

If multiple trace analyses set the value of the variable, the value set in the trace analysis executed last is the return value. However, since trace analyses generally run independently of each other, this procedure is not recommended.

Using values of global constants and attributes of stimulation packages in analysis packages

Often it is desired, that the values of global constants and attributes being set at the time of stimulation also apply in the analysis package.

In most cases it is sufficient to define the global constants in the test configuration or the parameterization by a common, parent project element. In rare cases however, a global constant is determined and set only in the stimulation.

For this reason, during the execution of the stimulation, valid values of global constants and attributes are taken over into the execution of the analysis package, if they are not defined at this time yet or if they are only defined in the test configuration.

Find analyses for a stimulation in test.guide

To allow for easier association of stimulations and analyses in test.guide, an internal global constant called TT_STIMULATION_RUN_ID with a UUID is created for each run of a stimulation package within a project. This constant is transferred to the assigned analysis packages. In test.guide this constant can be used in a filter to find all analyses executed for a stimulation.

Restrictions

The selective execution mode will not work for projects containing stimulation and analysis packages.

For stimulation and analysis packages, both parameter sets and parameter set generators can be used similar to regular packages. However, it is not possible for parameter generators to add recordings to analysis packages. Further, parameter set generators for analysis packages must define all mappings that will be added to generated parameter sets via CycleData.AddMappingItem() in the GetUsedMappingItems() method of the generator in order to make them known to the stimulation package (see Parameter set generator API).