Test data is available from many sources. For example, test case generators and data acquisition devices are potential sources for test data. It is likely that this data can be directly imported into the MxVDev environment. The supported source file formats are:
•CSV Files
•MxLog Files
•VectorCAN Log Files
•Statemate Log Files
With a little bit of programming, it is straightforward to import data from other file formats.
To import data for a single Signal, you can use the External Data Source property.
To start the import wizard for one of the following file formats, select File->Import‑>TestCase Data from the main menu.
MxVDev can import TestCase data stored in a CSV file. The CSV file needs to provide at a minimum a Signal name and its value. Notes: •Signals to be imported into a TestCase should be defined in the Signal Dictionary first. •If you are using the Load as Test Results option, open the target Scenario before importing. •A transition time of -1 is used to set initial values for numeric Signals. Message and event Signals do not have initial values. •You can use Signal Name Mapping to change the names of Signals as they are imported. •For bus signals (CAN or LIN), you can automatically generate the map file from a DBC or LDF file. See Signal Name Mapping for Bus Signals. •The COM API provides an alternate, automated method for importing TestCase data. MxVDev supports two data formats for importing: Matrix or Streaming. Sample files are provided in the Templates\CSV Import Examples subfolder of the MxSuite installation folder. 1.Matrix Format: In this format, each signal must have its own column. The heading of the column is usually the signal name and the rest is the signal data. A time column can be used in this format. In the Matrix format, you can add a comment to a single data item. Enter a semicolon after 2.Streaming Format: In this format, three columns: time, signal name, and signal value,
Note: In both formats, comments start with a semicolon (;), and messages must be enclosed in To start the import process, select File->Import->TestCase Data->From CSV File from the main menu. Follow the wizard to complete the process. •File Path: the path to the CSV file to be imported (the file has a .csv extension). •Data Delimiter: MxVDev supports two data delimiters: comma, and white space (white space includes tabs). •Signal Name Mapping: Click the Enabled box to select a map file. See Signal Name Mapping–File Format. If you are using CAN or LIN bus signals, see Signal Name Mapping for Bus Signals. •Data Format: specifies which format of the CSV file: oMatrix: ▪Timing Properties: A time column can be specified here if it exists in the file; otherwise, a step time must be specified. The time unit for the transitions need to be specified too. ▪Execution Properties: Execution (such as the time unit, the step duration, and the final step) and general (such as the name and description) information relating to the generated test case can be specified here. oStreaming: ▪Column Selection: The time, data, and signal name column selected here are used to transpose the streaming data format into a matrix format. ▪Timing Properties: Select the units time is measured in. ▪Execution Properties: Execution (such as the time unit, the step duration, and the final step) and general (such as the name and description) information relating to the generated test case can be specified here. •First row contains column header text: specifies if the first data row in the CSV file is a column header. If the file doesn't contain a column header, a default column header "Column0, Column1, Column2,..." for each column. Column headers can be renamed later on during the import process. oLoad as New TestCase: Select this option to create a new TestCase and load the transition data as Commanded Patterns for Stimulus signals and Expected Patterns for Response signals. oLoad as Test Results: Select this option to load the transition data into the open Scenario. The data is plotted as Actual Patterns for Response signals and Pass/Fail testing is performed on the Scenario. •Column Selection: oDoes this data have a Time Column? Indicate whether time data is included in the CSV file. oIf times are in the file, select the column that contains the times and select the Time Column Properties. oIf times are not included in the file, select the time interval between each row (transition). •Signal Specific Actions: To select a signal, use the drop-down list . oImport Signal: This box is checked by default for all signals. If you uncheck it, the selected signal is not imported to the TestCase. oRename to: Enter a name to rename the selected signal. After you set Signal Specific Actions for a signal, you can select another signal. •Click Next>. •Use the dialog box shown above to set the TestCase Properties. After the import is complete, you can change these values with the TestCase Properties dialog. oImport data start at (Test Start Delay): This sets the Test Start Delay property. This is a delay after the preconditions are satisfied before the TestCase starts to run. •Click Finish to create the TestCase. After the import is complete, save the TestCase. MxV Bus Enable and MxV Node EnableTo define a transition for the MxV Bus Enable System Signal, add an entry in the format <busName>=[true|false] Example: CANB=false to turn the bus off; CANB=true to turn the bus on. For MxV Node Enable, the format is <busName>.<nodeName>=[true|false] CANB.OtherECUs=false turns the OtherECUs node off. CANB.OtherECUs=true turns the OtherECUs node on. Note: The bus name and node name are case sensitive.
|
MxVDev supports creating a new TestCase using a scenario log file. From the main menu, select File‑>Import‑>TestCase Data‑>MxLog File. Select the MxLog file to import (the file has a .mxlog extension). After the TestCase is imported, you can adjust its Properties. To create an MxLog file, see Project Settings–Logging. Also, see Converting Scenario Log Files to CSV. Note: If you import a partial file (see Project Settings–Logging), the pass/fail analysis may be different from the test that originally generated the file. |
When you import CAN traces into an MxVDev TestCase, you can do it as Messages or as Signals. We describe the two approaches below:
Use the following procedure:
For an example including a log file you can use for testing, see the CANLogSample Project. |
1.Select a Statemate Log file. 2.Click Load Log Data. 3.Click Create TestCase. |
Importing Requirements Information
ITestCaseImportParameters Interface