WO2023116647A1 - Software in-the-loop testing method and apparatus, electronic device system, and storage medium - Google Patents

Software in-the-loop testing method and apparatus, electronic device system, and storage medium Download PDF

Info

Publication number
WO2023116647A1
WO2023116647A1 PCT/CN2022/140157 CN2022140157W WO2023116647A1 WO 2023116647 A1 WO2023116647 A1 WO 2023116647A1 CN 2022140157 W CN2022140157 W CN 2022140157W WO 2023116647 A1 WO2023116647 A1 WO 2023116647A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
data
message
software
loop
Prior art date
Application number
PCT/CN2022/140157
Other languages
French (fr)
Chinese (zh)
Inventor
高旭
Original Assignee
北京罗克维尔斯科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京罗克维尔斯科技有限公司 filed Critical 北京罗克维尔斯科技有限公司
Publication of WO2023116647A1 publication Critical patent/WO2023116647A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Definitions

  • the present disclosure relates to the technical field of testing, and in particular to a software-in-the-loop testing method, device, system and storage medium.
  • the functional testing of the vehicle controller includes: model-in-the-loop testing, SIL (Software In Loop, software-in-the-loop) testing and hardware-in-the-loop testing.
  • the software-in-the-loop test system is a stable automotive software test system, which is widely used in major car manufacturers. However, the software-in-the-loop test system cannot test the software developed in some systems, that is, the applicability of the software-in-the-loop test system is low.
  • the present disclosure provides a software-in-the-loop testing method, device, system and storage medium.
  • a software-in-the-loop testing method which is applied to testing services, and the method includes:
  • the first test data is generated according to the test message and the message structure corresponding to the test message, and the software-in-the-loop test system includes a message corresponding to each test message A structure, the message structure is a data type supported by the software to be tested;
  • the message structure is generated according to the test message and the data types supported by the software under test.
  • the sending the second test data to the software under test includes:
  • the message header of the first message data contains the data type information corresponding to the second test result, and the first message data
  • the message body of the text data includes the second test result.
  • the message body of the first message data further includes verification data of the second test result, and the verification data is used to make the software-in-the-loop test system verify the second test validity of the results.
  • the software to be tested is software developed under a target system, and the target system includes: a robot operating system or a data distribution service system.
  • a software-in-the-loop testing method which is applied to a software-in-the-loop testing system, and the method includes:
  • the software-in-the-loop test system includes a message structure corresponding to each test message, and the message structure is supported by the software to be tested data type;
  • the test result returned by the test service is received.
  • the message structure is generated according to the test message and the data types supported by the software under test.
  • the sending the first test data to the test service includes:
  • the message body of the second message data further includes check data of the first test data, and the check data is used to enable the test service to verify the validity of the first test data sex.
  • a software-in-the-loop testing device which is applied to testing services, and the device includes:
  • the first test data receiving module is used to receive the first test data sent by the software-in-the-loop test system, the first test data is generated according to the test message and the message structure corresponding to the test message, and the software-in-the-loop test system Including a message structure corresponding to each test message, the message structure is a data type supported by the software to be tested;
  • a test data conversion module configured to convert the first test data into second test data according to the message structure of the first test data
  • a second test data sending module configured to send the second test data to the software under test, so that the software under test performs an automated test according to the second test data, and obtains and returns a first test result
  • a test result conversion module configured to convert the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure;
  • a test result sending module configured to send the second test result to the software-in-the-loop test system.
  • the message structure is generated according to the test message and the data types supported by the software under test.
  • the second test data sending module is specifically configured to send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data The data type information corresponding to the second test result is included, and the message body of the first message data includes the second test result.
  • the message body of the first message data further includes verification data of the second test result, and the verification data is used to make the software-in-the-loop test system verify the second test validity of the results.
  • the software to be tested is software developed under a target system, and the target system includes: a robot operating system or a data distribution service system.
  • a software-in-the-loop testing device which is applied to a software-in-the-loop testing system, and the device includes:
  • the first test data generation module is configured to generate first test data according to the test message and the message structure corresponding to the test message, wherein the software-in-the-loop test system includes a message structure corresponding to each test message, The message structure is a data type supported by the software to be tested;
  • a first test data sending module configured to send the first test data to a test service, so that the test service can obtain a test result according to the first test data
  • the test result receiving module is configured to receive the test result returned by the test service.
  • the message structure is generated according to the test message and the data types supported by the software under test.
  • the first test data sending module is specifically configured to send the second packet data to the test service through socket communication, wherein the header of the second packet data contains the first Data type information of test data, the message body of the second message data includes the first test data.
  • the message body of the second message data further includes check data of the first test data, and the check data is used to enable the test service to verify the validity of the first test data sex.
  • a testing system including: a software-in-the-loop testing system and an electronic control unit, the electronic control unit including a testing service and software to be tested;
  • the software-in-the-loop testing system is configured to generate first test data according to a test message and a message structure corresponding to the test message, and send the first test data to the test service, wherein the software-in-the-loop
  • the test system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested;
  • the test service is configured to convert the first test data into second test data according to the message structure of the first test data; send the second test data to the software under test;
  • the software under test is used to perform an automated test according to the second test data, obtain a first test result, and return the first test result to the test service;
  • the test service is further configured to convert the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure, and send the Second test result.
  • the message structure is generated according to the test message and the data types supported by the software under test.
  • the software-in-the-loop test system is specifically configured to send the second message data to the test service through socket communication, wherein the message header of the second message data contains the first The data type information of the test data, the message body of the second message data includes the first test data.
  • the message body of the second message data further includes check data of the first test data, and the check data is used to enable the test service to verify the validity of the first test data sex.
  • the test service is specifically configured to send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data includes the first The data type information corresponding to the second test result, the message body of the first message data includes the second test result.
  • the message body of the first message data further includes verification data of the second test result, and the verification data is used to make the software-in-the-loop test system verify the second test validity of the results.
  • the software to be tested is software developed under a target system, and the target system includes: a robot operating system or a data distribution service system.
  • an electronic device including a memory, a processor, and a computer program stored on the memory and operable on the processor, when the processor executes the computer program , implementing the method described in the first aspect or the second aspect.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.
  • a computer program product which causes the computer to execute the method described in the first aspect or the second aspect when the computer program product is run on a computer.
  • the software-in-the-loop testing system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested.
  • the software-in-the-loop testing system can generate the first test data according to the test message and the message structure corresponding to the test message, and send the first test data to the test service.
  • the test service converts the first test data from the software-in-the-loop test system into the second test data according to the message structure of the first test data, so that the software under test can perform automated testing according to the second test data, and returns the first Test Results.
  • the test service converts the first test result from the software under test into a second test result that can be recognized by the software-in-the-loop test system.
  • the processing result of the software to be tested can be obtained, that is, when the software-in-the-loop test system cannot test the software to be tested, the software-in-the-loop test system and the test service Combined, the automated software-in-the-loop testing of the software to be tested is realized, thereby increasing the testing range of the software-in-the-loop testing system and improving the applicability of the software-in-the-loop testing system.
  • FIG. 1 shows a schematic diagram of a system architecture of an exemplary application environment of a software-in-the-loop testing method that can be applied to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of a software-in-the-loop testing method in an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a method for generating a test service and a software-in-the-loop test system in an embodiment of the present disclosure
  • FIG. 4 is another flowchart of a software-in-the-loop testing method in an embodiment of the present disclosure
  • FIG. 5 is an interactive flowchart of a software-in-the-loop testing method in an embodiment of the present disclosure
  • FIG. 6A is a schematic structural diagram of a software-in-the-loop testing device in an embodiment of the present disclosure
  • FIG. 6B is another schematic structural diagram of a software-in-the-loop testing device in an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a test system in an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
  • FIG. 1 shows a schematic diagram of a system architecture of an exemplary application environment of a software-in-the-loop testing method that can be applied to an embodiment of the present disclosure.
  • the software-in-the-loop test refers to simulating various sensor signals required by the controller by running the vehicle model in the system environment and the I/O (input/output) model in the virtual ECU (Electronic Control Unit, electronic control unit) , and receive the signal of the bench sensor and the control signal sent by the virtual ECU, so as to connect with the code information (including basic software and hardware parameters, etc.) of the virtual ECU under test and the system environment model, and finally realize the closed-loop simulation to test the control system verify.
  • the code information including basic software and hardware parameters, etc.
  • the system architecture 100 may include a software-in-the-loop testing system 101 , a testing service 102 and a software to be tested 103 , and the testing service 102 and the software to be tested 103 may be located in the same electronic control unit 104 .
  • the software-in-the-loop test method provided by the embodiment of the present disclosure can be executed by the software-in-the-loop test system 101, the test service 102, and the software under test 103, and the test service 102 can convert the data from the software-in-the-loop test system 101 into the software under test 103 identifiable data, and convert the data from the software-to-be-tested 103 into data recognizable by the software-in-the-loop testing system 101, thereby realizing the software-in-the-loop testing system 101 to perform software-in-the-loop automated testing on the software-to-be-tested 103, and improving the software-in-the-loop testing system 101 Ring test system 101 suitability.
  • the software-in-the-loop testing method of the embodiment of the present disclosure is firstly introduced below on the testing service side.
  • FIG. 2 is a flowchart of a software-in-the-loop testing method in an embodiment of the present disclosure, which is applied to testing services and may include the following steps S210 to S240.
  • Step S210 receiving first test data sent by the software-in-the-loop test system, where the first test data is generated according to the test message and the message structure corresponding to the test message.
  • the software-in-the-loop test system is an automotive software testing system that can test the application software in the car.
  • the software-in-the-loop test system uses Message data to test the application software, and the code corresponding to the application software is generally an I/O model.
  • the software-in-the-loop test system cannot test the application software developed under the system using Message data.
  • the software to be tested refers to the software that the software-in-the-loop test system cannot test.
  • the software to be tested is software developed under the target system, and the target system can include: ROS (Robot Operating System, robot operating system) system or DDS (data distribution service, data distribution service) system.
  • the ROS system is a highly flexible software architecture for writing robot software programs.
  • application software testing under the ROS system needs to be connected to test cases written based on the ROS software architecture, and the test cases need to be run in the ROS environment. Therefore, very high requirements are put forward for software testers to write test cases.
  • the test environment And the test case requirements are relatively limited, which cannot be adapted to the general software-in-the-loop testing framework.
  • the message structures corresponding to each test message can be compiled into the software-in-the-loop test system in advance, so that the software-in-the-loop test system includes a message structure corresponding to each test message respectively,
  • the message structure is the data type supported by the software to be tested, and the data types supported by the software to be tested may include int, bool, float, unit, etc.
  • the software-in-the-loop test system can generate the first test data according to the test message and the message structure corresponding to the test message, that is, according to the data type supported by the software to be tested, the original Message data is converted into a test structure type data.
  • Step S220 converting the first test data into second test data according to the message structure of the first test data.
  • the test service can send the first test data to the message structure according to the message structure of the first test data.
  • a test data is converted into a second test data.
  • the second test data may be non-structure type test data, and the second test data may be recognized by the software to be tested.
  • the software services can start the subscribed topic, server, action and other services in the software to be tested, and simulate the source that provides data or services for the software to be tested.
  • the first test data received by the test system is converted into a ROS-related Message signal.
  • Step S230 sending the second test data to the software under test, so that the software under test performs an automated test according to the second test data, and obtains and returns the first test result.
  • the test service After the test service performs data conversion to obtain the second test data, it can send the second test data to the software under test.
  • the software under test can perform an automated test according to the identifiable second test data, obtain the first test result, and return the first test result to the test service.
  • Step S240 converting the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure, and sending the second test result to the software-in-the-loop test system.
  • the software-in-the-loop testing system cannot recognize the first test result received by the testing service. Contrary to the data conversion process in the aforementioned step S220, the test service may convert the first test result into a second test result recognizable by the SIL test system according to the message structure of the first test data. It can be seen that after the software-in-the-loop test system sends the first test data, the corresponding test results can be obtained through the data conversion of the test service, so that software developed under different systems can be tested.
  • the software-in-the-loop testing system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested.
  • the software-in-the-loop testing system can generate the first test data according to the test message and the message structure corresponding to the test message, and send the first test data to the test service.
  • the test service converts the first test data from the software-in-the-loop test system into the second test data according to the message structure of the first test data, so that the software under test can perform automated testing according to the second test data, and returns the first Test Results.
  • the test service converts the first test result from the software under test into a second test result that can be recognized by the software-in-the-loop test system. It can be seen that after the software-in-the-loop test system sends a test signal, the processing result of the software to be tested can be obtained, that is, when the software-in-the-loop test system cannot test the software to be tested, the software-in-the-loop test system and the test service Combined, the automated software-in-the-loop testing of the software to be tested is realized, thereby increasing the testing range of the software-in-the-loop testing system and improving the applicability of the software-in-the-loop testing system.
  • FIG. 3 is a flowchart of a method for generating a test service and a software-in-the-loop test system in an embodiment of the present disclosure, which may include the following steps S310 to S340 .
  • Step S310 obtaining various test messages and data type files; wherein, the data type files include data types supported by the software to be tested.
  • test message refers to the message used by the software-in-the-loop test system for testing, and different test messages are used to test different functions.
  • test message may contain the following content:
  • the above test message is used to test the speed of the vehicle and the state of each door.
  • Datatype files are files describing datatypes that can be used to generate source code in different languages.
  • the data type file includes all data types supported by the software under test, such as int, bool, float, unit, etc.
  • a simplified message description language can be used to describe the data published by the ROS node.
  • Step S320 generating a message structure corresponding to a single test message according to the data type and the single test message.
  • the message structure corresponding to each test message can be generated.
  • a pre-written script file may be used to generate a message structure corresponding to the single test message according to the data type and the single test message, so as to improve the efficiency of generating the message structure.
  • test message door.msg can generate a message structure door.hpp, which can be expressed as follows:
  • Step S330 adding the message structure to the test service code, compiling and generating the test service.
  • Step S340 adding the message structure to the software-in-the-loop test system code, compiling and generating the software-in-the-loop test system.
  • the generated message structure is added to the test service code and the software-in-the-loop test system code, and the test service and the software-in-the-loop test system can be compiled and generated. It should be noted that, when a new test message is added to the software-in-the-loop test system, a new message structure can be generated according to the newly added test message and the data type in the data type file, and the new message structure can be added to To test service code and software-in-the-loop test system code, recompile and generate new test service and new software-in-the-loop test system.
  • the software-in-the-loop testing method of the embodiment of the present disclosure can use scripts to automatically generate structured data types for use by the software-in-the-loop testing system and testing services, and realize the unification of the memory arrangement with the data types of the software to be tested, thereby facilitating The flow of data between various systems finally realizes that the software-in-the-loop test system can test the software to be tested.
  • FIG. 4 is another flow chart of a software-in-the-loop testing method in an embodiment of the present disclosure, which is applied to a software-in-the-loop testing system and may include the following steps S410 to S430.
  • Step S410 generate first test data according to the test message and the message structure corresponding to the test message
  • the software-in-the-loop test system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested .
  • Step S420 sending the first test data to the test service, so that the test service can obtain test results according to the first test data.
  • Step S430 receiving the test result returned by the test service.
  • the above-mentioned embodiment in FIG. 4 is a software-in-the-loop testing method on the side of the software-in-the-loop testing system corresponding to the embodiment in FIG.
  • FIG. 5 is an interactive flowchart of a software-in-the-loop testing method in an embodiment of the present disclosure, which may include the following steps S510 to S580.
  • Step S510 generate first test data according to the test message and the message structure corresponding to the test message
  • the software-in-the-loop test system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested .
  • a message structure corresponding to each test message can be generated.
  • the first test data can be generated. For example, according to the test message door.msg and the message structure door.hpp, the following first test data can be generated:
  • the speed of the vehicle is 100, and the states of each door are 1, 2, 3, and 4 respectively.
  • Step S520 sending the first test data to the test service.
  • the communication mode between the software-in-the-loop test system and the test service may include a socket (socket) communication mode.
  • the software-in-the-loop test system can send the second message data to the test service through socket communication, wherein the message header of the second message data contains the data type information of the first test data, and the message body of the second message data contains first test data.
  • the test service can correctly analyze according to the data type information in the message header, and obtain the first test data sent by the software-in-the-loop test system.
  • the message body of the second message data may further include verification data of the first test data, and the verification data is used to enable the test service to verify the validity of the first test data.
  • the verification data may be a crc (cyclic redundancy check) code, etc. In this way, the test service further checks the parsed data to judge the validity of the data.
  • Step S530 converting the first test data into second test data according to the message structure of the first test data.
  • the test service can convert the first test data received from the software-in-the-loop test system into the second test data according to the message structure. For example, for the following first test data:
  • the above-mentioned second test data is data recognizable by the software under test. It can be seen that the data type of the second test data received by the software to be tested is different from the first test data sent by the software-in-the-loop test system, but the data content is the same.
  • Step S540 sending the second test data to the software under test.
  • step S550 the software under test performs an automated test according to the second test data to obtain a first test result.
  • Step S560 the software under test sends the first test result to the test service.
  • Step S570 converting the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure.
  • Step S580 sending the second test result to the software-in-the-loop testing system.
  • the test service can send the first message data to the software-in-the-loop test system through socket communication; wherein, the message header of the first message data contains the data type information corresponding to the second test result, and the first report The message body of the text data includes the second test result.
  • the software-in-the-loop test system can correctly analyze according to the data type information in the message header, and obtain the second test result.
  • the message body of the first message data may further include verification data of the second test result, and the verification data is used to enable the software-in-the-loop test system to verify the validity of the second test result. In this way, the software-in-the-loop test system further checks the parsed data to judge the validity of the data.
  • the software-in-the-loop testing method of the embodiment of the present disclosure can compile the pre-generated message structure including the data types supported by the software to be tested to the test service and the software-in-the-loop test system for the test service and the software-in-the-loop test system to share use.
  • the software-in-the-loop test system can generate the first test data according to the test message and the message structure corresponding to the test message, fill the data type information of the first test data into the message header, and fill the first test data and verification data into the message body Sent to the test service later.
  • the test service can accurately parse out the first test data according to the data type information in the packet header, and can also verify the validity of the first test data according to the verification data.
  • the first test data is converted into the second test data, so that the software under test can perform automated testing according to the second test data, and return the first test result.
  • the test service converts the first test result from the software under test into a second test result that can be recognized by the software-in-the-loop test system. It can be seen that when the software-in-the-loop test system cannot test the software to be tested, by combining the software-in-the-loop test system and software services, the automatic software-in-the-loop test of the software to be tested is realized, thereby increasing the size of the software-in-the-loop test system. The test range improves the applicability of the software-in-the-loop test system.
  • the embodiment of the present disclosure also provides a software-in-the-loop test device, which is applied to test services.
  • the software-in-the-loop test device includes: a first test data receiving module 602, a test data conversion module 604 , a second test data sending module 606 , a test result conversion module 608 and a test result sending module 610 .
  • the first test data receiving module 602 is used to receive the first test data sent by the software-in-the-loop test system.
  • the first test data is generated according to the test message and the message structure corresponding to the test message.
  • the software-in-the-loop test system includes information related to each test message.
  • Corresponding message structure the message structure is the data type supported by the software under test;
  • the second test data sending module 606 is configured to send the second test data to the software under test, so that the software under test performs automated testing according to the second test data, and obtains and returns the first test result;
  • a test result conversion module 608, configured to convert the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure;
  • the test result sending module 610 is configured to send the second test result to the software-in-the-loop test system.
  • the message structure is generated according to the test message and the data types supported by the software to be tested.
  • the second test data sending module 606 is specifically configured to send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data includes the second test result Corresponding to the data type information, the message body of the first message data includes the second test result.
  • the message body of the first message data further includes verification data of the second test result, and the verification data is used to enable the software-in-the-loop test system to verify the validity of the second test result.
  • the software to be tested is software developed under the target system, and the target system includes: a robot operating system or a data distribution service system.
  • An embodiment of the present disclosure also provides a software-in-the-loop test device, which is applied to a software-in-the-loop test system.
  • the software-in-the-loop test device includes: a first test data generation module 612, a first test data sending module 614 Test result receiving module 616 .
  • the first test data generation module 612 is configured to generate first test data according to the test message and the message structure corresponding to the test message, wherein the software-in-the-loop test system includes a message structure corresponding to each test message, and the message structure is the data type supported by the software under test;
  • the first test data sending module 614 is configured to send the first test data to the test service, so that the test service can obtain a test result according to the first test data;
  • the test result receiving module 616 is configured to receive the test result returned by the test service.
  • the message structure is generated according to the test message and the data types supported by the software to be tested.
  • the first test data sending module 614 is specifically configured to send the second message data to the test service through socket communication, where the header of the second message data contains the data of the first test data Type information, the message body of the second message data includes the first test data.
  • the message body of the second message data further includes verification data of the first test data, and the verification data is used to enable the test service to verify the validity of the first test data.
  • test system 700 includes: a software-in-the-loop test system 710 and an electronic control unit 720, and the electronic control unit 720 includes a test service 722 and a software to be tested 724;
  • the software-in-the-loop test system 710 is configured to generate first test data according to the test message and the message structure corresponding to the test message, and send the first test data to the test service, wherein the software-in-the-loop test system includes The message structure, the message structure is the data type supported by the software under test;
  • the test service 722 is used to convert the first test data into the second test data according to the message structure of the first test data; send the second test data to the software under test;
  • the software to be tested 724 is used to perform automated testing according to the second test data, obtain the first test result, and return the first test result to the test service;
  • the test service 722 is further configured to convert the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure, and send the second test result to the software-in-the-loop test system.
  • the message structure is generated according to the test message and the data types supported by the software to be tested.
  • the software-in-the-loop testing system 710 is specifically configured to send the second message data to the test service through socket communication, wherein the header of the second message data includes the data type of the first test data information, the message body of the second message data contains the first test data.
  • the message body of the second message data further includes verification data of the first test data, and the verification data is used to enable the test service to verify the validity of the first test data.
  • the test service 722 is specifically configured to send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data includes the data type corresponding to the second test result information, the message body of the first message data includes the second test result.
  • the message body of the first message data further includes verification data of the second test result, and the verification data is used to enable the software-in-the-loop test system to verify the validity of the second test result.
  • the software to be tested 724 is software developed under the target system, and the target system includes: a robot operating system or a data distribution service system.
  • an electronic device including: a processor; a memory for storing processor-executable instructions; wherein, the processor is configured to execute the above-mentioned software-in-the-loop in this exemplary embodiment Test Methods.
  • FIG. 8 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. It should be noted that the electronic device 800 shown in FIG. 8 is only an example, and should not limit the functions and application scope of the embodiments of the present disclosure.
  • an electronic device 800 includes a central processing unit (CPU) 801, which can operate according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage section 808 into a random access memory (RAM) 803 Instead, various appropriate actions and processes are performed.
  • ROM read-only memory
  • RAM random access memory
  • various programs and data necessary for system operation are also stored.
  • the central processing unit 801, ROM 802, and RAM 803 are connected to each other through a bus 804.
  • An input/output (I/O) interface 805 is also connected to the bus 804 .
  • the following components are connected to the I/O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc. and a communication section 809 including a network interface card such as a local area network (LAN) card, a modem, or the like.
  • the communication section 809 performs communication processing via a network such as the Internet.
  • a drive 810 is also connected to the I/O interface 805 as needed.
  • a removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 810 as necessary so that a computer program read therefrom is installed into the storage section 808 as necessary.
  • embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts.
  • the computer program may be downloaded and installed from a network via communication portion 809 and/or installed from removable media 811 .
  • the central processing unit 801 When the computer program is executed by the central processing unit 801, various functions defined in the apparatus of the present disclosure are performed.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the foregoing software-in-the-loop testing method is implemented.
  • the computer-readable storage medium shown in the present disclosure may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more conductors, portable computer diskettes, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM) or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • Program code contained on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wires, optical cables, radio frequency, etc., or any suitable combination of the above.
  • a computer program product is also provided, which enables the computer to execute the above software-in-the-loop testing method when the computer program product runs on the computer.

