A software testing system
The automated testing method of the software testing system solved the problem of insufficient vehicle air-conditioning controller software testing and achieved efficient software quality improvement.
Patent Information
- Application Number
- CN202210698620.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-06-20
AI Technical Summary
Existing vehicle air conditioning controller software testing has problems such as insufficient software function testing, poor real-time performance and low efficiency. Traditional methods are costly and complex to operate.
A software testing system is provided, which includes a device to be tested, a measurement and control device, a monitoring device and a host computer. The measurement and control device runs a test model designed based on a model to realize automated testing of vehicle controller software.
Improved the testing efficiency of vehicle controller software and enhanced the software quality.
Smart Images

Figure CN114924989B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a software testing system. Background Art
[0002] Regarding vehicle air-conditioning software, as the pace of the new energy vehicle industry accelerates, users have put forward higher requirements for vehicle energy saving and comfort. At the same time, the functional testing of vehicle air-conditioning controllers has become an important testing link.
[0003] In the existing traditional vehicle air-conditioning controller software development process, the software testing function needs to be completed after the hardware development and the software is integrated into the hardware before the software testing can begin. Such a testing system has the problem of insufficient software function testing. In the existing solution, the application layer software testing work can also be carried out in advance in a modeling environment through simulation and other methods, but the real-time performance is poor and the efficiency is low; a rapid prototyping equipment solution can also be used, but the equipment operation is complex and the cost is high. Summary of the Invention
[0004] The present invention provides a software testing system, which realizes automated testing of vehicle controller software, improves testing efficiency and enhances software quality.
[0005] In the first aspect, an embodiment of the present invention provides a software testing system, which includes: a device to be tested, a measurement and control device, a monitoring device and a host computer; wherein the host computer is electrically connected to the device to be tested and the measurement and control device, respectively, and is used to inject programs into and monitor the device to be tested and the measurement and control device, respectively, and the measurement and control device runs test cases to perform testing on the device to be tested; the monitoring device is electrically connected to the host computer, and is used to collect controller area network CAN bus signals during the testing process of the device to be tested and the measurement and control device, and monitor the CAN bus signals.
[0006] Optionally, the device to be tested is a first development board, and the measurement and control device is a second development board.
[0007] Optionally, the device to be tested is vehicle hardware, and the measurement and control device is the second development board.
[0008] Optionally, the system also includes a vehicle load; wherein the vehicle load is electrically connected to the vehicle hardware and is used to provide sensors and actuators required for the normal operation of the vehicle hardware.
[0009] Optionally, the first development board includes: an input signal parsing module of the object under test, other input signal parsing modules, an application layer software module to be tested, an output signal encapsulation module of the object under test, and other output signal encapsulation modules; wherein, the input signal parsing module of the object under test is used to receive the first bus signal sent by the second development board through the CAN bus, and parse the first bus signal into a first physical signal; the other input signal parsing modules are used to receive the first monitoring signal sent by the host computer, and parse the second physical signal; the application layer software module to be tested is used to input the first physical signal and the second physical signal into the application layer model for testing, respectively, to obtain a first physical result and a second physical result; the output signal encapsulation module of the object under test is used to generate a first bus result signal according to the first physical result, and send it to the second development board through the host computer for use by the second development board and the monitoring equipment; the other output signal encapsulation modules are used to package the second physical result into a first monitoring result and send it to the host computer.
[0010] Optionally, the second physical result includes at least internal variables of the application layer software module to be tested that need to be monitored and the calculated actuator output parameters.
[0011] Optionally, the second development board includes: a test model input signal parsing module, a monitoring signal parsing module, a model-based design (MBD) test model module, a test model output signal encapsulation module and a monitoring signal encapsulation module; wherein the test model input signal parsing module is used to receive the second bus signal sent by the first development board or vehicle hardware through the CAN bus, and parse the second bus signal into a third physical signal; the monitoring signal parsing module is used to receive the second monitoring signal sent by the host computer and parse the fourth physical signal; the MBD-based test model module is used to input the third physical signal and the fourth physical signal into the test case model for testing, respectively, to obtain a third physical result and a fourth physical result; the test model output signal encapsulation module is used to generate a second bus result based on the third physical result, and send it to the first development board or vehicle hardware through the host computer for use by the first development board or vehicle hardware and the monitoring equipment; the monitoring signal encapsulation module is used to generate a second monitoring result from the fourth physical result and send it to the host computer.
[0012] Optionally, the second monitoring result includes at least internal variables and status information parameters of the MBD-based test model module that need to be monitored.
[0013] Optionally, the host computer includes: a program download module, a system operation status monitoring module, and an environment data injection module. The program download module is used to download the application layer model to the first development board and the test case model to the second development board; the system operation status monitoring module is used to monitor the operation status of the first development board and the second development board respectively; and the environment data injection module is used to control the operation mode of the first development board and the second development board.
[0014] Optionally, the host computer further includes: a CAN bus data monitoring module, which is used to send CAN bus signals of the device under test and the measurement and control device during the test process to the monitoring device.
[0015] The technical solution of an embodiment of the present invention comprises a system including a device under test, a measurement and control device, a monitoring device, and a host computer. The host computer is electrically connected to the device under test and the measurement and control device, respectively, for injecting programs into and monitoring the device under test and the measurement and control device, respectively. The monitoring device is electrically connected to the host computer, for collecting and monitoring Controller Area Network (CAN) bus signals from the device under test and the measurement and control device during testing. Based on the above embodiment, the vehicle controller software is run on the device under test in stages for testing by running a model-based test model on the measurement and control device, thereby achieving automated testing of the vehicle controller software, improving testing efficiency, and enhancing software quality.
[0016] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 is a framework diagram of a software testing system provided in an embodiment of the present invention;
[0019] Figure 2 is an application layer test structure diagram provided in an embodiment of the present invention;
[0020] Figure 3 is a diagram of a vehicle hardware test structure provided in an embodiment of the present invention;
[0021] Figure 4 is a structural diagram of a first development board provided in an embodiment of the present invention;
[0022] Figure 5 is a flow chart of an application layer software module to be tested provided in an embodiment of the present invention;
[0023] Figure 6 is a structural diagram of a second development board provided in an embodiment of the present invention;
[0024] Figure 7 It is a flowchart of the MBD-based test module provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, system, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, systems, products or devices.
[0027] Figure 1 This is a framework diagram of a software testing system provided in an embodiment of the present invention. This embodiment is applicable to the case of vehicle controller software testing. In a specific embodiment, Figure 1 As shown, the system of the embodiment of the present invention specifically includes: a device under test 10 , a measurement and control device 20 , a monitoring device 30 and a host computer 40 .
[0028] Among them, the host computer 40 is electrically connected to the device under test 10 and the measurement and control device 20, respectively, for testing the device under test 10 and the measurement and control device 20, respectively; the monitoring device 30 is electrically connected to the host computer 40, for collecting the controller area network CAN bus signals during the testing process of the device under test 10 and the measurement and control device 20, and monitoring the CAN bus signals.
[0029] When testing the application layer of a vehicle, the device under test 10 is a first development board, and the measurement and control device 20 is a second development board. Figure 2 This is an application layer test structure diagram provided in an embodiment of the present invention, such as Figure 2 As shown, the first development board, the second development board and the monitoring device 30 are respectively connected to the positive and negative poles of the power supply, the high data line of the CAN bus and the low data line of the CAN bus; the first development board, the second development board and the monitoring device 30 are respectively connected to and communicate with the host computer 40 through the Universal Serial Bus (USB).
[0030] Among them, the power supply meets the power demand of the software testing system and provides the software testing system with a stable DC output voltage of 12V and 30A.
[0031] The host computer 40 includes: a program download module 410, a system operation status monitoring module 420 and an environment data injection module 430; wherein, the program download module 410 is used to download the application layer model to the first development board, and download the test case model to the second development board; the system operation status monitoring module 420 is used to monitor the operation status of the first development board and the second development board respectively; the environment data injection module 430 is used to control the operation mode of the first development board and the second development board; the host computer 40 also includes: a CAN bus data monitoring module 440, which is used to send the CAN bus signal of the device under test 10 and the measurement and control device 20 during the test process to the monitoring device 30.
[0032] Specifically, the program download module 410 compiles the application layer model and the test case model in the Simulink environment and downloads them via the USB bus. The system operation status monitoring module 420 controls the operation status of the first development board and the operation status of the second development board respectively through the program of the host computer 40. Furthermore, by pre-defining the global variables of the observation values in the application layer model or the test case model, the program of the host computer 40 then searches for the relevant variables through the variable address information and displays the real-time values at runtime to the user. The real-time values can be displayed in a data display or a curve display, etc., which is not limited in this embodiment. The environmental data injection module 430 controls the operation status of the first development board and the operation mode of the second development board respectively through the program of the host computer 40. Furthermore, by pre-defining the global variables of the observation values in the application layer model or the test case model, the program of the host computer 40 then searches for the relevant variables through the variable address information and injects the required data into the corresponding development board to ensure that the system can operate in the pre-set manner and record the relevant data for subsequent analysis.
[0033] Based on the above embodiment, optionally, when testing vehicle hardware, the device under test 10 is the vehicle hardware, and the measurement and control device is the second development board. Optionally, the system further includes a vehicle load 50. Figure 3 This is a diagram of the vehicle hardware test structure provided in an embodiment of the present invention. Figure 3 As shown, the vehicle hardware, the second development board and the monitoring device 30 are respectively connected to the positive and negative poles of the power supply, the high data line of the CAN bus and the low data line of the CAN bus. The vehicle hardware, the second development board and the monitoring device 30 are respectively connected to and communicate with the host computer 40 via USB.
[0034] Furthermore, the vehicle load 50 is electrically connected to the vehicle hardware to provide sensors and actuators required for the normal operation of the vehicle hardware.
[0035] Among them, the sensors may include temperature sensors, pressure sensors, humidity sensors, sunshine intensity sensors, air quality sensors (such as PM2.5 sensors inside and outside the vehicle, and air quality sensors outside the vehicle), etc.; the actuators may include compressors, blowers, air-conditioning box damper motors, two-way solenoid valves, electronic expansion valves, warm air valves, electronic water pumps, high-voltage electric heaters, low-voltage electric heaters, ion generators, fragrance systems, automatic swing mechanism drive motors, cooling fans, radiator grille motors, etc., which are not limited in this embodiment.
[0036] Specifically, the communication between the aforementioned sensors and actuators and the vehicle hardware can be hardwired or bus-based. Hardwired communication includes high- and low-side acquisition or driving, pulse width modulation (PWM) signal capture and driving, and analog-to-digital / digital-to-analog conversion. Bus communication includes CAN, Local Interconnect Network (LIN), and Universal Asynchronous Receiver / Transmitter (UART), among others, though this embodiment does not limit these.
[0037] Furthermore, for the deployment of the first development board, Figure 4 is a structural diagram of the first development board provided in an embodiment of the present invention, such as Figure 4 As shown, the first development board includes: a test object input signal parsing module 510, other input signal parsing module 520, a test application layer software module 530, a test object output signal encapsulation module 540 and other output signal encapsulation module 550.
[0038] Among them, the input signal analysis module 510 of the object under test is used to receive the first bus signal sent by the second development board through the host computer, and parse the first bus signal into a first physical signal; the other input signal analysis module 520 is used to receive the first monitoring signal sent by the host computer and parse the second physical signal; the application layer software module 530 to be tested is used to input the first physical signal and the second signal into the application layer model for testing respectively to obtain the first physical result and the second physical result; the output signal encapsulation module 540 of the object under test is used to generate the first bus result according to the first physical result, and send it to the second development board through the host computer for use by the second development board and the monitoring equipment; the other output signal encapsulation module 550 is used to package the second physical result into the first monitoring result and send it to the host computer.
[0039] Specifically, the first monitoring signal includes simulating the input signals of each sensor, the feedback signals of each actuator, etc.; the sending method of the first monitoring signal sent by the upper computer 40 includes reading the user's real-time input from the keyboard and reading a predefined signal sequence from a file; the application layer software module 530 to be tested refers to the application layer model module that needs to be tested, including a Simulink model (a visual simulation tool in MATLAB launched by Mathworks, USA. Simulink is a module diagram environment for multi-domain simulation and model-based design, supporting system design, simulation, automatic code generation and continuous testing and verification of embedded systems), a logic model created using StateFlow (an environment provided by MATLAB that builds combinational and sequential logic decision models and performs simulations based on finite state machines and flow charts. It can combine graphical representations and tabular representations, including state transition diagrams, flow charts, state transition tables and truth tables, to model the system's response to events, time-based conditions and external input signals) model, and a migration model created using an S-Function (a system function in Simulink). Function, users can use MATLAB code, C, C++, FORTRAN and other languages to write) encapsulated code models, etc., which are not limited in this embodiment.
[0040] Based on the above embodiment, optionally, the second physical result at least includes internal variables of the application layer software module 530 to be tested that need to be monitored and the calculated actuator output parameters.
[0041] Further, Figure 5 is a flow chart of the application layer software module to be tested provided in an embodiment of the present invention, such as Figure 5As shown, the first physical signal after parsing the first bus signal and the second physical signal after parsing the first monitoring signal are respectively used as the input of the application layer software module 530 to be tested, and then scheduled within the application layer model, and then a switch is set through the input signal bypass setting. If the first physical signal is required, it means allowing the first physical signal to pass through, and if the second physical signal is required, it means allowing the second physical signal to pass through; after receiving the signal, the input signal is preprocessed, that is, the input signal is normalized to facilitate the next step of calculation; the preprocessed signal is respectively subjected to migration type calculation, input layer calculation, intermediate layer calculation and input layer calculation and the test results, that is, the first physical result and the second physical result, are output, and then the first physical result and the second physical result are respectively packaged.
[0042] Specifically, the migration calculation mainly refers to the migration calculation of the system's power on / off status, set temperature status, temperature zone synchronization status, air volume status, air mode status, internal and external circulation status, and compressor status; the output layer calculation mainly refers to the calculation of sensor filtering, including the numerical filtering and correction of the system evaporator temperature sensor, the numerical filtering and correction of the vehicle's internal temperature sensor, the numerical filtering and correction of the vehicle's external temperature sensor, the numerical filtering and correction of the sunlight sensor, the numerical filtering and correction of the air quality sensor, the numerical filtering and correction of the air conditioning pressure / temperature sensor, and the vehicle speed. , engine speed, water temperature numerical filtering and correction, etc.; the middle layer calculation is mainly the calculation of system load, including the calculation of basic heat load of each temperature zone, the calculation of sunshine heat load of each temperature zone and the calculation of standard air outlet temperature of each temperature zone, etc.; the output layer calculation is mainly the calculation of actuator output, including the calculation of temperature damper opening of each temperature zone, the calculation of mode damper opening of each temperature zone, the calculation of internal and external circulation damper opening, the calculation of duty cycle or terminal voltage of each blower, the calculation of compressor displacement or target speed, the calculation of solenoid valve, electronic expansion valve opening and water pump and water valve related calculations, etc. This embodiment does not limit this.
[0043] Furthermore, for the deployment of the second development board, Figure 6 : is a structural diagram of the second development board provided in an embodiment of the present invention, such as Figure 6 As shown, the second development board includes: a test model input signal parsing module 610 , a monitoring signal parsing module 620 , a model-based design (MBD) test model module 630 , a test model output signal encapsulation module 640 and a monitoring signal encapsulation module 650 .
[0044] Among them, the test model input signal parsing module 610 is used to receive the second bus signal sent by the first development board or vehicle hardware through the host computer 40, and parse the second bus signal into a third physical signal; the monitoring signal parsing module 620 is used to receive the second monitoring signal sent by the host computer and parse the fourth physical signal; the MBD-based test model module 630 is used to input the third physical signal and the fourth physical signal into the test case model for testing, respectively, to obtain the third physical result and the fourth physical result; the test model output signal encapsulation module 640 is used to generate the second bus result according to the third physical result, and send it to the first development board or vehicle hardware through the host computer 40 for use by the first development board or vehicle hardware, and the monitoring equipment; the monitoring signal encapsulation module 650 is used to package the fourth physical result into a second monitoring result and send it to the host computer.
[0045] Specifically, the second monitoring signal in the monitoring signal analysis module includes development board network transceiver enable, test model and use case selection, etc., which are not limited in this embodiment.
[0046] Based on the above embodiment, optionally, the second monitoring result at least includes internal variables and status information parameters of the MBD-based test model module 630 that need to be monitored.
[0047] in, Figure 7 This is a flow chart of the MBD-based test model module provided in an embodiment of the present invention. Figure 7As shown, after receiving the third physical signal and the fourth physical signal, the system first starts to select the required test case, and then starts the network management message, that is, the corresponding development board sends a message to determine that the corresponding controller is awakened. If the message sent by the development board does not correspond to the controller, the controller is not awakened and ends directly. The test fails. The reason for the failure is that the controller is not awakened, and it is necessary to reopen the network message management so that the development board sends a message; if the message sent by the development board corresponds to the controller, the controller is awakened, and then a diagnostic instruction is sent to reset the controller. The purpose of resetting the controller is mainly to have the same basis for each test. When a problem occurs during the test, the problem can be quickly found; after the controller is restarted and reset, it is determined whether the controller is restarted successfully. If the system does not receive the controller restart success message instruction, it is determined that the controller restart failed; if the system receives the controller restart success message instruction, it is determined that the controller restart is successful, and the relevant network nodes of the corresponding controller are turned on. Then simulate the vehicle powering on, execute test operation 1, check whether test operation 1 is successful, if not, end, the test fails, and output the reason for the test failure; if it is detected that test operation 1 is successful, continue to execute whether test operation n is successful, check whether test operation n is successful, if not, end, the test fails, and output the reason for the test failure; after the test is completed, simulate the vehicle powering off, shut down the relevant network nodes, shut down the network management messages, and further determine whether the controller is dormant. If the controller is still receiving messages at this time, it is determined that the controller is not dormant, then the test is ended, the test fails, and the failure reason is that the controller is still receiving messages and is not dormant; if the controller no longer receives messages at this time, it is determined that the controller is in dormant state, end, and the test is completed.
[0048] For example, the detection test operations 1 to n are determined according to different controllers on the vehicle. If the air-conditioning controller is tested and the air-conditioning temperature controller has 5 gears, then n is 5 at this time, and test operations 1, test operation 2, test operation 3, test operation 4 and test operation 5 need to be executed; if the air-conditioning air volume controller is tested and the air volume controller has 3 gears, then n is 3 at this time, and test operations 1, test operation 2 and test operation 3 need to be executed.
[0049] The technical solution of an embodiment of the present invention comprises a system including a device under test, a measurement and control device, a monitoring device, and a host computer. The host computer is electrically connected to the device under test and the measurement and control device, respectively. The measurement and control device runs test cases to perform testing on the device under test. The monitoring device is electrically connected to the host computer and is used to collect Controller Area Network (CAN) bus signals during the testing of the device under test and the measurement and control device, and to monitor the CAN bus signals. Based on the above embodiment, the vehicle controller software is tested on the device under test in stages by running a model-based test model on the measurement and control device, thereby achieving automated testing of the vehicle controller software, improving testing efficiency, and enhancing software quality.
[0050] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A software testing system, characterized in that: The system includes: a device to be tested, a measurement and control device, a monitoring device and a host computer; wherein, The host computer is electrically connected to the device under test and the measurement and control device, respectively, for performing program injection and monitoring on the device under test and the measurement and control device, and the measurement and control device runs test cases to perform testing on the device under test; The monitoring device is electrically connected to the host computer and is used to collect CAN bus signals of the device under test and the measurement and control device during the test process, and monitor the CAN bus signals; The device under test is a first development board, the measurement and control device is a second development board, the first development board includes: a test object input signal parsing module, other input signal parsing modules, a test application layer software module, a test object output signal encapsulation module and other output signal encapsulation modules; wherein, The measured object input signal parsing module is used to receive the first bus signal sent by the second development board through the CAN bus, and parse the first bus signal into a first physical signal; The other input signal parsing module is used to receive the first monitoring signal sent by the host computer and parse the first monitoring signal into a second physical signal; The application layer software module to be tested is used to input the first physical signal and the second physical signal into the application layer model for testing, thereby obtaining a first physical result and a second physical result; The measured object output signal encapsulation module is used to generate a first bus result according to the first physical result, and send it to the second development board via the CAN bus for use by the second development board and the monitoring device; The other output signal encapsulation module is used to generate a first monitoring result from the second physical result and send it to the host computer; The second development board includes: a test model input signal parsing module, a monitoring signal parsing module, a test model module based on model design (MBD), a test model output signal encapsulation module, and a monitoring signal encapsulation module; wherein, The test model input signal parsing module is used to receive a second bus signal sent by the first development board or vehicle hardware through a CAN bus, and parse the second bus signal into a third physical signal; The monitoring signal parsing module is configured to receive a second monitoring signal sent by the host computer and parse the second monitoring signal into a fourth physical signal; A test model module based on MBD, configured to input the third physical signal and the fourth physical signal into a test case model, and output a third physical result and a fourth physical result; The test model output signal encapsulation module is used to generate a bus signal according to the third physical result, and send the bus signal to the first development board or the vehicle hardware through the host computer for use by the first development board or the vehicle hardware and the monitoring device; The monitoring signal encapsulation module is used to send the fourth physical result to the host computer.
2. The software testing system according to claim 1, wherein: Also includes: The device under test is vehicle hardware.
3. The software testing system according to claim 2, wherein: Also includes: Vehicle load; of which, The vehicle load is electrically connected to the vehicle hardware and is used to provide sensors and actuators required for the normal operation of the vehicle hardware.
4. The software testing system according to claim 1, wherein: The first monitoring result at least includes the internal variables of the application layer software module to be tested that need to be monitored and the calculated actuator output parameters.
5. The software testing system according to claim 1, wherein: The second monitoring result includes at least the internal variables and status information parameters of the MBD-based test model module that need to be monitored.
6. The software testing system according to claim 1, wherein: The host computer includes: a program download module, a system operation status monitoring module and an environmental data injection module; wherein, The program download module is used to download the application layer model to the first development board, and download the test case model to the second development board; The system operation status monitoring module is used to monitor the operation status of the first development board and the second development board respectively; The environmental data injection module is used to control the operating modes of the first development board and the second development board.
7. The software testing system according to claim 6, characterized in that: The host computer further includes: a CAN bus data monitoring module, which is used to send CAN bus signals of the device under test and the measurement and control device during the test process to the monitoring device.
Citation Information
Patent Citations
Electric power steering controller hardware function test board
CN105738130A