测试设置文件
测试设置是一个 XML 文件,其中包含各种测试用例的指令集。测试设置文件的内容可划分如下:
Test setup :=
- 测试设置:测试设置文件包含两个部分:标题 (Header) 和测试用例列表 (Test Case List)
- 标题 (Header):标题包含有关测试设置文件的基本信息,如版本、报告文件路径、数据库文件路径、ECU 名称、测试人员信息等。用户必须提供这些信息。某些值是可选的,某些是必填的。数据库路径是必填值。请查看下表了解必填和可选字段。
- 测试用例列表 (Test Case List):测试用例列表包含测试用例的集合。用户必须创建测试用例。
- 测试用例 (Test case):测试用例是测试步骤的集合,例如发送、等待、重放、验证。
- 发送 (Send):这是 send_messages 的集合。此测试步骤指示发送指定的消息。
- 发送消息 (Send Message):这提供了要发送的消息的详细信息。用户必须初始化消息及其信号。信号的默认值假定为 0。消息值可以工程值模式或原始值模式给出。
- 等待 (Wait):等待节点指示等待特定时间段,以毫秒表示。
- 重放 (Replay):重放节点指示重放 BUSMASTER 日志文件。
- 验证 (Verify):这是 verify_messages 的集合。此测试步骤指示验证指定的消息(包括 Rx 和 Tx)。
- 验证响应 (Verify Response):此测试步骤在指定时间内验证指定的消息响应(Rx 消息)。因此此步骤需要时间间隔。
- 验证消息 (Verify Message):这提供了要验证的消息的详细信息。用户需要制定验证条件。在公式中,当前信号值应按照代数表示法用 ‘x’ 表示。当前支持的逻辑运算符有八个:==, >, <, >=, <=,!= , || 和 &&。通过适当组合它们,可以执行以下验证操作:值的范围;例如,(x <= 10) && (x >= 50) 离散值集;例如,(x == 10) || (x == 20) || (x == 50) 任何其他验证程序的制定。以下是一个示例测试文件:SampleTestSetupFile.xml。
下表包含了对每个部分详细信息以及缺少任何信息时的错误处理过程的简明描述。
| Section (tag) | Description | Assumed value if absent | Error condition if absent |
|---|---|---|---|
| Section (tag) | Description | Assumed value if absent | Error condition if absent |
Test setup (testsetup) |
The root node. Accompanied by its title (title) and version information (version) | - | Fatal |
Database file (database) |
Database file | Fatal | |
Version (version) |
Version information of the test setup | 1.0 | No error |
Module Name (module name) |
Module focused on for the testing | - | No error |
| Engineer’s name | Test engineer’s name | - | No error |
| Engineer’s role | And role / designation | - | No error |
Report file path (path) |
Particular of the report file to be generated. | Current working directory with the name same as the test setup. | Error |
Report file format (format) |
Format of the report file. Can be one of TXT and HTM | TXT | Warning |
Report file time mode (timemode) |
Time mode. Can be one of SYS (system), REL (relative) and ABS (absolute) | SYS | Warning |
Bus type (bustype) |
Bus type. At present can be only CAN | CAN | Fatal |
Test case list (list_of_test_cases) |
Collection of test cases. | Nil | Error. There must be at least one entry. |
Test case (testcase) |
Collection of test steps. A test case contains identifier, title and exception handler. The last one instructs if in case of failure to continue or exit. | Nil | Error. There must be at least an entry. |
Test case title (title) |
Test case title | - | No error |
Test case exception handler (exp_handler) |
Instructs if in case of failure the testing process exists or continues. Can be one of continue or exit | continue | Warning |
Transmission (send) |
Collection of the messages to be transmitted. | - | No error |
Transmittion message details (send_message) |
Details of the message list to be transmitted. | Nil | Warning |
Send message id (identifier) |
Identifier of the message. | - | Error. The test case shall be dropped. |
Send message unit (unit) |
Unit type of the signals. Can be either raw (raw) or engineering (eng) | Engineering value | Warning |
Signal (signal) |
Details the signal with its name (name) and value. | - | Error. The test case shall be dropped. |
Verification (verify) |
Verification instruction set. Contains a collection of verification messages. | Nil | Error. A test case must have a validation routine. Test case shall be dropped. |
Failure classification (failure) |
For a verification procedure – how to classify validation failure. Can be one of warning, error, fatal | Error | Warning. |
Verify message details (verify_message) |
Details of the message list to be verified / validated. | Nil | Error. The test case shall be dropped. |
Verify message signal detail (signal) |
Details of a signal under a verify message node. The attribute required is the signal’s name (name). The node value shall be a string with formulation of the condition. This shall follow the syntax mentioned in the table below. | Nil | Error. The test case shall be dropped. |
因此,如上所述,测试设置文件必须以 XML 格式编写。因此用户必须了解 XML 的语法以及测试设置文件。但是为了简化此过程,BUSMASTER 提供了一个名为测试设置编辑器 (Test Setup Editor) 的编辑器。
权威来源: BUSMASTER DITA help source test_setup_file.dita, compiled into BUSMASTER.CHM with the application.