Abstract

The present invention relates to a software in-the-loop testing method, apparatus and system, and a storage medium, applied to the technical field of testing. The method comprises: receiving first test data sent by the software in-the-loop testing system, the first test data being generated according to a test message and a message structure corresponding to the test message, the software in-the-loop testing system comprising a message structure respectively corresponding to each test message, and the message structure being a data type supported by software to be tested; converting the first test data into second test data according to the message structure of the first test data; sending the second test data to said software, such that said software performs automated testing according to the second test data, so as to obtain and return a first test result; and converting, according to the message structure, the first test result into a second test result that can be identified by the software in-the-loop testing system, and sending the second test result to the software in-the-loop testing system.

Description

软件在环测试方法、装置、电子设备系统及存储介质Software-in-the-loop testing method, device, electronic equipment system, and storage medium
相关申请的交叉引用Cross References to Related Applications
本申请基于申请号为202111588888.1、申请日为2021年12月23日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on a Chinese patent application with application number 202111588888.1 and a filing date of December 23, 2021, and claims the priority of this Chinese patent application. The entire content of this Chinese patent application is hereby incorporated by reference into this application.
技术领域technical field
本公开涉及测试技术领域,尤其涉及一种软件在环测试方法、装置、系统及存储介质。The present disclosure relates to the technical field of testing, and in particular to a software-in-the-loop testing method, device, system and storage medium.
背景技术Background technique
目前,整车控制器的功能测试包括:模型在环测试、SIL(Software In Loop,软件在环)测试和硬件在环测试。软件在环测试系统是一套稳定的汽车软件测试系统,广泛应用于各大车厂。然而,软件在环测试系统无法对部分系统中开发的软件进行测试,即软件在环测试系统的适用性较低。At present, the functional testing of the vehicle controller includes: model-in-the-loop testing, SIL (Software In Loop, software-in-the-loop) testing and hardware-in-the-loop testing. The software-in-the-loop test system is a stable automotive software test system, which is widely used in major car manufacturers. However, the software-in-the-loop test system cannot test the software developed in some systems, that is, the applicability of the software-in-the-loop test system is low.
发明内容Contents of the invention
为了解决上述技术问题,本公开提供了一种软件在环测试方法、装置、系统及存储介质。In order to solve the above technical problems, the present disclosure provides a software-in-the-loop testing method, device, system and storage medium.
根据本公开的第一方面,提供了一种软件在环测试方法,应用于测试服务,所述方法包括:According to a first aspect of the present disclosure, a software-in-the-loop testing method is provided, which is applied to testing services, and the method includes:
接收软件在环测试系统发送的第一测试数据,所述第一测试数据根据测试消息和所述测试消息对应的消息结构体生成,所述软件在环测试系统包括与各个测试消息分别对应的消息结构体,所述消息结构体是待测软件所支持的数据类型;Receiving the first test data sent by the software-in-the-loop test system, the first test data is generated according to the test message and the message structure corresponding to the test message, and the software-in-the-loop test system includes a message corresponding to each test message A structure, the message structure is a data type supported by the software to be tested;
根据所述第一测试数据的所述消息结构体,将所述第一测试数据转换为第二测试数据;converting the first test data into second test data according to the message structure of the first test data;
向所述待测软件发送所述第二测试数据,以使所述待测软件根据所述第二测试数据进行自动化测试,得到并返回第一测试结果;Sending the second test data to the software under test, so that the software under test performs an automated test according to the second test data, obtains and returns a first test result;
根据所述消息结构体将所述第一测试结果转换为所述软件在环测试系统可识别的第二测试结果,并向所述软件在环测试系统发送所述第二测试结果。converting the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure, and sending the second test result to the software-in-the-loop test system.
在一些实施例中,所述消息结构体是根据所述测试消息和所述待测软件所支持的数据类型生成的。In some embodiments, the message structure is generated according to the test message and the data types supported by the software under test.
在一些实施例中,所述向所述待测软件发送所述第二测试数据,包括:In some embodiments, the sending the second test data to the software under test includes:
通过套接字通信方式向所述软件在环测试系统发送第一报文数据;所述第一报文数据的报文头包含所述第二测试结果对应的数据类型信息,所述第一报文数据的报文体包含所述第二测试结果。Send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data contains the data type information corresponding to the second test result, and the first message data The message body of the text data includes the second test result.
在一些实施例中,所述第一报文数据的报文体还包含所述第二测试结果的校验数据,所述校验数据用于使所述软件在环测试系统验证所述第二测试结果的有效性。In some embodiments, the message body of the first message data further includes verification data of the second test result, and the verification data is used to make the software-in-the-loop test system verify the second test validity of the results.
在一些实施例中,所述待测软件为在目标系统下开发的软件,所述目标系统包括:机器 人操作系统或数据分发服务系统。In some embodiments, the software to be tested is software developed under a target system, and the target system includes: a robot operating system or a data distribution service system.
根据本公开的第二方面,提供了一种软件在环测试方法,应用于软件在环测试系统,所述方法包括:According to a second aspect of the present disclosure, a software-in-the-loop testing method is provided, which is applied to a software-in-the-loop testing system, and the method includes:
根据测试消息和所述测试消息对应的消息结构体,生成第一测试数据,所述软件在环测试系统包括与各个测试消息分别对应的消息结构体,所述消息结构体是待测软件所支持的数据类型;Generate first test data according to the test message and the message structure corresponding to the test message, the software-in-the-loop test system includes a message structure corresponding to each test message, and the message structure is supported by the software to be tested data type;
向测试服务发送所述第一测试数据,以使所述测试服务根据所述第一测试数据得到测试结果;sending the first test data to a test service, so that the test service obtains a test result according to the first test data;
接收所述测试服务返回的所述测试结果。The test result returned by the test service is received.
在一些实施例中,所述消息结构体是根据所述测试消息和所述待测软件所支持的数据类型生成的。In some embodiments, the message structure is generated according to the test message and the data types supported by the software under test.
在一些实施例中,所述向测试服务发送所述第一测试数据,包括:In some embodiments, the sending the first test data to the test service includes:
通过套接字通信方式向测试服务发送第二报文数据,其中,所述第二报文数据的报文头包含所述第一测试数据的数据类型信息,所述第二报文数据的报文体包含所述第一测试数据。Send the second message data to the test service through socket communication, wherein the message header of the second message data includes the data type information of the first test data, and the message header of the second message data A text contains the first test data.
在一些实施例中,所述第二报文数据的报文体还包含所述第一测试数据的校验数据,所述校验数据用于使所述测试服务验证所述第一测试数据的有效性。In some embodiments, the message body of the second message data further includes check data of the first test data, and the check data is used to enable the test service to verify the validity of the first test data sex.
根据本公开的第三方面,提供了一种软件在环测试装置,应用于测试服务,所述装置包括:According to a third aspect of the present disclosure, a software-in-the-loop testing device is provided, which is applied to testing services, and the device includes:
第一测试数据接收模块,用于接收软件在环测试系统发送的第一测试数据,所述第一测试数据根据测试消息和所述测试消息对应的消息结构体生成,所述软件在环测试系统包括与各个测试消息分别对应的消息结构体,所述消息结构体是待测软件所支持的数据类型;The first test data receiving module is used to receive the first test data sent by the software-in-the-loop test system, the first test data is generated according to the test message and the message structure corresponding to the test message, and the software-in-the-loop test system Including a message structure corresponding to each test message, the message structure is a data type supported by the software to be tested;
测试数据转换模块,用于根据所述第一测试数据的所述消息结构体,将所述第一测试数据转换为第二测试数据;A test data conversion module, configured to convert the first test data into second test data according to the message structure of the first test data;
第二测试数据发送模块,用于向所述待测软件发送所述第二测试数据,以使所述待测软件根据所述第二测试数据进行自动化测试,得到并返回第一测试结果;A second test data sending module, configured to send the second test data to the software under test, so that the software under test performs an automated test according to the second test data, and obtains and returns a first test result;
测试结果转换模块,用于根据所述消息结构体将所述第一测试结果转换为所述软件在环测试系统可识别的第二测试结果;A test result conversion module, configured to convert the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure;
测试结果发送模块,用于向所述软件在环测试系统发送所述第二测试结果。A test result sending module, configured to send the second test result to the software-in-the-loop test system.
在一些实施例中,所述消息结构体是根据所述测试消息和所述待测软件所支持的数据类型生成的。In some embodiments, the message structure is generated according to the test message and the data types supported by the software under test.
在一些实施例中,所述第二测试数据发送模块,具体用于通过套接字通信方式向所述软件在环测试系统发送第一报文数据;所述第一报文数据的报文头包含所述第二测试结果对应的数据类型信息,所述第一报文数据的报文体包含所述第二测试结果。In some embodiments, the second test data sending module is specifically configured to send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data The data type information corresponding to the second test result is included, and the message body of the first message data includes the second test result.
在一些实施例中,所述第一报文数据的报文体还包含所述第二测试结果的校验数据,所述校验数据用于使所述软件在环测试系统验证所述第二测试结果的有效性。In some embodiments, the message body of the first message data further includes verification data of the second test result, and the verification data is used to make the software-in-the-loop test system verify the second test validity of the results.
在一些实施例中,所述待测软件为在目标系统下开发的软件,所述目标系统包括:机器 人操作系统或数据分发服务系统。In some embodiments, the software to be tested is software developed under a target system, and the target system includes: a robot operating system or a data distribution service system.
根据本公开的第四方面,提供了一种软件在环测试装置,应用于软件在环测试系统,所述装置包括:According to a fourth aspect of the present disclosure, a software-in-the-loop testing device is provided, which is applied to a software-in-the-loop testing system, and the device includes:
第一测试数据生成模块,用于根据测试消息和所述测试消息对应的消息结构体,生成第一测试数据,其中,所述软件在环测试系统包括与各个测试消息分别对应的消息结构体,所述消息结构体是待测软件所支持的数据类型;The first test data generation module is configured to generate first test data according to the test message and the message structure corresponding to the test message, wherein the software-in-the-loop test system includes a message structure corresponding to each test message, The message structure is a data type supported by the software to be tested;
第一测试数据发送模块,用于向测试服务发送所述第一测试数据,以使所述测试服务根据所述第一测试数据得到测试结果;A first test data sending module, configured to send the first test data to a test service, so that the test service can obtain a test result according to the first test data;
测试结果接收模块,用于接收所述测试服务返回的所述测试结果。The test result receiving module is configured to receive the test result returned by the test service.
在一些实施例中,所述消息结构体是根据所述测试消息和所述待测软件所支持的数据类型生成的。In some embodiments, the message structure is generated according to the test message and the data types supported by the software under test.
在一些实施例中,所述第一测试数据发送模块具体用于通过套接字通信方式向测试服务发送第二报文数据,其中,所述第二报文数据的报文头包含所述第一测试数据的数据类型信息,所述第二报文数据的报文体包含所述第一测试数据。In some embodiments, the first test data sending module is specifically configured to send the second packet data to the test service through socket communication, wherein the header of the second packet data contains the first Data type information of test data, the message body of the second message data includes the first test data.
在一些实施例中,所述第二报文数据的报文体还包含所述第一测试数据的校验数据,所述校验数据用于使所述测试服务验证所述第一测试数据的有效性。In some embodiments, the message body of the second message data further includes check data of the first test data, and the check data is used to enable the test service to verify the validity of the first test data sex.
根据本公开的第五方面,提供了一种测试系统,包括:软件在环测试系统和电子控制单元,所述电子控制单元包括测试服务和待测软件;According to a fifth aspect of the present disclosure, a testing system is provided, including: a software-in-the-loop testing system and an electronic control unit, the electronic control unit including a testing service and software to be tested;
所述软件在环测试系统,用于根据测试消息和所述测试消息对应的消息结构体,生成第一测试数据,向所述测试服务发送所述第一测试数据,其中,所述软件在环测试系统包括与各个测试消息分别对应的消息结构体,所述消息结构体是待测软件所支持的数据类型;The software-in-the-loop testing system is configured to generate first test data according to a test message and a message structure corresponding to the test message, and send the first test data to the test service, wherein the software-in-the-loop The test system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested;
所述测试服务,用于根据所述第一测试数据的所述消息结构体,将所述第一测试数据转换为第二测试数据;向所述待测软件发送所述第二测试数据;The test service is configured to convert the first test data into second test data according to the message structure of the first test data; send the second test data to the software under test;
所述待测软件,用于根据所述第二测试数据进行自动化测试,得到第一测试结果,并向所述测试服务返回所述第一测试结果;The software under test is used to perform an automated test according to the second test data, obtain a first test result, and return the first test result to the test service;
所述测试服务,还用于根据所述消息结构体将所述第一测试结果转换为所述软件在环测试系统可识别的第二测试结果,并向所述软件在环测试系统发送所述第二测试结果。The test service is further configured to convert the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure, and send the Second test result.
在一些实施例中,所述消息结构体是根据所述测试消息和所述待测软件所支持的数据类型生成的。In some embodiments, the message structure is generated according to the test message and the data types supported by the software under test.
在一些实施例中,所述软件在环测试系统具体用于通过套接字通信方式向测试服务发送第二报文数据,其中,所述第二报文数据的报文头包含所述第一测试数据的数据类型信息,所述第二报文数据的报文体包含所述第一测试数据。In some embodiments, the software-in-the-loop test system is specifically configured to send the second message data to the test service through socket communication, wherein the message header of the second message data contains the first The data type information of the test data, the message body of the second message data includes the first test data.
在一些实施例中,所述第二报文数据的报文体还包含所述第一测试数据的校验数据,所述校验数据用于使所述测试服务验证所述第一测试数据的有效性。In some embodiments, the message body of the second message data further includes check data of the first test data, and the check data is used to enable the test service to verify the validity of the first test data sex.
在一些实施例中,所述测试服务,具体用于通过套接字通信方式向所述软件在环测试系统发送第一报文数据;所述第一报文数据的报文头包含所述第二测试结果对应的数据类型信 息,所述第一报文数据的报文体包含所述第二测试结果。In some embodiments, the test service is specifically configured to send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data includes the first The data type information corresponding to the second test result, the message body of the first message data includes the second test result.
在一些实施例中,所述第一报文数据的报文体还包含所述第二测试结果的校验数据,所述校验数据用于使所述软件在环测试系统验证所述第二测试结果的有效性。In some embodiments, the message body of the first message data further includes verification data of the second test result, and the verification data is used to make the software-in-the-loop test system verify the second test validity of the results.
在一些实施例中,所述待测软件为在目标系统下开发的软件,所述目标系统包括:机器人操作系统或数据分发服务系统。In some embodiments, the software to be tested is software developed under a target system, and the target system includes: a robot operating system or a data distribution service system.
根据本公开的第六方面,提供了一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现第一方面或第二方面所述的方法。According to a sixth aspect of the present disclosure, there is provided an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, when the processor executes the computer program , implementing the method described in the first aspect or the second aspect.
根据本公开的第七方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现第一方面或第二方面所述的方法。According to a seventh aspect of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.
根据本公开的第八方面,提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行第一方面或第二方面所述的方法。According to an eighth aspect of the present disclosure, there is provided a computer program product, which causes the computer to execute the method described in the first aspect or the second aspect when the computer program product is run on a computer.
软件在环测试系统包括与各个测试消息分别对应的消息结构体,该消息结构体是待测软件所支持的数据类型。软件在环测试系统根据测试消息和测试消息对应的消息结构体可以生成第一测试数据,并向测试服务发送第一测试数据。测试服务根据第一测试数据的消息结构体,将来自软件在环测试系统的第一测试数据转换为第二测试数据,从而使待测软件可以根据第二测试数据进行自动化测试,并返回第一测试结果。类似地,测试服务将来自待测软件的第一测试结果转换为软件在环测试系统可以识别的第二测试结果。可见,在软件在环试系统发出测试信号后,能够得到待测软件应答的处理结果,即,在软件在环测试系统无法对待测软件测试的情况下,通过将软件在环测试系统与测试服务相结合,实现了对待测软件进行软件在环自动化测试,从而增大软件在环测试系统的测试范围,提高了软件在环测试系统的适用性。The software-in-the-loop testing system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested. The software-in-the-loop testing system can generate the first test data according to the test message and the message structure corresponding to the test message, and send the first test data to the test service. The test service converts the first test data from the software-in-the-loop test system into the second test data according to the message structure of the first test data, so that the software under test can perform automated testing according to the second test data, and returns the first Test Results. Similarly, the test service converts the first test result from the software under test into a second test result that can be recognized by the software-in-the-loop test system. It can be seen that after the software-in-the-loop test system sends a test signal, the processing result of the software to be tested can be obtained, that is, when the software-in-the-loop test system cannot test the software to be tested, the software-in-the-loop test system and the test service Combined, the automated software-in-the-loop testing of the software to be tested is realized, thereby increasing the testing range of the software-in-the-loop testing system and improving the applicability of the software-in-the-loop testing system.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, In other words, other drawings can also be obtained from these drawings without paying creative labor.
图1示出了可以应用于本公开实施例的软件在环测试方法的示例性应用环境的系统架构的示意图;FIG. 1 shows a schematic diagram of a system architecture of an exemplary application environment of a software-in-the-loop testing method that can be applied to an embodiment of the present disclosure;
图2为本公开实施例中软件在环测试方法的一种流程图;FIG. 2 is a flowchart of a software-in-the-loop testing method in an embodiment of the present disclosure;
图3为本公开实施例中生成测试服务和软件在环测试系统的方法流程图;FIG. 3 is a flowchart of a method for generating a test service and a software-in-the-loop test system in an embodiment of the present disclosure;
图4为本公开实施例中软件在环测试方法的又一种流程图;FIG. 4 is another flowchart of a software-in-the-loop testing method in an embodiment of the present disclosure;
图5为本公开实施例中软件在环测试方法的一种交互流程图;FIG. 5 is an interactive flowchart of a software-in-the-loop testing method in an embodiment of the present disclosure;
图6A为本公开实施例中软件在环测试装置的一种结构示意图;FIG. 6A is a schematic structural diagram of a software-in-the-loop testing device in an embodiment of the present disclosure;
图6B为本公开实施例中软件在环测试装置的又一种结构示意图;FIG. 6B is another schematic structural diagram of a software-in-the-loop testing device in an embodiment of the present disclosure;
图7为本公开实施例中测试系统的一种结构示意图;FIG. 7 is a schematic structural diagram of a test system in an embodiment of the present disclosure;
图8为本公开实施例中电子设备的一种结构示意图。FIG. 8 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
具体实施方式Detailed ways
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。In order to more clearly understand the above objects, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, in the case of no conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other.
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。In the following description, many specific details are set forth in order to fully understand the present disclosure, but the present disclosure can also be implemented in other ways than described here; obviously, the embodiments in the description are only some of the embodiments of the present disclosure, and Not all examples.
图1示出了可以应用于本公开实施例的软件在环测试方法的示例性应用环境的系统架构的示意图。FIG. 1 shows a schematic diagram of a system architecture of an exemplary application environment of a software-in-the-loop testing method that can be applied to an embodiment of the present disclosure.
其中,软件在环测试是指通过运行系统环境中的车辆模型和虚拟ECU(Electronic Control Unit,电子控制单元)中的I/O(输入/输出)模型来模拟控制器所需的各种传感器信号,并接收台架传感器的信号和虚拟ECU发出的控制信号,从而与被测虚拟ECU的代码信息(包括基础软件和硬件参数等)和系统环境模型相连接,最终实现闭环仿真对控制系统进行测试验证。Among them, the software-in-the-loop test refers to simulating various sensor signals required by the controller by running the vehicle model in the system environment and the I/O (input/output) model in the virtual ECU (Electronic Control Unit, electronic control unit) , and receive the signal of the bench sensor and the control signal sent by the virtual ECU, so as to connect with the code information (including basic software and hardware parameters, etc.) of the virtual ECU under test and the system environment model, and finally realize the closed-loop simulation to test the control system verify.
如图1所示,系统架构100可以包括软件在环测试系统101、测试服务102和待测软件103,测试服务102和待测软件103可以位于同一个电子控制单元104中。本公开实施例所提供的软件在环测试方法可以由软件在环测试系统101、测试服务102和待测软件103执行,测试服务102可以将来自软件在环测试系统101的数据转换为待测软件103可识别的数据,以及将来自待测软件103的数据转换为软件在环测试系统101可以识别的数据,从而实现软件在环测试系统101对待测软件103进行软件在环自动化测试,提高软件在环测试系统101的适用性。As shown in FIG. 1 , the system architecture 100 may include a software-in-the-loop testing system 101 , a testing service 102 and a software to be tested 103 , and the testing service 102 and the software to be tested 103 may be located in the same electronic control unit 104 . The software-in-the-loop test method provided by the embodiment of the present disclosure can be executed by the software-in-the-loop test system 101, the test service 102, and the software under test 103, and the test service 102 can convert the data from the software-in-the-loop test system 101 into the software under test 103 identifiable data, and convert the data from the software-to-be-tested 103 into data recognizable by the software-in-the-loop testing system 101, thereby realizing the software-in-the-loop testing system 101 to perform software-in-the-loop automated testing on the software-to-be-tested 103, and improving the software-in-the-loop testing system 101 Ring test system 101 suitability.
以下首先在测试服务侧对本公开实施例的软件在环测试方法进行介绍。The software-in-the-loop testing method of the embodiment of the present disclosure is firstly introduced below on the testing service side.
参见图2,图2为本公开实施例中软件在环测试方法的一种流程图,应用于测试服务,可以包括以下步骤S210至S240。Referring to FIG. 2 , FIG. 2 is a flowchart of a software-in-the-loop testing method in an embodiment of the present disclosure, which is applied to testing services and may include the following steps S210 to S240.
步骤S210,接收软件在环测试系统发送的第一测试数据,第一测试数据根据测试消息和测试消息对应的消息结构体生成。Step S210, receiving first test data sent by the software-in-the-loop test system, where the first test data is generated according to the test message and the message structure corresponding to the test message.
软件在环测试系统是一种汽车软件测试系统,可以对汽车中的应用软件进行测试。软件在环测试系统使用Message数据对应用软件进行测试,应用软件对应的代码一般为I/O模型。在某些系统下,软件在环测试系统使用Message数据无法对该系统下开发的应用软件进行测试。待测软件指软件在环测试系统无法测试的软件,在一些实施例中,待测软件为在目标系统下开发的软件,目标系统可以包括:ROS(Robot Operating System,机器人操作系统)系统或DDS(data distribution service,数据分发服务)系统。The software-in-the-loop test system is an automotive software testing system that can test the application software in the car. The software-in-the-loop test system uses Message data to test the application software, and the code corresponding to the application software is generally an I/O model. In some systems, the software-in-the-loop test system cannot test the application software developed under the system using Message data. The software to be tested refers to the software that the software-in-the-loop test system cannot test. In some embodiments, the software to be tested is software developed under the target system, and the target system can include: ROS (Robot Operating System, robot operating system) system or DDS (data distribution service, data distribution service) system.
其中,ROS系统是用于编写机器人软件程序的一种具有高度灵活性的软件架构。相关技术中,针对ROS系统下的应用软件测试需要对接基于ROS软件架构编写的测试用例,并且需要测试用例运行在ROS环境下,因此对软件测试人员编写测试用例提出了非常高的要求,测试环境以及测试用例要求比较局限,不能适应通用的软件在环测试框架。Among them, the ROS system is a highly flexible software architecture for writing robot software programs. In related technologies, application software testing under the ROS system needs to be connected to test cases written based on the ROS software architecture, and the test cases need to be run in the ROS environment. Therefore, very high requirements are put forward for software testers to write test cases. The test environment And the test case requirements are relatively limited, which cannot be adapted to the general software-in-the-loop testing framework.
为了可以对待测软件进行软件在环测试,可以预先将各个测试消息分别对应的消息结构体编译至软件在环测试系统,这样,软件在环测试系统包括与各个测试消息分别对应的消息结构体,消息结构体是待测软件所支持的数据类型,待测软件所支持的数据类型可以包括int、bool、float、unit等。这样,软件在环测试系统可以根据测试消息和测试消息对应的消息结构体生成第一测试数据,也就是,根据待测软件所支持的数据类型,将原始的Message数据转换为结构体类型的测试数据。In order to carry out the software-in-the-loop test for the software to be tested, the message structures corresponding to each test message can be compiled into the software-in-the-loop test system in advance, so that the software-in-the-loop test system includes a message structure corresponding to each test message respectively, The message structure is the data type supported by the software to be tested, and the data types supported by the software to be tested may include int, bool, float, unit, etc. In this way, the software-in-the-loop test system can generate the first test data according to the test message and the message structure corresponding to the test message, that is, according to the data type supported by the software to be tested, the original Message data is converted into a test structure type data.
步骤S220,根据第一测试数据的消息结构体,将第一测试数据转换为第二测试数据。Step S220, converting the first test data into second test data according to the message structure of the first test data.
由于第一测试数据是结构体类型的测试数据,不同的第一测试数据对应不同的消息结构体,因此测试服务接收到第一测试数据后,可以根据第一测试数据的消息结构体,将第一测试数据转换为第二测试数据。第二测试数据可以是非结构体类型的测试数据,并且,第二测试数据可以被待测软件识别。Since the first test data is test data of a structure type, and different first test data correspond to different message structures, after receiving the first test data, the test service can send the first test data to the message structure according to the message structure of the first test data. A test data is converted into a second test data. The second test data may be non-structure type test data, and the second test data may be recognized by the software to be tested.
例如,如果待测软件为ROS系统下开发的软件,软件服务中可以启动待测软件中订阅的topic、server、action等服务,模拟为待测软件提供数据或者服务的源,将从软件在环测试系统接收到的第一测试数据转换为ROS相关Message信号。For example, if the software to be tested is software developed under the ROS system, the software services can start the subscribed topic, server, action and other services in the software to be tested, and simulate the source that provides data or services for the software to be tested. The first test data received by the test system is converted into a ROS-related Message signal.
步骤S230,向待测软件发送第二测试数据,以使待测软件根据第二测试数据进行自动化测试,得到并返回第一测试结果。Step S230 , sending the second test data to the software under test, so that the software under test performs an automated test according to the second test data, and obtains and returns the first test result.
测试服务进行数据转换得到第二测试数据后,可以向待测软件发送第二测试数据。这样,待测软件可以根据可识别的第二测试数据进行自动化测试,得到第一测试结果,并将第一测试结果返回至测试服务。After the test service performs data conversion to obtain the second test data, it can send the second test data to the software under test. In this way, the software under test can perform an automated test according to the identifiable second test data, obtain the first test result, and return the first test result to the test service.
步骤S240,根据消息结构体将第一测试结果转换为软件在环测试系统可识别的第二测试结果,并向软件在环测试系统发送第二测试结果。Step S240, converting the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure, and sending the second test result to the software-in-the-loop test system.
本公开实施例中,针对测试服务接收到的第一测试结果,软件在环测试系统也是无法识别的。与前述步骤S220的数据转换过程相反,测试服务可以根据第一测试数据的消息结构体将第一测试结果转换为软件在环测试系统可识别的第二测试结果。可以看出,软件在环测试系统发送第一测试数据后,通过测试服务的数据转换,可以得到相应的测试结果,从而实现可以对不同系统下开发的软件进行测试。In the embodiment of the present disclosure, the software-in-the-loop testing system cannot recognize the first test result received by the testing service. Contrary to the data conversion process in the aforementioned step S220, the test service may convert the first test result into a second test result recognizable by the SIL test system according to the message structure of the first test data. It can be seen that after the software-in-the-loop test system sends the first test data, the corresponding test results can be obtained through the data conversion of the test service, so that software developed under different systems can be tested.
本公开实施例的软件在环测试方法,软件在环测试系统包括与各个测试消息分别对应的消息结构体,该消息结构体是待测软件所支持的数据类型。软件在环测试系统根据测试消息和测试消息对应的消息结构体可以生成第一测试数据,并向测试服务发送第一测试数据。测试服务根据第一测试数据的消息结构体,将来自软件在环测试系统的第一测试数据转换为第二测试数据,从而使待测软件可以根据第二测试数据进行自动化测试,并返回第一测试结果。类似地,测试服务将来自待测软件的第一测试结果转换为软件在环测试系统可以识别的第二 测试结果。可见,在软件在环试系统发出测试信号后,能够得到待测软件应答的处理结果,即,在软件在环测试系统无法对待测软件测试的情况下,通过将软件在环测试系统与测试服务相结合,实现了对待测软件进行软件在环自动化测试,从而增大软件在环测试系统的测试范围,提高了软件在环测试系统的适用性。In the software-in-the-loop testing method of the embodiment of the disclosure, the software-in-the-loop testing system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested. The software-in-the-loop testing system can generate the first test data according to the test message and the message structure corresponding to the test message, and send the first test data to the test service. The test service converts the first test data from the software-in-the-loop test system into the second test data according to the message structure of the first test data, so that the software under test can perform automated testing according to the second test data, and returns the first Test Results. Similarly, the test service converts the first test result from the software under test into a second test result that can be recognized by the software-in-the-loop test system. It can be seen that after the software-in-the-loop test system sends a test signal, the processing result of the software to be tested can be obtained, that is, when the software-in-the-loop test system cannot test the software to be tested, the software-in-the-loop test system and the test service Combined, the automated software-in-the-loop testing of the software to be tested is realized, thereby increasing the testing range of the software-in-the-loop testing system and improving the applicability of the software-in-the-loop testing system.
本公开实施例中,消息结构体是根据测试消息和待测软件所支持的数据类型生成的。参见图3,图3为本公开实施例中生成测试服务和软件在环测试系统的方法流程图,可以包括以下步骤S310至S340。In the embodiment of the present disclosure, the message structure is generated according to the test message and the data type supported by the software to be tested. Referring to FIG. 3 , FIG. 3 is a flowchart of a method for generating a test service and a software-in-the-loop test system in an embodiment of the present disclosure, which may include the following steps S310 to S340 .
步骤S310,获取各个测试消息和数据类型文件;其中,数据类型文件中包括待测软件所支持的数据类型。Step S310, obtaining various test messages and data type files; wherein, the data type files include data types supported by the software to be tested.
测试消息指软件在环测试系统进行测试时所使用的消息,不同的测试消息用于测试不同的功能。例如,针对文件名为door.msg的测试消息,该测试消息中可以包含如下内容:The test message refers to the message used by the software-in-the-loop test system for testing, and different test messages are used to test different functions. For example, for a test message whose file name is door.msg, the test message may contain the following content:
#Vehicle speed out当前车速#Vehicle speed out
float32 veh_spd 0float32 veh_spd 0
#Front Left Door Status左前门状态信号#Front Left Door Status Left Front Door Status Signal
uint8 fldoor_sts 0uint8 fldoor_sts 0
#Front Right Door Status右前门状态信号#Front Right Door Status Right Front Door Status Signal
uint8 frdoor_sts 0uint8 frdoor_sts 0
#Rear Left Door Status左后门状态信号#Rear Left Door Status Left rear door status signal
uint8 rldoor_sts 0uint8 rldoor_sts 0
#Rear Right Door Status右后门状态信号#Rear Right Door Status Right rear door status signal
uint8 rrdoor_sts 0uint8 rrdoor_sts 0
上述测试消息用于测试车辆的速度和各个车门的状态。The above test message is used to test the speed of the vehicle and the state of each door.
数据类型文件是描述数据类型的文件,可以被用来生成不同语言的源代码。数据类型文件中包括待测软件所支持的所有数据类型,int、bool、float、unit等。例如,针对ROS系统的数据类型文件,可以使用简化的消息描述语言来描述ROS节点发布的数据。Datatype files are files describing datatypes that can be used to generate source code in different languages. The data type file includes all data types supported by the software under test, such as int, bool, float, unit, etc. For example, for the data type file of the ROS system, a simplified message description language can be used to describe the data published by the ROS node.
步骤S320,根据数据类型和单个测试消息,生成单个测试消息对应的消息结构体。Step S320, generating a message structure corresponding to a single test message according to the data type and the single test message.
根据该数据类型文件中的数据类型,可以生成每个测试消息对应的消息结构体。在一些实施例中,可以利用预先编写的脚本文件,根据数据类型和单个测试消息,生成该单个测试消息对应的消息结构体,以提高消息结构体生成的效率。According to the data type in the data type file, the message structure corresponding to each test message can be generated. In some embodiments, a pre-written script file may be used to generate a message structure corresponding to the single test message according to the data type and the single test message, so as to improve the efficiency of generating the message structure.
例如,上述测试消息door.msg,可以生成消息结构体door.hpp,可以表示如下:For example, the above test message door.msg can generate a message structure door.hpp, which can be expressed as follows:
Figure PCTCN2022140157-appb-000001
Figure PCTCN2022140157-appb-000001
Figure PCTCN2022140157-appb-000002
Figure PCTCN2022140157-appb-000002
步骤S330,将消息结构体添加至测试服务代码,编译生成测试服务。Step S330, adding the message structure to the test service code, compiling and generating the test service.
步骤S340,将消息结构体添加至软件在环测试系统代码,编译生成软件在环测试系统。Step S340, adding the message structure to the software-in-the-loop test system code, compiling and generating the software-in-the-loop test system.
将生成的消息结构体添加至测试服务代码和软件在环测试系统代码,可以编译生成测试服务和软件在环测试系统。需要说明的是,在软件在环测试系统新增测试消息的情况下,可以根据新增的测试消息和数据类型文件中的数据类型,生成新的消息结构体,并将新的消息结构体添加至测试服务代码和软件在环测试系统代码,重新编译生成新的测试服务和新的软件在环测试系统。The generated message structure is added to the test service code and the software-in-the-loop test system code, and the test service and the software-in-the-loop test system can be compiled and generated. It should be noted that, when a new test message is added to the software-in-the-loop test system, a new message structure can be generated according to the newly added test message and the data type in the data type file, and the new message structure can be added to To test service code and software-in-the-loop test system code, recompile and generate new test service and new software-in-the-loop test system.
本公开实施例的软件在环测试方法,可以使用脚本自动化生成结构化的数据类型为软件在环测试系统和测试服务共同使用,和待测软件的数据类型实现内存排布上的统一,从而方便各个系统间数据的流转,最终实现软件在环测试系统可以对待测软件进行测试。The software-in-the-loop testing method of the embodiment of the present disclosure can use scripts to automatically generate structured data types for use by the software-in-the-loop testing system and testing services, and realize the unification of the memory arrangement with the data types of the software to be tested, thereby facilitating The flow of data between various systems finally realizes that the software-in-the-loop test system can test the software to be tested.
参见图4,图4为本公开实施例中软件在环测试方法的又一种流程图,应用于软件在环测试系统,可以包括以下步骤S410至S430。Referring to FIG. 4 , FIG. 4 is another flow chart of a software-in-the-loop testing method in an embodiment of the present disclosure, which is applied to a software-in-the-loop testing system and may include the following steps S410 to S430.
步骤S410,根据测试消息和测试消息对应的消息结构体,生成第一测试数据,软件在环测试系统包括与各个测试消息分别对应的消息结构体,消息结构体是待测软件所支持的数据类型。Step S410, generate first test data according to the test message and the message structure corresponding to the test message, the software-in-the-loop test system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested .
步骤S420,向测试服务发送第一测试数据,以使测试服务根据第一测试数据得到测试结果。Step S420, sending the first test data to the test service, so that the test service can obtain test results according to the first test data.
步骤S430,接收测试服务返回的测试结果。Step S430, receiving the test result returned by the test service.
上述图4实施例是与图2实施例对应的软件在环测试系统侧的软件在环测试方法,相关之处可参见图2实施例中的描述即可,在此不再赘述。The above-mentioned embodiment in FIG. 4 is a software-in-the-loop testing method on the side of the software-in-the-loop testing system corresponding to the embodiment in FIG.
参见图5,图5为本公开实施例中软件在环测试方法的一种交互流程图,可以包括以下步骤S510至S580。Referring to FIG. 5 , FIG. 5 is an interactive flowchart of a software-in-the-loop testing method in an embodiment of the present disclosure, which may include the following steps S510 to S580.
步骤S510,根据测试消息和测试消息对应的消息结构体,生成第一测试数据,软件在环测试系统包括与各个测试消息分别对应的消息结构体,消息结构体是待测软件所支持的数据类型。Step S510, generate first test data according to the test message and the message structure corresponding to the test message, the software-in-the-loop test system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested .
如前所述,根据数据类型文件和各个测试消息,可以生成各个测试消息分别对应的消息结构体。根据测试消息和测试消息对应的消息结构体,可以生成第一测试数据。例如,根据测试消息door.msg和消息结构体door.hpp,可以生成如下第一测试数据:As mentioned above, according to the data type file and each test message, a message structure corresponding to each test message can be generated. According to the test message and the message structure corresponding to the test message, the first test data can be generated. For example, according to the test message door.msg and the message structure door.hpp, the following first test data can be generated:
door.veh_spd=100;door.veh_spd = 100;
door.fldoor_sts=1;door.fldoor_sts = 1;
door.frdoor_sts=2;door.frdoor_sts = 2;
door.rldoor_sts=3;door.rldoor_sts = 3;
door.rrdoor_sts=4;door.rrdoor_sts = 4;
该第一测试数据中车辆的速度为100,各个车门的状态分别为1、2、3、4。In the first test data, the speed of the vehicle is 100, and the states of each door are 1, 2, 3, and 4 respectively.
步骤S520,向测试服务发送第一测试数据。Step S520, sending the first test data to the test service.
本公开实施例中,软件在环测试系统和测试服务之间的通信方式可以包括socket(套接字)通信方式。软件在环测试系统可以通过socket通信方式向测试服务发送第二报文数据,其中,第二报文数据的报文头包含第一测试数据的数据类型信息,第二报文数据的报文体包含第一测试数据。测试服务可以根据报文头中的数据类型信息进行正确解析,得到软件在环测试系统发送的第一测试数据。In the embodiment of the present disclosure, the communication mode between the software-in-the-loop test system and the test service may include a socket (socket) communication mode. The software-in-the-loop test system can send the second message data to the test service through socket communication, wherein the message header of the second message data contains the data type information of the first test data, and the message body of the second message data contains first test data. The test service can correctly analyze according to the data type information in the message header, and obtain the first test data sent by the software-in-the-loop test system.
在一些实施例中,第二报文数据的报文体还可以包含第一测试数据的校验数据,校验数据用于使测试服务验证第一测试数据的有效性。校验数据可以是crc(循环冗余校验)码等,这样,测试服务进一步对解析出的数据进行校验核对,判断数据的有效性。In some embodiments, the message body of the second message data may further include verification data of the first test data, and the verification data is used to enable the test service to verify the validity of the first test data. The verification data may be a crc (cyclic redundancy check) code, etc. In this way, the test service further checks the parsed data to judge the validity of the data.
步骤S530,根据第一测试数据的消息结构体,将第一测试数据转换为第二测试数据。Step S530, converting the first test data into second test data according to the message structure of the first test data.
测试服务根据消息结构体,可以将接收自软件在环测试系统的第一测试数据转换为第二测试数据。例如,针对如下第一测试数据:The test service can convert the first test data received from the software-in-the-loop test system into the second test data according to the message structure. For example, for the following first test data:
door.veh_spd=100;door.veh_spd = 100;
door.fldoor_sts=1;door.fldoor_sts = 1;
door.frdoor_sts=2;door.frdoor_sts = 2;
door.rldoor_sts=3;door.rldoor_sts = 3;
door.rrdoor_sts=4;door.rrdoor_sts = 4;
根据消息结构体door.hpp,可以生成如下第二测试数据:According to the message structure door.hpp, the following second test data can be generated:
veh-spd=100;veh_spd=100;
fldoor_sts=1;fldoor_sts = 1;
frdoor_sts=2;frdoor_sts = 2;
rldoor_sts=3;rldoor_sts = 3;
rrdoor_sts=4;rrdoor_sts = 4;
上述第二测试数据是待测软件可识别的数据。可以看出,待测软件接收到的第二测试数据和软件在环测试系统发送的第一测试数据的数据类型不同,但数据内容相同。The above-mentioned second test data is data recognizable by the software under test. It can be seen that the data type of the second test data received by the software to be tested is different from the first test data sent by the software-in-the-loop test system, but the data content is the same.
步骤S540,向待测软件发送第二测试数据。Step S540, sending the second test data to the software under test.
步骤S550,待测软件根据第二测试数据进行自动化测试,得到第一测试结果。In step S550, the software under test performs an automated test according to the second test data to obtain a first test result.
步骤S560,待测软件向测试服务发送第一测试结果。Step S560, the software under test sends the first test result to the test service.
步骤S570,根据消息结构体将第一测试结果转换为软件在环测试系统可识别的第二测试结果。Step S570, converting the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure.
步骤S580,向软件在环测试系统发送第二测试结果。Step S580, sending the second test result to the software-in-the-loop testing system.
与步骤S520类似,测试服务可以通过socket通信方式向软件在环测试系统发送第一报文数据;其中,第一报文数据的报文头包含第二测试结果对应的数据类型信息,第一报文数据的报文体包含第二测试结果。软件在环测试系统可以根据报文头中的数据类型信息进行正确解析,得到第二测试结果。Similar to step S520, the test service can send the first message data to the software-in-the-loop test system through socket communication; wherein, the message header of the first message data contains the data type information corresponding to the second test result, and the first report The message body of the text data includes the second test result. The software-in-the-loop test system can correctly analyze according to the data type information in the message header, and obtain the second test result.
在一些实施例中,第一报文数据的报文体中还可以包含第二测试结果的校验数据,校验数据用于使软件在环测试系统验证第二测试结果的有效性。这样,软件在环测试系统进一步对解析出的数据进行校验核对,判断数据有效性。In some embodiments, the message body of the first message data may further include verification data of the second test result, and the verification data is used to enable the software-in-the-loop test system to verify the validity of the second test result. In this way, the software-in-the-loop test system further checks the parsed data to judge the validity of the data.
本公开实施例的软件在环测试方法,可以将预先生成的、包括待测软件所支持的数据类型的消息结构体编译至测试服务和软件在环测试系统供测试服务和软件在环测试系统共同使用。软件在环测试系统根据测试消息和测试消息对应的消息结构体可以生成第一测试数据,将第一测试数据的数据类型信息填充至报文头,第一测试数据及校验数据填充至报文体后向测试服务发送。测试服务可以根据报文头中的数据类型信息准确解析出第一测试数据,还可以根据校验数据,验证第一测试数据的有效性。之后,将第一测试数据转换为第二测试数据,从而使待测软件可以根据第二测试数据进行自动化测试,并返回第一测试结果。类似地,测试服务将来自待测软件的第一测试结果转换为软件在环测试系统可以识别的第二测试结果。可见,在软件在环测试系统无法对待测软件测试的情况下,通过将软件在环测试系统和软件服务相结合,实现了对待测软件进行软件在环自动化测试,从而增大软件在环测试系统的测试范围,提高了软件在环测试系统的适用性。The software-in-the-loop testing method of the embodiment of the present disclosure can compile the pre-generated message structure including the data types supported by the software to be tested to the test service and the software-in-the-loop test system for the test service and the software-in-the-loop test system to share use. The software-in-the-loop test system can generate the first test data according to the test message and the message structure corresponding to the test message, fill the data type information of the first test data into the message header, and fill the first test data and verification data into the message body Sent to the test service later. The test service can accurately parse out the first test data according to the data type information in the packet header, and can also verify the validity of the first test data according to the verification data. Afterwards, the first test data is converted into the second test data, so that the software under test can perform automated testing according to the second test data, and return the first test result. Similarly, the test service converts the first test result from the software under test into a second test result that can be recognized by the software-in-the-loop test system. It can be seen that when the software-in-the-loop test system cannot test the software to be tested, by combining the software-in-the-loop test system and software services, the automatic software-in-the-loop test of the software to be tested is realized, thereby increasing the size of the software-in-the-loop test system. The test range improves the applicability of the software-in-the-loop test system.
相应于上述方法实施例,本公开实施例还提供了一种软件在环测试装置,应用于测试服务,参见图6A,该软件在环测试装置包括:第一测试数据接收模块602,测试数据转换模块604,第二测试数据发送模块606,测试结果转换模块608和测试结果发送模块610。Corresponding to the above-mentioned method embodiment, the embodiment of the present disclosure also provides a software-in-the-loop test device, which is applied to test services. Referring to FIG. 6A, the software-in-the-loop test device includes: a first test data receiving module 602, a test data conversion module 604 , a second test data sending module 606 , a test result conversion module 608 and a test result sending module 610 .
第一测试数据接收模块602,用于接收软件在环测试系统发送的第一测试数据,第一测试数据根据测试消息和测试消息对应的消息结构体生成,软件在环测试系统包括与各个测试消息分别对应的消息结构体,消息结构体是待测软件所支持的数据类型;The first test data receiving module 602 is used to receive the first test data sent by the software-in-the-loop test system. The first test data is generated according to the test message and the message structure corresponding to the test message. The software-in-the-loop test system includes information related to each test message. Corresponding message structure, the message structure is the data type supported by the software under test;
测试数据转换模块604,用于根据第一测试数据的消息结构体,将第一测试数据转换为第二测试数据;A test data conversion module 604, configured to convert the first test data into second test data according to the message structure of the first test data;
第二测试数据发送模块606,用于向待测软件发送第二测试数据,以使待测软件根据第二测试数据进行自动化测试,得到并返回第一测试结果;The second test data sending module 606 is configured to send the second test data to the software under test, so that the software under test performs automated testing according to the second test data, and obtains and returns the first test result;
测试结果转换模块608,用于根据消息结构体将第一测试结果转换为软件在环测试系统可识别的第二测试结果;A test result conversion module 608, configured to convert the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure;
测试结果发送模块610,用于向软件在环测试系统发送第二测试结果。The test result sending module 610 is configured to send the second test result to the software-in-the-loop test system.
在一些实施例中,消息结构体是根据测试消息和待测软件所支持的数据类型生成的。In some embodiments, the message structure is generated according to the test message and the data types supported by the software to be tested.
在一些实施例中,第二测试数据发送模块606,具体用于通过套接字通信方式向软件在环测试系统发送第一报文数据;第一报文数据的报文头包含第二测试结果对应的数据类型信息,第一报文数据的报文体包含第二测试结果。In some embodiments, the second test data sending module 606 is specifically configured to send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data includes the second test result Corresponding to the data type information, the message body of the first message data includes the second test result.
在一些实施例中,第一报文数据的报文体还包含第二测试结果的校验数据,校验数据用于使软件在环测试系统验证第二测试结果的有效性。In some embodiments, the message body of the first message data further includes verification data of the second test result, and the verification data is used to enable the software-in-the-loop test system to verify the validity of the second test result.
在一些实施例中,待测软件为在目标系统下开发的软件,目标系统包括:机器人操作系统或数据分发服务系统。In some embodiments, the software to be tested is software developed under the target system, and the target system includes: a robot operating system or a data distribution service system.
本公开实施例还提供了一种软件在环测试装置,应用于软件在环测试系统,参见图6B,软件在环测试装置包括:第一测试数据生成模块612,第一测试数据发送模块614和测试结果接收模块616。An embodiment of the present disclosure also provides a software-in-the-loop test device, which is applied to a software-in-the-loop test system. Referring to FIG. 6B, the software-in-the-loop test device includes: a first test data generation module 612, a first test data sending module 614 Test result receiving module 616 .
第一测试数据生成模块612,用于根据测试消息和测试消息对应的消息结构体,生成第一测试数据,其中,软件在环测试系统包括与各个测试消息分别对应的消息结构体,消息结构体是待测软件所支持的数据类型;The first test data generation module 612 is configured to generate first test data according to the test message and the message structure corresponding to the test message, wherein the software-in-the-loop test system includes a message structure corresponding to each test message, and the message structure is the data type supported by the software under test;
第一测试数据发送模块614,用于向测试服务发送第一测试数据,以使测试服务根据第一测试数据得到测试结果;The first test data sending module 614 is configured to send the first test data to the test service, so that the test service can obtain a test result according to the first test data;
测试结果接收模块616,用于接收测试服务返回的测试结果。The test result receiving module 616 is configured to receive the test result returned by the test service.
在一些实施例中,消息结构体是根据测试消息和待测软件所支持的数据类型生成的。In some embodiments, the message structure is generated according to the test message and the data types supported by the software to be tested.
在一些实施例中,第一测试数据发送模块614具体用于通过套接字通信方式向测试服务发送第二报文数据,其中,第二报文数据的报文头包含第一测试数据的数据类型信息,第二报文数据的报文体包含第一测试数据。In some embodiments, the first test data sending module 614 is specifically configured to send the second message data to the test service through socket communication, where the header of the second message data contains the data of the first test data Type information, the message body of the second message data includes the first test data.
在一些实施例中,第二报文数据的报文体还包含第一测试数据的校验数据,校验数据用于使测试服务验证第一测试数据的有效性。In some embodiments, the message body of the second message data further includes verification data of the first test data, and the verification data is used to enable the test service to verify the validity of the first test data.
上述装置中各模块或单元的具体细节已经在对应的方法中进行了详细的描述,因此此处不再赘述。The specific details of each module or unit in the above device have been described in detail in the corresponding method, so details are not repeated here.
本公开实施例还提供了一种测试系统,参见图7,测试系统700包括:软件在环测试系统710和电子控制单元720,电子控制单元720包括测试服务722和待测软件724;An embodiment of the present disclosure also provides a test system. Referring to FIG. 7 , the test system 700 includes: a software-in-the-loop test system 710 and an electronic control unit 720, and the electronic control unit 720 includes a test service 722 and a software to be tested 724;
软件在环测试系统710,用于根据测试消息和测试消息对应的消息结构体,生成第一测试数据,向测试服务发送第一测试数据,其中,软件在环测试系统包括与各个测试消息分别对应的消息结构体,消息结构体是待测软件所支持的数据类型;The software-in-the-loop test system 710 is configured to generate first test data according to the test message and the message structure corresponding to the test message, and send the first test data to the test service, wherein the software-in-the-loop test system includes The message structure, the message structure is the data type supported by the software under test;
测试服务722,用于根据第一测试数据的消息结构体,将第一测试数据转换为第二测试数据;向待测软件发送第二测试数据;The test service 722 is used to convert the first test data into the second test data according to the message structure of the first test data; send the second test data to the software under test;
待测软件724,用于根据第二测试数据进行自动化测试,得到第一测试结果,并向测试服务返回第一测试结果;The software to be tested 724 is used to perform automated testing according to the second test data, obtain the first test result, and return the first test result to the test service;
测试服务722,还用于根据消息结构体将第一测试结果转换为软件在环测试系统可识别的第二测试结果,并向软件在环测试系统发送第二测试结果。The test service 722 is further configured to convert the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure, and send the second test result to the software-in-the-loop test system.
在一些实施例中,消息结构体是根据测试消息和待测软件所支持的数据类型生成的。In some embodiments, the message structure is generated according to the test message and the data types supported by the software to be tested.
在一些实施例中,软件在环测试系统710具体用于通过套接字通信方式向测试服务发送第二报文数据,其中,第二报文数据的报文头包含第一测试数据的数据类型信息,第二报文数据的报文体包含第一测试数据。In some embodiments, the software-in-the-loop testing system 710 is specifically configured to send the second message data to the test service through socket communication, wherein the header of the second message data includes the data type of the first test data information, the message body of the second message data contains the first test data.
在一些实施例中,第二报文数据的报文体还包含第一测试数据的校验数据,校验数据用于使测试服务验证第一测试数据的有效性。In some embodiments, the message body of the second message data further includes verification data of the first test data, and the verification data is used to enable the test service to verify the validity of the first test data.
在一些实施例中,测试服务722,具体用于通过套接字通信方式向软件在环测试系统发送第一报文数据;第一报文数据的报文头包含第二测试结果对应的数据类型信息,第一报文数据的报文体包含第二测试结果。In some embodiments, the test service 722 is specifically configured to send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data includes the data type corresponding to the second test result information, the message body of the first message data includes the second test result.
在一些实施例中,第一报文数据的报文体还包含第二测试结果的校验数据,校验数据用于使软件在环测试系统验证第二测试结果的有效性。In some embodiments, the message body of the first message data further includes verification data of the second test result, and the verification data is used to enable the software-in-the-loop test system to verify the validity of the second test result.
在一些实施例中,待测软件724为在目标系统下开发的软件,目标系统包括:机器人操作系统或数据分发服务系统。In some embodiments, the software to be tested 724 is software developed under the target system, and the target system includes: a robot operating system or a data distribution service system.
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. Actually, according to the embodiment of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided to be embodied by a plurality of modules or units.
在本公开的示例性实施例中,还提供一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,处理器被配置为执行本示例实施方式中上述软件在环测试方法。In an exemplary embodiment of the present disclosure, there is also provided an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein, the processor is configured to execute the above-mentioned software-in-the-loop in this exemplary embodiment Test Methods.
图8为本公开实施例中电子设备的一种结构示意图。需要说明的是,图8示出的电子设备800仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。FIG. 8 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. It should be noted that the electronic device 800 shown in FIG. 8 is only an example, and should not limit the functions and application scope of the embodiments of the present disclosure.
如图8所示,电子设备800包括中央处理单元(CPU)801,其可以根据存储在只读存储器(ROM)802中的程序或者从存储部分808加载到随机访问存储器(RAM)803中的程序而执行各种适当的动作和处理。在RAM 803中,还存储有系统操作所需的各种程序和数据。中央处理单元801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。As shown in FIG. 8 , an electronic device 800 includes a central processing unit (CPU) 801, which can operate according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage section 808 into a random access memory (RAM) 803 Instead, various appropriate actions and processes are performed. In RAM 803, various programs and data necessary for system operation are also stored. The central processing unit 801, ROM 802, and RAM 803 are connected to each other through a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804 .
以下部件连接至I/O接口805:包括键盘、鼠标等的输入部分806;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分807;包括硬盘等的存储部分808;以及包括诸如局域网(LAN)卡、调制解调器等的网络接口卡的通信部分809。通信部分809经由诸如因特网的网络执行通信处理。驱动器810也根据需要连接至I/O接口805。可拆卸介质811,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器810上,以便于从其上读出的计算机程序根据需要被安装入存储部分808。The following components are connected to the I/O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc. and a communication section 809 including a network interface card such as a local area network (LAN) card, a modem, or the like. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I/O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 810 as necessary so that a computer program read therefrom is installed into the storage section 808 as necessary.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分809从网络上被下载和安装,和/或从可拆卸介质811被安装。在该计算机程序被中央处理单元801执行时,执行本公开的装置中限定的各种功能。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication portion 809 and/or installed from removable media 811 . When the computer program is executed by the central processing unit 801, various functions defined in the apparatus of the present disclosure are performed.
本公开实施例中,还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述软件在环测试方法。In an embodiment of the present disclosure, there is also provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the foregoing software-in-the-loop testing method is implemented.
需要说明的是,本公开所示的计算机可读存储介质例如可以是—但不限于—电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬 盘、随机访问存储器、只读存储器、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。计算机可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、射频等等,或者上述的任意合适的组合。It should be noted that the computer-readable storage medium shown in the present disclosure may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more conductors, portable computer diskettes, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM) or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. Program code contained on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wires, optical cables, radio frequency, etc., or any suitable combination of the above.
本公开实施例中,还提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述软件在环测试方法。In an embodiment of the present disclosure, a computer program product is also provided, which enables the computer to execute the above software-in-the-loop testing method when the computer program product runs on the computer.
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relative terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these No such actual relationship or order exists between entities or operations. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above descriptions are only specific implementation manners of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (22)

  1. 一种软件在环测试方法,应用于测试服务,包括:A software-in-the-loop testing method applied to testing services, comprising:
    接收软件在环测试系统发送的第一测试数据,所述第一测试数据根据测试消息和所述测试消息对应的消息结构体生成,所述软件在环测试系统包括与各个测试消息分别对应的消息结构体,所述消息结构体是待测软件所支持的数据类型;Receiving the first test data sent by the software-in-the-loop test system, the first test data is generated according to the test message and the message structure corresponding to the test message, and the software-in-the-loop test system includes a message corresponding to each test message A structure, the message structure is a data type supported by the software to be tested;
    根据所述第一测试数据的所述消息结构体,将所述第一测试数据转换为第二测试数据;converting the first test data into second test data according to the message structure of the first test data;
    向所述待测软件发送所述第二测试数据,以使所述待测软件根据所述第二测试数据进行自动化测试,得到并返回第一测试结果;Sending the second test data to the software under test, so that the software under test performs an automated test according to the second test data, obtains and returns a first test result;
    根据所述消息结构体将所述第一测试结果转换为所述软件在环测试系统可识别的第二测试结果,并向所述软件在环测试系统发送所述第二测试结果。converting the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure, and sending the second test result to the software-in-the-loop test system.
  2. 根据权利要求1所述的方法,其中,所述消息结构体是根据所述测试消息和所述待测软件所支持的数据类型生成的。The method according to claim 1, wherein the message structure is generated according to the test message and the data type supported by the software under test.
  3. 根据权利要求1所述的方法,其中,所述向所述待测软件发送所述第二测试数据,包括:The method according to claim 1, wherein the sending the second test data to the software under test comprises:
    通过套接字通信方式向所述软件在环测试系统发送第一报文数据;所述第一报文数据的报文头包含所述第二测试结果对应的数据类型信息,所述第一报文数据的报文体包含所述第二测试结果。Send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data contains the data type information corresponding to the second test result, and the first message data The message body of the text data includes the second test result.
  4. 根据权利要求3所述的方法,其中,所述第一报文数据的报文体还包含所述第二测试结果的校验数据,所述校验数据用于使所述软件在环测试系统验证所述第二测试结果的有效性。The method according to claim 3, wherein the message body of the first message data further includes verification data of the second test result, and the verification data is used to verify the software-in-the-loop test system the validity of the second test result.
  5. 根据权利要求1所述的方法,其中,所述待测软件为在目标系统下开发的软件,所述目标系统包括:机器人操作系统或数据分发服务系统。The method according to claim 1, wherein the software to be tested is software developed under a target system, and the target system includes: a robot operating system or a data distribution service system.
  6. 一种软件在环测试方法,其中,应用于软件在环测试系统,包括:A software-in-the-loop testing method, wherein, applied to a software-in-the-loop testing system, comprising:
    根据测试消息和所述测试消息对应的消息结构体,生成第一测试数据,所述软件在环测试系统包括与各个测试消息分别对应的消息结构体,所述消息结构体是待测软件所支持的数据类型;Generate first test data according to the test message and the message structure corresponding to the test message, the software-in-the-loop test system includes a message structure corresponding to each test message, and the message structure is supported by the software to be tested data type;
    向测试服务发送所述第一测试数据,以使所述测试服务根据所述第一测试数据得到测试结果;sending the first test data to a test service, so that the test service obtains a test result according to the first test data;
    接收所述测试服务返回的所述测试结果。The test result returned by the test service is received.
  7. 根据权利要求6所述的方法,其中,所述消息结构体是根据所述测试消息和所述待测软件所支持的数据类型生成的。The method according to claim 6, wherein the message structure is generated according to the test message and the data type supported by the software under test.
  8. 根据权利要求6所述的方法,其中,所述向测试服务发送所述第一测试数据,包括:The method according to claim 6, wherein said sending said first test data to a test service comprises:
    通过套接字通信方式向测试服务发送第二报文数据,其中,所述第二报文数据的报文头包含所述第一测试数据的数据类型信息,所述第二报文数据的报文体包含所述第一 测试数据。Send the second message data to the test service through socket communication, wherein the message header of the second message data includes the data type information of the first test data, and the message header of the second message data A text contains the first test data.
  9. 根据权利要求8所述的方法,其中,所述第二报文数据的报文体还包含所述第一测试数据的校验数据,所述校验数据用于使所述测试服务验证所述第一测试数据的有效性。The method according to claim 8, wherein the message body of the second message data further includes verification data of the first test data, and the verification data is used to make the test service verify the first 1. Test the validity of the data.
  10. 一种软件在环测试装置,其中,应用于测试服务,包括:A software-in-the-loop testing device, which is applied to testing services, includes:
    第一测试数据接收模块,用于接收软件在环测试系统发送的第一测试数据,所述第一测试数据根据测试消息和所述测试消息对应的消息结构体生成,所述软件在环测试系统包括与各个测试消息分别对应的消息结构体,所述消息结构体是待测软件所支持的数据类型;The first test data receiving module is used to receive the first test data sent by the software-in-the-loop test system, the first test data is generated according to the test message and the message structure corresponding to the test message, and the software-in-the-loop test system Including a message structure corresponding to each test message, the message structure is a data type supported by the software to be tested;
    测试数据转换模块,用于根据所述第一测试数据的所述消息结构体,将所述第一测试数据转换为第二测试数据;A test data conversion module, configured to convert the first test data into second test data according to the message structure of the first test data;
    第二测试数据发送模块,用于向所述待测软件发送所述第二测试数据,以使所述待测软件根据所述第二测试数据进行自动化测试,得到并返回第一测试结果;A second test data sending module, configured to send the second test data to the software under test, so that the software under test performs an automated test according to the second test data, and obtains and returns a first test result;
    测试结果转换模块,用于根据所述消息结构体将所述第一测试结果转换为所述软件在环测试系统可识别的第二测试结果;A test result conversion module, configured to convert the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure;
    测试结果发送模块,用于向所述软件在环测试系统发送所述第二测试结果。A test result sending module, configured to send the second test result to the software-in-the-loop test system.
  11. 根据权利要求10所述的装置,其中,所述消息结构体是根据所述测试消息和所述待测软件所支持的数据类型生成的。The device according to claim 10, wherein the message structure is generated according to the test message and the data type supported by the software under test.
  12. 根据权利要求10所述的装置,其中,所述第二测试数据发送模块用于:The device according to claim 10, wherein the second test data sending module is used for:
    通过套接字通信方式向所述软件在环测试系统发送第一报文数据;所述第一报文数据的报文头包含所述第二测试结果对应的数据类型信息,所述第一报文数据的报文体包含所述第二测试结果。Send the first message data to the software-in-the-loop test system through socket communication; the message header of the first message data contains the data type information corresponding to the second test result, and the first message data The message body of the text data includes the second test result.
  13. 根据权利要求12所述的装置,其中,所述第一报文数据的报文体还包含所述第二测试结果的校验数据,所述校验数据用于使所述软件在环测试系统验证所述第二测试结果的有效性。The device according to claim 12, wherein the message body of the first message data further includes verification data of the second test result, and the verification data is used to verify the software-in-the-loop test system the validity of the second test result.
  14. 根据权利要求10所述的装置,其中,所述待测软件为在目标系统下开发的软件,所述目标系统包括:机器人操作系统或数据分发服务系统。The device according to claim 10, wherein the software to be tested is software developed under a target system, and the target system includes: a robot operating system or a data distribution service system.
  15. 一种软件在环测试装置,其中,应用于软件在环测试系统,包括:A software-in-the-loop testing device, which is applied to a software-in-the-loop testing system, comprising:
    第一测试数据生成模块,用于根据测试消息和所述测试消息对应的消息结构体,生成第一测试数据,其中,所述软件在环测试系统包括与各个测试消息分别对应的消息结构体,所述消息结构体是待测软件所支持的数据类型;The first test data generation module is configured to generate first test data according to the test message and the message structure corresponding to the test message, wherein the software-in-the-loop test system includes a message structure corresponding to each test message, The message structure is a data type supported by the software to be tested;
    第一测试数据发送模块,用于向测试服务发送所述第一测试数据,以使所述测试服务根据所述第一测试数据得到测试结果;A first test data sending module, configured to send the first test data to a test service, so that the test service can obtain a test result according to the first test data;
    测试结果接收模块,用于接收所述测试服务返回的所述测试结果。The test result receiving module is configured to receive the test result returned by the test service.
  16. 根据权利要求15所述的装置,其中,所述消息结构体是根据所述测试消息和所述待测软件所支持的数据类型生成的。The device according to claim 15, wherein the message structure is generated according to the test message and the data type supported by the software to be tested.
  17. 根据权利要求15所述的装置,其中,所述第一测试数据发送模块用于:The device according to claim 15, wherein the first test data sending module is used for:
    通过套接字通信方式向测试服务发送第二报文数据,其中,所述第二报文数据的报文头包含所述第一测试数据的数据类型信息,所述第二报文数据的报文体包含所述第一测试数据。Send the second message data to the test service through socket communication, wherein the message header of the second message data includes the data type information of the first test data, and the message header of the second message data A text contains the first test data.
  18. 根据权利要求17所述的装置,其中,所述第二报文数据的报文体还包含所述第一测试数据的校验数据,所述校验数据用于使所述测试服务验证所述第一测试数据的有效性。The device according to claim 17, wherein the message body of the second message data further includes verification data of the first test data, and the verification data is used to enable the test service to verify the first 1. Test the validity of the data.
  19. 一种测试系统,包括:软件在环测试系统和电子控制单元,所述电子控制单元包括测试服务和待测软件;A testing system, comprising: a software-in-the-loop testing system and an electronic control unit, the electronic control unit including testing services and software to be tested;
    所述软件在环测试系统,用于根据测试消息和所述测试消息对应的消息结构体,生成第一测试数据,向所述测试服务发送所述第一测试数据,其中,所述软件在环测试系统包括与各个测试消息分别对应的消息结构体,所述消息结构体是待测软件所支持的数据类型;The software-in-the-loop testing system is configured to generate first test data according to a test message and a message structure corresponding to the test message, and send the first test data to the test service, wherein the software-in-the-loop The test system includes a message structure corresponding to each test message, and the message structure is a data type supported by the software to be tested;
    所述测试服务,用于根据所述第一测试数据的所述消息结构体,将所述第一测试数据转换为第二测试数据;向所述待测软件发送所述第二测试数据;The test service is configured to convert the first test data into second test data according to the message structure of the first test data; send the second test data to the software under test;
    所述待测软件,用于根据所述第二测试数据进行自动化测试,得到第一测试结果,并向所述测试服务返回所述第一测试结果;The software under test is used to perform an automated test according to the second test data, obtain a first test result, and return the first test result to the test service;
    所述测试服务,还用于根据所述消息结构体将所述第一测试结果转换为所述软件在环测试系统可识别的第二测试结果,并向所述软件在环测试系统发送所述第二测试结果。The test service is further configured to convert the first test result into a second test result recognizable by the software-in-the-loop test system according to the message structure, and send the Second test result.
  20. 一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现权利要求1至5中任一项所述的方法的步骤,或者实现权利要求6至9中任一项所述的方法的步骤。An electronic device, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, when the processor executes the computer program, any one of claims 1 to 5 is realized The steps of the method described in claim 6, or the steps of the method described in any one of claims 6 to 9.
  21. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1至5中任一项所述的方法的步骤,或者实现权利要求6至9中任一项所述的方法的步骤。A computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are realized, or claims 6 to 9 are realized The steps of any one of the methods.
  22. 一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行1至5中任一项所述的方法的步骤,或者执行权利要求6至9中任一项所述的方法的步骤。A computer program product, when the computer program product runs on a computer, it causes the computer to execute the steps of the method described in any one of claims 1 to 5, or to execute the steps described in any one of claims 6 to 9 steps of the method.
