Button-based generation¶
Button-based generation creates the contents of existing Blocks from their descriptions. It is available in the test case editor and trace analysis editor. The model is selected with Generation model in the Setup ecu.test agent.
Generating test steps¶
Describe the intended content in the Block’s Action, Parameterization, and Expectation fields. Then use one of the following methods:
Select one or more Blocks, right-click, and select .
Select a command from the Generate with ecu.test agent toolbar dropdown.
The dropdown provides these commands:
- Generate selection with ecu.test agent
Generates the selected Blocks.
- Generate all empty with ecu.test agent
Generates all Blocks in the current Package that do not contain test steps.
- Generate all with ecu.test agent
Generates all Blocks in the current Package.
The main toolbar button runs Generate selection with ecu.test agent. If the Agent service is not configured, the button opens the Agent settings instead.
After successful generation, an overlay on the Block icon identifies the generated content. The overlay remains until the Block or one of its test steps is modified. It can also be removed in the Block edit dialog.
Important
Review all generated test steps before executing the test case.
Supported test steps¶
ecu.test agent can generate and parameterize the following test steps:
Read and check mappings, including tolerance and time options
Write mappings
Reset
Wait
Calculate and check expressions
Execute Tool and Port Jobs
Package call with input and output parameters
If-Then-Else and Switch-Case
If-Def and Switch-Def-Case
MultiCheck
Loop and Repeat-Until
Exit and Return
Comment
Start and Stop Trace
Agentic multimedia
If no suitable steps can be generated, ecu.test agent adds a Todo describing information that may be missing. If a response cannot be processed, it adds a comment so that you can adjust the Block description and try again.
Context used for test step generation¶
For each Block, ecu.test agent builds a context from the following sources:
the current Block description
other Blocks in the open Package
Package parameters and return values, including types and descriptions
signal mappings, including names, paths, types, units, and descriptions
Tool and Port Jobs from the global mapping
mapped Packages and their parameters and return values
Packages from configured library workspaces
global constants from the current configuration
similar Blocks from enabled reference implementation contexts
custom instructions from the Test case tab
The limits in Setup ecu.test agent control how many items from each category are considered.
Using reference implementations¶
Reference implementations let ecu.test agent use recurring patterns and solutions from existing Packages. Configure one or more contexts as described in Setup ecu.test agent, then open the generation dropdown and enable the contexts required for the current task.
For every generated Block, ecu.test agent selects the most semantically similar Blocks from the enabled contexts. The Reference implementation blocks filter setting limits the number of selected Blocks.
References are updated automatically whenever test steps are generated. Packages and directories
whose names start with a dot, for example .hiddenPackage.pkg, are excluded.
Warning
Updating references for directories containing many Packages can take some time. Use focused contexts containing representative Packages.
Improving generated test steps¶
Describe the intention¶
- Action
Describe the goal rather than a specific implementation.
- Parameterization
Provide relevant inputs, constraints, ranges, and units.
- Expectation
State observable outcomes, thresholds, tolerances, and timing.
Maintain useful metadata¶
Add clear descriptions to mappings, variables, constants, and Packages. This helps ecu.test agent select the intended workspace objects.
Tune context selection¶
Increase filter limits only for categories relevant to the current task.
Set unrelated categories to
0when they should not influence generation.Use focused reference implementation contexts for project-specific patterns.
Add concise naming, style, and domain rules to the custom instructions.
Generating trace steps¶
In the trace analysis editor, select the Block whose contents you want to generate. Describe the analysis task in the Block name or description, then use in the context menu or the corresponding toolbar dropdown. The selection, all-empty, and all commands work in the same way as for test cases.
Context used for trace step generation¶
Trace-step generation considers:
the Block name and description
existing generic signals
trace analysis variables
global constants
custom instructions from the Trace analysis tab
Up to ten generic signals are considered. Filter settings, reference implementations, Package variables, and the other test step generation context categories are not used.
Supported trace steps¶
- Calculation
Supports the expectation
Truein the modesFulfilled everywhereandFulfilled at least once. Other expectations, modes, and extended options are not supported.- Trigger block
Supports all trigger modes. Extended and reporting options are not supported.
- Plot
Supports overview plots. Separate plots are not supported. Axes support decimal numerical depiction and y-scaling.
- Signal recording
Supports the signal identifier setting, signal selection, and file base name. File type and compression are not supported.
Expressions can use the functions Always, Derivative, Edge, FallingEdge, and
RisingEdge.
Example Block descriptions¶
Check that the signal Speed reaches 80 km/h at least once.
Check that the signal Speed never exceeds 130 km/h.
Start a trigger on rising edges in signal X and stop it on falling edges in signal X. Within the trigger, check whether signal Y remains constant. Plot both signals and show signal X in blue.
Calculate acceleration from the signal Speed and store it in a new signal named Acceleration.