Automatic testing device and method for embedded communication system
Through the automatic testing device and method of embedded communication system, interface data is automatically captured and analyzed, and the problems of incomplete scenario coverage and difficult to capture redundant data in manual testing are solved, and automated testing of embedded systems is realized, which improves testing efficiency and coverage.
Patent Information
- Application Number
- CN202210108864.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-01-28
AI Technical Summary
In the existing embedded system test, it is difficult to cover all usage scenarios manually construct data interaction processes, resulting in low-probability defects that are easily missed, the test content is highly mechanical, it is difficult to complete a large number of tests in a short time, and redundant data is difficult to capture.
Design an automatic testing device and method for embedded communication system, through the collaborative work of the upper and lower computers, automatically capture interface data, build data interaction processes, generate test cases and record results, and realize automated testing.
It improves the stability and reliability of the test process, enhances the integrity and work efficiency of application scenario coverage, reduces the workload of repeated test design and execution, and improves test coverage and design efficiency.
Smart Images

Figure CN114816980B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automated testing, and in particular to an automatic testing device and method for an embedded communication system. Background Art
[0002] At present, most integrated electronic systems in aviation, aerospace, automobiles, communications, etc. are composed of embedded systems, and their functional control and data cross-linking mostly adopt bus communication mode.
[0003] Embedded system testing in these fields often utilizes semi-physical simulation systems to construct bus data, simulate communication between the SUT's peripheral devices and the SUT, inject control data into the SUT, and simultaneously monitor and observe the SUT's output data. However, these semi-physical simulation test systems often lack the ability to simulate bus data interaction processes and analyze test results. In practice, data interaction process development, abnormal test data construction, and test result analysis are typically completed manually, which presents the following significant issues:
[0004] 1. Current systems are becoming increasingly complex. Manually building data interaction processes is difficult to cover all usage scenarios, resulting in low-probability defects being easily missed.
[0005] 2. The test content is mechanical and repetitive in each round of testing, and the workload of manual testing is often large;
[0006] 3. If a large amount of test data needs to be completed in a short period of time, manual testing is almost impossible;
[0007] 4. Redundant data that appears outside the established data requirements of the system under test is difficult to be effectively captured.
[0008] In view of the above situation, it is necessary to design an embedded system testing method and device that automatically constructs a data interaction process, automatically designs and executes test cases based on the interaction process, and determines the test results. Summary of the Invention
[0009] In response to the problems existing in manually constructing data interaction processes and designing test data, the present invention proposes an automatic testing device and method for embedded communication systems. In the actual use scenario of the embedded system under test, the device and method capture the interface data of the embedded system under test, automatically construct the data sending and receiving process, generate a test case sequence, and automatically execute and record the test results, thereby solving the problems existing in the above-mentioned embedded system testing, realizing the automation of embedded system testing, and enhancing the stability and reliability of the test process.
[0010] In order to achieve the above purpose, the present invention adopts the following technical solutions to solve it.
[0011] (1) An automatic test device for an embedded communication system, comprising: a host computer and a slave computer, wherein the slave computer is connected to the host computer via Ethernet, and the slave computer is directly connected to the embedded communication system to be tested via a data bus.
[0012] The host computer is used to establish a test task, which includes task parameters and test parameters; the task parameters are used to generate a test report, and the test parameters are used to generate a test case.
[0013] The host computer interface protocol is configured according to the three-layer architecture of "external cross-linking interface of the embedded system under test, configuration interface protocol, and configuration protocol data in a prescribed encapsulation form".
[0014] The lower computer is used to capture the data of the test parameters and add a timestamp, and send the data of the test parameters to the upper computer for operation.
[0015] The host computer is used to form an interface data interaction list and generate an interface data interaction flow chart after the embedded communication system under test runs the test parameter data; after the interface data interaction process for the test parameters is verified, based on the coverage requirements of the current test task and in accordance with the configured interface protocol, the test cases and execution sequences are automatically generated and saved to the database.
[0016] The lower computer is used to capture the interface input data and interface output data of the embedded system under test in real time during the running of the embedded communication system test case, add time stamps to each of the data, and send them to the upper computer.
[0017] The host computer is used to analyze the test results and generate a test report.
[0018] Furthermore, the host computer includes: a data layer, a business layer, a display layer, and an interface layer.
[0019] The data layer includes a project configuration database, an interface protocol database, a test case database, and a test result database.
[0020] The project configuration database is used to establish test tasks, including configuring task parameters and configuring test parameters; the task parameters include task identification and task name; the test parameters include test scenario name and test coverage requirements.
[0021] The interface protocol database is used to configure the external cross-linking interface of the embedded system under test, configure the interface protocol, and configure the protocol data in accordance with the prescribed encapsulation form; the host computer configures the external cross-linking interface of the embedded system under test, including the interface identifier, interface name, interface direction, and interface type; the configured interface protocol includes the protocol identifier and protocol name; the prescribed encapsulation form configures the protocol data, including the data sequence number, data attributes, data length, data semantics, data type, data range, and data accuracy.
[0022] The test case database is used to store test case data.
[0023] The test result database is used to store test result data.
[0024] The business layer includes an interface data interaction process analysis module, a test case generation module, a test device management module, an interface data analysis module, a test result analysis module, and a test report generation module.
[0025] The interface data interaction process parsing module is used for the test parameters. After the operation of the embedded communication system under test is completed, the upper computer extracts the received data containing timestamp information transmitted from the lower computer, sorts the data in chronological order, and calculates the time interval between protocols. After the sorting is completed, the content of each protocol is parsed according to the configured interface protocol package. After the parsing is completed, an interface data interaction list is formed, and an interface data interaction flow chart is generated at the same time, which is then verified.
[0026] The test case generation module is used to automatically generate test cases and execution sequences based on the configured protocol data after the parameter interface data interaction process has been verified and passed, according to the coverage requirements for the current task test. These sequences are then saved to the database. Test cases include the following fields: test case identifier, test case name, test case description, test constraints, test input, expected output, actual output, and test conclusion. Data in the sequence is stored in the format of <execution number, data source, data target, data content, and offset time>.
[0027] The test device management module is used to manage the input and output of test data.
[0028] The interface data parsing module is used to extract data containing timestamp information after the test case is completed, sort the data in chronological order, and calculate the time interval between protocols. After the sorting is completed, the content of each protocol is parsed according to the configured interface protocol encapsulation, and the original data is filled into the actual output field of the test case and compared with the expected output. If the actual output is consistent with the expected output, the test conclusion field is Pass, otherwise it is Fail.
[0029] The test result analysis module is used to analyze the test results.
[0030] The test report generating module is used to generate a test report.
[0031] The display layer includes a project display module, an interface protocol display module, an interface data interaction process display module, an interface data display module, a test status display module, and a test result display module.
[0032] The project display module is used to display detailed information of the test task project.
[0033] The interface protocol display module is used to display the interface protocol of the test task.
[0034] The interface data interaction process display module is used to form an interface data interaction list and generate an interface data interaction flow chart at the same time.
[0035] The interface data display module is used to display the interface data captured by the lower computer from the upper computer and the interface data extracted by the upper computer from the lower computer after being run by the embedded system under test.
[0036] The test status display module is used to display the working status of the test task.
[0037] The test result display module is used to display the test results of the test task.
[0038] Furthermore, the lower computer includes: a business layer, a driver layer, and an interface layer.
[0039] The business layer includes a data sending and receiving module and a timestamp adding module.
[0040] The data transceiver module is used to capture input data and output data of the embedded communication system interface under test in real time.
[0041] The timestamp adding module is used to add timestamps to the captured input data and output data respectively.
[0042] The driver layer includes an interface driver module and a test execution driver module.
[0043] The interface driver module is used to drive the interfaces of the lower computer interface layer to connect and operate with the embedded communication system under test.
[0044] The test execution driving module is used to load the test cases and execution sequences into the lower computer test execution driving module for execution.
[0045] The interface layer includes a CAN interface, an RS485 card interface, an RS422 card interface, a 1553B bus card interface, an ARINC429 card interface, a USB interface, and an Ethernet interface.
[0046] (2) An automatic testing method for an embedded communication system, comprising the following steps:
[0047] Step 1. Create a test
[0048] Establish a test task on the host computer and configure the task parameters, including task identification and task name; configure the test parameters on the host computer, including the test scenario name and test coverage requirements; configure the interface protocol on the host computer and the external cross-link interface of the embedded system under test, including interface identification, interface name, interface direction, and interface type; configure the interface protocol, including protocol identification and protocol name; configure the protocol data in the specified encapsulation format, including data sequence number, data attributes, data length, data semantics, data type, data range, and data accuracy;
[0049] Step 2. Run the test scenario
[0050] Set the interface direction between the lower computer and the embedded system under test to input, run the embedded system under test according to the test scenario named by the test scenario, and the lower computer captures the input data and output data of the embedded system under test in real time, adds timestamps to each data, and sends them to the upper computer;
[0051] Step 3. Verify the data interaction process of the interface of the tested scenario
[0052] After the test scenario is completed, the upper computer extracts the test scenario data containing timestamp information after the embedded system under test is run from the lower computer, sorts the data in chronological order, and calculates the time interval between protocols. After the sorting is completed, the interface protocol is encapsulated according to the interface protocol configured in step 1, and each protocol content is parsed. After the parsing is completed, an interface data interaction list is formed, and a flowchart of the interface data interaction is generated to assist the interface designer in manually verifying its correctness and completeness.
[0053] Step 4. Generate the database
[0054] After the interface data interaction process of the tested scenario is verified and passed, based on the test coverage requirement for the current task in step 1, the host computer automatically generates test cases and execution sequences according to the configuration protocol data in step 1 and saves them to the database; the test cases include the following fields: use case identification, use case name, use case description, test constraints, test input, expected output, actual output, and test conclusion;
[0055] Step 5. Conduct testing
[0056] The test cases and execution sequences in the database are loaded from the host computer to the test execution driver module of the slave computer for execution. During the test case execution, the slave computer captures the input and output data of the embedded system interface under test in real time, adds a timestamp, and sends it to the host computer.
[0057] Step 6. The host computer extracts the test case data containing timestamp information after the embedded system under test is run from the slave computer, sorts the data in chronological order, and calculates the time interval between protocols. After the sorting is completed, it is packaged according to the interface protocol configured in step 1, and the content of each protocol is parsed. The original data is filled into the actual output field of the test case and compared with the expected output. If the actual output is consistent with the expected output, the test conclusion field is Pass, otherwise the failure field is Fail. After the test is completed, the host computer automatically generates a test report in the specified format.
[0058] Compared with the existing technology, the method of the present invention captures data based on the usage scenario, automatically analyzes and generates a flow chart of the interface data interaction of the tested embedded system, and verifies whether the interface design is correctly implemented without data redundancy or omission. This solves the problem that manual verification methods are unintuitive and insufficient, and improves the correctness and completeness of interface verification; solves the problem that manually constructing data interaction processes is labor-intensive and prone to omissions, and improves the completeness of application scenario coverage and work efficiency; improves test coverage and design efficiency; and improves test efficiency. In the event of version iteration of the tested embedded system, as long as the interface has not changed, the test cases generated by this method and device can be directly used for regression testing and automatically run, avoiding the workload of repeated test design and execution. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0060] Figure 1 Flowchart of automatic testing method for embedded system;
[0061] Figure 2 This is a schematic diagram of the overall architecture;
[0062] Figure 3 This is a schematic diagram of the host computer architecture;
[0063] Figure 4 Schematic diagram of the lower computer architecture
[0064] Figure 5 A diagram of a task configuration for an embodiment
[0065] Figure 6 A schematic diagram of an interface protocol architecture in an embodiment
[0066] Figure 7 An example table of interface protocols in one embodiment is shown below:
[0067] Figure 8 An interface data interaction list in one embodiment
[0068] Figure 9 This is a flowchart of interface data interaction in one embodiment. DETAILED DESCRIPTION
[0069] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0070] The following description sets forth specific details to facilitate a thorough understanding of the present invention. However, the present invention can be implemented in a variety of other ways than those described herein, and those skilled in the art will be able to make similar generalizations without departing from the scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0071] (1) An automatic test device for an embedded communication system, characterized in that the automatic test device includes: a host computer and a slave computer, the slave computer and the host computer are connected via Ethernet, and the slave computer and the embedded communication system under test are directly connected via a data bus.
[0072] The host computer is used to establish a test task, which includes task parameters and test parameters; the task parameters are used to generate a test report, and the test parameters are used to generate a test case.
[0073] The host computer interface protocol is configured according to the three-layer architecture of "external cross-linking interface of the embedded system under test, configuration interface protocol, and configuration protocol data in a prescribed encapsulation form".
[0074] The lower computer is used to capture the data of the test parameters and add a timestamp, and send the data of the test parameters to the upper computer for operation.
[0075] The host computer is used to form an interface data interaction list and generate an interface data interaction flow chart after the embedded communication system under test runs the test parameter data; after the interface data interaction process for the test parameters is verified, based on the coverage requirements of the current test task and in accordance with the configured interface protocol, the test cases and execution sequences are automatically generated and saved to the database.
[0076] The lower computer is used to capture the interface input data and interface output data of the embedded system under test in real time during the running of the embedded communication system test case, add time stamps to each of the data, and send them to the upper computer.
[0077] The host computer is used to analyze the test results and generate a test report.
[0078] Furthermore, the host computer includes: a data layer, a business layer, a display layer, and an interface layer.
[0079] The data layer includes a project configuration database, an interface protocol database, a test case database, and a test result database.
[0080] The project configuration database is used to establish test tasks, including configuring task parameters and configuring test parameters; the task parameters include task identification and task name; the test parameters include test scenario name and test coverage requirements.
[0081] The interface protocol database is used to configure the external cross-linking interface of the embedded system under test, configure the interface protocol, and configure the protocol data in accordance with the prescribed encapsulation form; the host computer configures the external cross-linking interface of the embedded system under test, including the interface identifier, interface name, interface direction, and interface type; the configured interface protocol includes the protocol identifier and protocol name; the prescribed encapsulation form configures the protocol data, including the data sequence number, data attributes, data length, data semantics, data type, data range, and data accuracy.
[0082] The test case database is used to store test case data.
[0083] The test result database is used to store test result data.
[0084] The business layer includes an interface data interaction process analysis module, a test case generation module, a test device management module, an interface data analysis module, a test result analysis module, and a test report generation module.
[0085] The interface data interaction process parsing module is used for the test parameters. After the operation of the embedded communication system under test is completed, the upper computer extracts the received data containing timestamp information transmitted from the lower computer, sorts the data in chronological order, and calculates the time interval between protocols. After the sorting is completed, the content of each protocol is parsed according to the configured interface protocol package. After the parsing is completed, an interface data interaction list is formed, and an interface data interaction flow chart is generated at the same time, which is then verified.
[0086] The test case generation module is used to automatically generate test cases and execution sequences based on the configured protocol data after the parameter interface data interaction process has been verified and passed, according to the coverage requirements for the current task test. These sequences are then saved to the database. Test cases include the following fields: test case identifier, test case name, test case description, test constraints, test input, expected output, actual output, and test conclusion. Data in the sequence is stored in the format of <execution number, data source, data target, data content, and offset time>.
[0087] The test device management module is used to manage the input and output of test data.
[0088] The interface data parsing module is used to extract data containing timestamp information after the test case is completed, sort the data in chronological order, and calculate the time interval between protocols. After the sorting is completed, the content of each protocol is parsed according to the configured interface protocol encapsulation, and the original data is filled into the actual output field of the test case and compared with the expected output. If the actual output is consistent with the expected output, the test conclusion field is Pass, otherwise it is Fail.
[0089] The test result analysis module is used to analyze the test results.
[0090] The test report generating module is used to generate a test report.
[0091] The display layer includes a project display module, an interface protocol display module, an interface data interaction process display module, an interface data display module, a test status display module, and a test result display module.
[0092] The project display module is used to display detailed information of the test task project.
[0093] The interface protocol display module is used to display the interface protocol of the test task.
[0094] The interface data interaction process display module is used to form an interface data interaction list and generate an interface data interaction flow chart at the same time.
[0095] The interface data display module is used to display the interface data captured by the lower computer from the upper computer and the interface data extracted by the upper computer from the lower computer after being run by the embedded system under test.
[0096] The test status display module is used to display the working status of the test task.
[0097] The test result display module is used to display the test results of the test task.
[0098] Furthermore, the lower computer includes: a business layer, a driver layer, and an interface layer.
[0099] The business layer includes a data sending and receiving module and a timestamp adding module.
[0100] The data transceiver module is used to capture input data and output data of the embedded communication system interface under test in real time.
[0101] The timestamp adding module is used to add timestamps to the captured input data and output data respectively;
[0102] The driver layer includes an interface driver module and a test execution driver module.
[0103] The interface driver module is used to drive the interfaces of the lower computer interface layer to connect and operate with the embedded communication system under test.
[0104] The test execution driving module is used to load the test cases and execution sequences into the lower computer test execution driving module for execution.
[0105] The interface layer includes a CAN interface, an RS485 card interface, an RS422 card interface, a 1553B bus card interface, an ARINC429 card interface, a USB interface, and an Ethernet interface.
[0106] (2) An automatic testing method for an embedded communication system, comprising the following steps:
[0107] Step 1. Establish a test. Establish a test task on the host computer and configure the task parameters, including the task identifier and task name. The host computer configures the test parameters, including the test scenario name and test coverage requirements. The host computer configures the interface protocol. The host computer configures the external cross-link interface of the embedded system under test, including the interface identifier, interface name, interface direction, and interface type. Configure the interface protocol, including the protocol identifier and protocol name. Configure the protocol data according to the specified encapsulation format, including data sequence number, data attributes, data length, data semantics, data type, data range, and data accuracy.
[0108] Step 2. Run the test scenario, set the interface direction between the lower computer and the embedded system under test to input, run the embedded system under test according to the test scenario name, and the lower computer captures the input data and output data of the embedded system under test in real time, adds timestamps to each, and sends them to the upper computer;
[0109] Step 3. Verify the interface data interaction process of the tested scenario. After the test scenario is completed, the upper computer extracts the test scenario data containing timestamp information after the embedded system under test is run from the lower computer, sorts the data in chronological order, and calculates the time interval between protocols. After the sorting is completed, the interface protocol is encapsulated according to the interface protocol configured in step 1, and the content of each protocol is parsed. After the parsing is completed, an interface data interaction list is formed, and a flowchart of the interface data interaction is generated to assist the interface designer in manually verifying its correctness and completeness.
[0110] Step 4. Generate a database. After the interface data interaction process of the tested scenario is verified and passed, based on the test coverage requirements for the current task in Step 1, the host computer automatically generates test cases and execution sequences according to the configuration protocol data in Step 1 and saves them to the database. The test cases include the following fields: use case identification, use case name, use case description, test constraints, test input, expected output, actual output, and test conclusion.
[0111] Step 5. Test the system by loading the test cases and execution sequences in the database from the host computer to the test execution driver module of the slave computer for execution. During the test case execution, the slave computer captures the input and output data of the embedded system interface under test in real time, adds a timestamp, and sends it to the host computer.
[0112] Step 6. The host computer extracts the test case data containing timestamp information after the embedded system under test is run from the slave computer, sorts the data in chronological order, and calculates the time interval between protocols. After the sorting is completed, it is packaged according to the interface protocol configured in step 1, and the content of each protocol is parsed. The original data is filled into the actual output field of the test case and compared with the expected output. If the actual output is consistent with the expected output, the test conclusion field is Pass, otherwise the failure field is Fail. After the test is completed, the host computer automatically generates a test report in the specified format.
[0113] The principles and features of the present method are further described in detail below with reference to examples. The examples are only used to explain and illustrate the present method and are not intended to limit the scope of application of the present method.
[0114] In the above embodiment, the steps for using an automatic testing device for an embedded communication system are as follows:
[0115] Step 1: Create a test task. The host computer configures the task parameters, including basic information such as the task ID and task name. Configure the test parameters, including the test scenario name and test coverage requirements. Task parameters are used for subsequent test report generation, and test parameters are used for test case generation. In this example, the test coverage requirements include: 100% scenario coverage, 100% interface protocol coverage, and 100% data coverage. In this example, their meanings are as follows:
[0116] 100% scenario coverage: When automatically generating test cases, the data interaction process captured under the running scenario must be fully covered, and normal, abnormal, boundary, and out-of-bounds test cases must be generated for each scenario process.
[0117] 100% interface protocol coverage: When automatically generating test cases, each interface protocol involved in the captured data interaction process must be fully covered, and normal, abnormal, boundary, and out-of-bounds test cases must be generated for each interface protocol.
[0118] 100% data coverage: When automatically generating test cases, every data in each interface protocol involved in the captured data interaction process must be fully covered, and normal, abnormal, boundary, and out-of-bounds test cases must be generated for each data in each interface protocol.
[0119] The above three types of test coverage requirements are gradually enhanced, and the number of test cases increases step by step. In actual applications, the selection is made based on the task requirements.
[0120] The interface protocol is configured according to the three-layer architecture of "interface - protocol - data". The host computer configures the external cross-linking interface of the embedded system under test, including interface identification, interface name, interface direction, and interface type; configures the interface protocol, including protocol identification and protocol name; and configures the protocol data according to the prescribed encapsulation form, including data sequence number, data attributes, data length, data semantics, data type, data range, and data accuracy. Figure 6 、 Figure 7 shown.
[0121] Step 2: Capture interface data. Set the interface direction between the lower computer and the embedded system under test to input, run the embedded system under test according to the scenario, and the lower computer captures the input and output data of the embedded system under test in real time, adds a timestamp, and sends it to the upper computer;
[0122] Step 3: Parse the data flow. After the scenario is finished, the host computer extracts the timestamp information contained in the received data, sorts the data in chronological order, and calculates the time interval between protocols. After sorting, it encapsulates the interface protocol configured in step 1 and parses the content of each protocol. After parsing, a list of interface data interactions is formed, as shown in the following figure. Figure 7 As shown, it generates Figure 8 The interface data interaction flow chart shown visualizes the interface data interaction process of the tested scenario, assisting interface designers in manually verifying its correctness and completeness;
[0123] Step 4: Generate test cases. After the interface data interaction process of the tested scenario is verified and passed, based on the test coverage requirements for the current task in Step 1, the host computer automatically generates test cases and execution sequences according to the protocol data keywords configured in Step 1 and saves them to the database. Test cases include the following fields: use case identifier, use case name, use case description, test constraints, test input, expected output, actual output, and test conclusion.
[0124] Use case identification: automatically numbered according to the required format, for example, TC01-01 (scenario 1 test case 1);
[0125] Use case name: automatically named according to the required format, for example, self-test-01 (self-test scenario test case 1);
[0126] Use case description: A description of the use case, including the degree to which the test coverage requirements in step 1 are met and the test content of this use case. For example, the self-test startup protocol equivalence class and the self-test startup protocol frame header non-equivalence class;
[0127] Test constraint: protocol sending time, for example, 00:00:00 (first protocol), 00:00:10 (sent 10 seconds after the first protocol)
[0128] Test input: The protocol sequence that the current slave needs to send, expressed in the form of <interface ID, data>. For example, <interface 1, 0x55 0xDC 0x55> (send data 0x55 0xDC0x55 to interface 1 at the time specified by the above test constraints)
[0129] Expected output: After the test input, the embedded system under test is expected to output to the current lower computer, expressed in the form of <interface ID, time (optional), data>. For example, <interface 1, 00:01:16, 0xAA 0xDE 0xAB 0x55><interface 2, 0xAA 0xDC 0x55> (interface 1 receives data 0xAA 0xDE 0xAB 0x55 at 00:01:16, and interface 2 receives data 0x55 0xDC 0x55).
[0130] Actual output: After the test input, the embedded system under test outputs to the current lower computer, for example, in the form of <interface ID, time, data>. For example, <interface 1, 00:01:16, 0xAA 0xDE 0xAB 0x55><interface 2, 00:01:16, 0xAA 0xDC 0x55> (interface 1 receives data 0xAA 0xDE 0xAB 0x55 at 00:01:16, and interface 2 receives data 0x55 0xDC 0x55 at 00:01:16). This field is empty in the test case design step.
[0131] Test conclusion: If the actual output is consistent with the expected output, the test conclusion is Pass; otherwise, it is Fail. This field is empty in the test case design step.
[0132] Step 5: Execute the test case. Load the test case and execution sequence designed in step 4 into the lower computer test execution driver module for execution. During the test case execution, the lower computer captures the input and output data of the embedded system interface under test in real time, adds a timestamp, and sends it to the upper computer.
[0133] Step 6. The host computer extracts the test case data containing timestamp information after the embedded system under test is run from the slave computer, sorts the data in chronological order, and calculates the time interval between protocols. After the sorting is completed, it is packaged according to the interface protocol configured in step 1, and the content of each protocol is parsed. The original data is filled into the actual output field of the test case and compared with the expected output. If the actual output is consistent with the expected output, the test conclusion field is Pass, otherwise the failure field is Fail. After the test is completed, the host computer automatically generates a test report in the specified format.
[0134] Although the present invention has been described in detail in this specification using general descriptions and specific embodiments, it will be apparent to those skilled in the art that modifications and improvements may be made based on the present invention. Therefore, such modifications and improvements, which do not depart from the present invention, are intended to fall within the scope of protection claimed herein.
Claims
1. An automatic test device for an embedded communication system, characterized in that: The automatic test device comprises: an upper computer and a lower computer, wherein the lower computer is connected to the upper computer via Ethernet, and the lower computer is directly connected to the embedded communication system to be tested via a data bus; The host computer is used to establish a test task, which includes task parameters and test parameters; the task parameters are used to generate a test report, and the test parameters are used to generate a test case; The host computer interface protocol is configured according to the three-layer architecture of "external cross-linking interface of the embedded system under test, configuration interface protocol, and configuration protocol data in a specified encapsulation form"; The lower computer is used to capture and timestamp the test parameter data, and send the test parameter data to the upper computer for execution; The host computer is used to form an interface data interaction list and an interface data interaction flow chart after the embedded communication system under test runs the test parameter data; after the interface data interaction process for the test parameters is verified, the host computer automatically generates test cases and execution sequences according to the coverage requirements of the current test task and the configured interface protocol, and saves them to a database; The lower computer is used to capture the interface input data and interface output data of the embedded system under test in real time during the running of the embedded communication system test case, add time stamps to each of them, and send them to the upper computer; The host computer is used to analyze the test results and generate a test report; The host computer includes: data layer, business layer, display layer, and interface layer; The data layer includes a project configuration database, an interface protocol database, a test case database, and a test result database; The project configuration database is used to establish test tasks, including configuring task parameters and configuring test parameters; the task parameters include task identifier and task name; the test parameters include test scenario name and test coverage requirements; The interface protocol database is used to configure the external cross-linking interface of the embedded system under test, configure the interface protocol, and configure the protocol data in a specified encapsulation format; the host computer configures the external cross-linking interface of the embedded system under test, including the interface identifier, interface name, interface direction, and interface type; the configured interface protocol includes the protocol identifier and protocol name; the specified encapsulation format configures the protocol data, including the data sequence number, data attributes, data length, data semantics, data type, data range, and data accuracy; The test case database is used to store test case data; The test result database is used to store test result data; The business layer includes an interface data interaction process analysis module, a test case generation module, a test device management module, an interface data analysis module, a test result analysis module, and a test report generation module; The interface data interaction process parsing module is used for the test parameters. After the operation of the embedded communication system under test is completed, the upper computer extracts the received data containing timestamp information transmitted from the lower computer, sorts the data in chronological order, and calculates the time interval between protocols. After the sorting is completed, it is packaged according to the configured interface protocol and the content of each protocol is parsed. After the parsing is completed, an interface data interaction list is formed, and an interface data interaction flow chart is generated at the same time, which is then verified; The test case generation module is used to automatically generate test cases and execution sequences according to the configured protocol data after the test parameter interface data interaction process has been verified and passed, based on the coverage requirements of the current task test, and save them to the database; the test case includes the following fields: use case identification, use case name, use case description, test constraints, test input, expected output, actual output, and test conclusion; the data in the sequence is stored in the form of <execution number, data source, data target, data content, offset time>; The test device management module is used to manage the input and output of test data; The interface data parsing module is used to extract data containing timestamp information after the test case is completed, sort the data in chronological order, and calculate the time interval between protocols. After the sorting is completed, the content of each protocol is parsed according to the configured interface protocol encapsulation, and the original data is filled into the actual output field of the test case. The actual output is compared with the expected output. If the actual output is consistent with the expected output, the test conclusion field is Pass, otherwise it is Fail; The test result analysis module is used to analyze the test results; The test report generating module is used to generate a test report; The display layer includes a project display module, an interface protocol display module, an interface data interaction process display module, an interface data display module, a test status display module, and a test result display module; The project display module is used to display detailed information of the test task project; The interface protocol display module is used to display the interface protocol of the test task; The interface data interaction process display module is used to form an interface data interaction list and generate an interface data interaction flow chart; The interface data display module is used to display the interface data captured by the lower computer from the upper computer and the interface data extracted by the upper computer from the lower computer after the embedded system under test runs; The test status display module is used to display the working status of the test task; The test result display module is used to display the test results of the test task.
2. The automatic test device for embedded communication system according to claim 1, characterized in that: The lower computer includes: a business layer, a driver layer, and an interface layer; The business layer includes a data sending and receiving module and a timestamp adding module; The data transceiver module is used to capture the input data and output data of the embedded communication system interface under test in real time; The timestamp adding module is used to add timestamps to the captured input data and output data respectively; The driver layer includes an interface driver module and a test execution driver module; The interface driver module is used to drive the interfaces of the lower computer interface layer to connect and operate with the embedded communication system under test; The test execution drive module is used to load the test cases and execution sequences into the lower computer test execution drive module for execution; The interface layer includes a CAN interface, an RS485 card interface, an RS422 card interface, a 1553B bus card interface, an ARINC429 card interface, a USB interface, and an Ethernet interface.
3. An automatic testing method for an embedded communication system, characterized in that: The following steps are involved: Step 1. Create a test Establish a test task on the host computer and configure the task parameters, including task identification and task name; configure the test parameters on the host computer, including the test scenario name and test coverage requirements; configure the interface protocol on the host computer and the external cross-link interface of the embedded system under test, including interface identification, interface name, interface direction, and interface type; configure the interface protocol, including protocol identification and protocol name; configure the protocol data in the specified encapsulation format, including data sequence number, data attributes, data length, data semantics, data type, data range, and data accuracy; Step 2. Run the test scenario Set the interface direction between the lower computer and the embedded system under test to input, run the embedded system under test according to the test scenario named by the test scenario, and the lower computer captures the input data and output data of the embedded system under test in real time, adds timestamps to each data, and sends them to the upper computer; Step 3. Verify the data interaction process of the interface of the tested scenario After the test scenario is completed, the host computer extracts the test scenario data containing timestamp information after the embedded system under test is run from the slave computer, sorts the data in chronological order, and calculates the time interval between protocols. After the sorting is completed, the interface protocol package configured in step 1 is used to parse the content of each protocol. After the parsing is completed, an interface data interaction list is formed, and an interface data interaction flow chart is generated at the same time to assist the interface designer in manually verifying its correctness and completeness. Step 4. Generate the database After the interface data interaction process of the tested scenario is verified and passed, based on the test coverage requirement for the current task in step 1, the host computer automatically generates test cases and execution sequences according to the configuration protocol data in step 1 and saves them to the database; the test cases include the following fields: use case identification, use case name, use case description, test constraints, test input, expected output, actual output, and test conclusion; Step 5. Conduct testing The test cases and execution sequences in the database are loaded from the host computer to the test execution driver module of the slave computer for execution. During the test case execution, the slave computer captures the input and output data of the embedded system interface under test in real time, adds a timestamp, and sends it to the host computer. Step 6. The host computer extracts the test case data containing timestamp information after the embedded system under test is run from the slave computer, sorts the data in chronological order, and calculates the time interval between protocols. After the sorting is completed, it is packaged according to the interface protocol configured in step 1, and the content of each protocol is parsed. The original data is filled into the actual output field of the test case and compared with the expected output. If the actual output is consistent with the expected output, the test conclusion field is Pass, otherwise the failure field is Fail. After the test is completed, the host computer automatically generates a test report in the specified format.
Citation Information
Patent Citations
Method for automatically testing embedded software
CN104407971A
Embedded software testing auxiliary system
CN107562635A