PCT/CN2022/140157 2021-12-23 2022-12-19 Software in-the-loop testing method and apparatus, electronic device system, and storage medium WO2023116647A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111588888.1A CN115437913A (en) 2021-12-23 2021-12-23 Software in-loop testing method, device, system and storage medium
CN202111588888.1 2021-12-23

Publications (1)

Publication Number Publication Date
WO2023116647A1 true WO2023116647A1 (en) 2023-06-29

Family

ID=84239889

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/140157 WO2023116647A1 (en) 2021-12-23 2022-12-19 Software in-the-loop testing method and apparatus, electronic device system, and storage medium

Country Status (2)

Country Link
CN (1) CN115437913A (en)
WO (1) WO2023116647A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115437913A (en) * 2021-12-23 2022-12-06 北京罗克维尔斯科技有限公司 Software in-loop testing method, device, system and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070234328A1 (en) * 2006-03-01 2007-10-04 Microsoft Corporation File handling for test environments
CN101098207A (en) * 2006-06-26 2008-01-02 中兴通讯股份有限公司 Information based automatized test system and method
CN106802865A (en) * 2017-01-17 2017-06-06 中国工商银行股份有限公司 For the response analogue means and method of software test
CN112631932A (en) * 2020-12-30 2021-04-09 交控科技股份有限公司 Sub-function independent test method of automatic train monitoring system based on interface
CN115437913A (en) * 2021-12-23 2022-12-06 北京罗克维尔斯科技有限公司 Software in-loop testing method, device, system and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070234328A1 (en) * 2006-03-01 2007-10-04 Microsoft Corporation File handling for test environments
CN101098207A (en) * 2006-06-26 2008-01-02 中兴通讯股份有限公司 Information based automatized test system and method
CN106802865A (en) * 2017-01-17 2017-06-06 中国工商银行股份有限公司 For the response analogue means and method of software test
CN112631932A (en) * 2020-12-30 2021-04-09 交控科技股份有限公司 Sub-function independent test method of automatic train monitoring system based on interface
CN115437913A (en) * 2021-12-23 2022-12-06 北京罗克维尔斯科技有限公司 Software in-loop testing method, device, system and storage medium

Also Published As

Publication number Publication date
CN115437913A (en) 2022-12-06

Similar Documents

Publication Publication Date Title
US10642721B2 (en) Generation of automated testing scripts by converting manual test cases
US20110289484A1 (en) Method and System for Script Processing for Web-Based Applications
US20080209405A1 (en) Distributed debugging for a visual programming language
CN109359194B (en) Method and apparatus for predicting information categories
CN113704043A (en) Chip function verification method and device, readable storage medium and electronic equipment
US10002069B2 (en) Automated testing of application program interface
CN108111364B (en) Service system testing method and device
WO2023116647A1 (en) Software in-the-loop testing method and apparatus, electronic device system, and storage medium
CN111797020A (en) Mock data method and device based on dynamic bytecode
CN112988588B (en) Client software debugging method and device, storage medium and electronic equipment
CN113468067A (en) Application program debugging method and device, electronic equipment and computer readable medium
CN111488275B (en) UI (user interface) automatic testing method and device, storage medium and electronic equipment
CN112988578A (en) Automatic testing method and device
US10606569B2 (en) Declarative configuration elements
CN109240923B (en) Interface test script generation method and computer readable storage medium
EP3982268B1 (en) Chassis simulation method and apparatus, server, storage medium and program product
CN113342353B (en) Mock data generation method and device
CN115904317A (en) Method, device, equipment and storage medium for uniformly calling front-end interface and back-end interface
US11797277B2 (en) Neural network model conversion method server, and storage medium
CN113157572A (en) Test case generation method and system, electronic equipment and storage medium
CN113656301A (en) Interface testing method, device, equipment and storage medium
CN111338968A (en) Project function module debugging method, device, medium and electronic equipment
CN116860324B (en) Development data processing method, development data processing apparatus, and readable storage medium
CN115473832B (en) Internet of vehicles end cloud communication testing method, device, server, client and system
CN113885841A (en) Script generation method and device, electronic equipment and readable medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22909959

Country of ref document: EP

Kind code of ref document: A1