Electronic control unit software defect automatic retest method, system, medium and equipment
By converting manual testing steps into automatic testing steps, and combining automatic code flushing and regression testing, the problem of inefficient defect tracking and retesting of the automotive electronic control unit software is solved, and automated defect retesting is realized and development efficiency is improved.
Patent Information
- Application Number
- CN202510193779.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-06-10
AI Technical Summary
In the process of software development of automotive electronic control unit, defect tracking and retesting require a large amount of time and manpower investment. The existing technology mainly relies on manual operations and defect management systems, which are inefficient.
A method for automatic retesting of defects in electronic control unit software is proposed. By importing defect information, the manual testing steps are converted into automatic testing steps, debugging and verifying the automatic testing steps, and automatically pulling the code according to the defect repair plan and flashing it to the electronic control unit, and automatic regression test is performed to generate a test report.
The automated defect retest of the electronic control unit software is realized, the efficiency of defect tracking and retesting is improved, and the workload and labor time consumption of manual processing is reduced.
Smart Images

Figure CN120123237A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of software testing, and particularly relates to a method, system, medium and device for automatically retesting software defects of an electronic control unit. Background Art
[0002] With the increasing complexity and faster iteration speed of the software of automotive electronic controllers (abbreviated as "electronic control units", also known as "ECUs"), there are also many problems in the testing process during development. The number of defects that need to be traced and retested is relatively large, and a large amount of time and manpower will be required to trace and retest the defects found during the testing process.
[0003] Currently, for defect tracking, basically the relevant information and status of defects are recorded through a defect management system. The defect management system only plays a recording role. For operations such as software update and retesting of automotive electronic controllers, manual operations or other automated devices are required to execute, and the results after execution are manually filled into the defect management system. Although this method can effectively manage and trace defects, each process requires manual processing, resulting in a large workload and long working hours. Summary of the Invention
[0004] The present invention provides a method, system, medium and device for automatically retesting software defects of an electronic control unit.
[0005] A method for automatically retesting software defects of an electronic control unit according to the present invention, the method includes:
[0006] Import defect information, and convert the manual test steps in the defect information into automatic test steps;
[0007] Debug the automatic test steps to obtain the automatically test steps that pass the debugging;
[0008] Obtain a defect repair plan, and assign values to the code pull and flashing task and the automatic regression test task according to the defect repair plan;
[0009] Pull the code of the electronic control unit according to the code pull and flashing task, and flash the code into the electronic control unit;
[0010] According to the automatic regression test task and the automatically test steps that pass the debugging, perform an automatic regression test on the repaired defects to obtain a test result.
[0011] Further,
[0012] After importing the defect information, it further includes:
[0013] Maintain the defect repair plan in a specified path.
[0014] Further,
[0015] Debug the automatic test steps to obtain the automatically tested steps that pass the debugging, including:
[0016] Debug each group of the automatic test steps respectively to obtain the debugging results. The debugging results include passing the debugging and failing to pass the debugging. For the automatic test steps that fail to pass the debugging, continuously debug according to the reasons for the failure to pass the debugging according to a predetermined plan until all the debugging results are passing the debugging.
[0017] Further,
[0018] Pull the code of the electronic control unit according to the code pull and flash task, and flash the code into the electronic control unit, including:
[0019] According to the code pull and flash task, pull the code of the electronic control unit from the Git subsystem at regular intervals, and drive the flashing device to flash the code into the electronic control unit to obtain the flashing result. The flashing result includes successful flashing and failed flashing.
[0020] Further,
[0021] Pull the code of the electronic control unit according to the code pull and flash task, and flash the code into the electronic control unit, further including:
[0022] When the flashing result is failed flashing, continuously re-flash until the flashing is successful or the predetermined number of times is reached.
[0023] Further,
[0024] According to the automatic regression test task and the automatically tested steps that pass the debugging, perform an automatic regression test on the repaired defects to obtain the test results, including:
[0025] After obtaining the test results, generate a test report based on the test results.
[0026] An automatic re-verification system for software defects of an electronic control unit according to the present invention is used to implement the foregoing automatic re-verification method for software defects of an electronic control unit. The system includes:
[0027] A test subsystem, a Git subsystem, and a flashing device. The test subsystem includes:
[0028] An import module for importing defect information and converting the manual test steps in the defect information into automatic test steps;
[0029] A debugging module for debugging the automatic test steps to obtain the automatically tested steps that pass the debugging;
[0030] An assignment module, used to assign values to code pulling and flashing tasks and automatic regression testing tasks according to the defect repair plan;
[0031] A flashing module, used for pulling the code of the electronic control unit according to the code pulling and flashing task, and flashing the code into the electronic control unit;
[0032] The regression test module is used to perform automatic regression testing on the repaired defects according to the automatic regression test tasks and the automatic test steps passed by the debugging to obtain test results.
[0033] The present invention also provides a computer-readable storage medium storing a program or instruction. When the program or instruction is executed on a computer, the computer executes the aforementioned automatic retesting method for software defects of an electronic control unit.
[0034] The present invention also provides an electronic device, comprising a processor coupled to a memory; the processor is used to read and execute a computer program stored in the memory to implement the aforementioned automatic retesting method for software defects of an electronic control unit.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] The code of the electronic control unit is pulled regularly according to the defect repair plan and automatically flashed to the electronic control unit, realizing the function of automatically updating the code of the electronic control unit.
[0037] At the same time, automatic regression testing is performed based on the latest code. After obtaining the test results, the corresponding development manager and test manager can be notified in a timely manner. The development manager can make repairs in time and generate a test report to enable relevant personnel to understand the specific test situation.
[0038] In general, the present invention improves the efficiency of tracking and retesting. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 It is a structural schematic diagram of the automatic retest system for software defects of an electronic control unit of the present invention;
[0041] Figure 2It is a flowchart of the method for automatically retesting software defects of the electronic control unit of the present invention;
[0042] Figure 3 It is a schematic structural diagram of the electronic device of the present invention.
[0043] Explanation of reference numerals:
[0044] A - Test subsystem, B - Git subsystem, C - Flashing device, 101 - Import module, 102 - Debugging module, 103 - Assignment module, 104 - Flashing module, 105 - Regression testing module, 401 - Processor, 402 - Memory. Specific embodiments
[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0046] Figure 1 It is a schematic structural diagram of an automatic retesting system for software defects of an electronic control unit provided by an embodiment of the present invention. As Figure 1 shown, the automatic retesting system for software defects of the electronic control unit includes:
[0047] Test subsystem A, and test subsystem A includes:
[0048] Import module 101, which imports defect information and converts the manual test steps in the defect information into automatic test steps.
[0049] Debugging module 102, which debugs the automatic test steps to obtain automatically tested steps that pass the debugging.
[0050] Assignment module 103, which obtains a defect repair plan and assigns a flashing task for code pulling and an automatic regression testing task according to the defect repair plan.
[0051] Flashing module 104, which obtains the code of the electronic control unit according to the flashing task for code pulling and flashes the code into the electronic control unit.
[0052] Regression testing module 105, which performs an automatic regression test on the repaired defects according to the automatic regression testing task and the automatically tested steps that pass the debugging to obtain a test result.
[0053] In addition to the test subsystem, the present invention also involves two other subsystems and external devices independent of the test subsystem, which are respectively:
[0054] The G it subsystem B is used to store the code of the electronic control unit.
[0055] The flashing device C is connected to the electronic control unit and is used to flash the code of the electronic control unit into the electronic control unit.
[0056] Figure 2 It is a flowchart of an automatic retest method for software defects of an electronic control unit provided by an embodiment of the present invention. In one embodiment, it specifically includes the following steps:
[0057] S201: Import defect information and convert the manual test steps in the defect information into automatic test steps.
[0058] The import module 101 obtains the defect information recorded in the Excel document through Python according to the timed import task and imports the defect information into the database. Each piece of defect information includes a test case ID, manual test steps, expected results, actual results, defect status, development person in charge, and test person in charge.
[0059] After the defect information is imported, the following processing is performed:
[0060] The import module 101 notifies the development person in charge corresponding to each piece of defect information to maintain the defect repair plan in the specified path in a specific manner, and the development person in charge maintains the defect repair plan according to personal work arrangements. Preferably, the specific manner is an email.
[0061] The import module 101 extracts the keywords in the manual test steps and the keywords in the expected results. According to the keywords in the manual test steps and the keywords in the expected results, the manual test steps are converted into automatic test steps, and the automatic test steps are stored in the defect information recorded in the Excel document. Therefore, each piece of defect information adds an item of automatic test steps.
[0062] S202: Debug the automatic test steps to obtain the automatically tested steps that pass the debugging.
[0063] The debugging module 102 debugs each group of automatic test steps respectively to obtain the first debugging result. The first debugging result includes passing the debugging and not passing the debugging.
[0064] The reasons for not passing the debugging include that the manual test steps are written irregularly or incorrectly, and the test class of the manual test steps does not exist. For the automatic test steps that do not pass the debugging, there are different solutions according to the reasons for not passing the debugging. Specifically:
[0065] 1. For the situation where the manual test steps are written irregularly or incorrectly, the solution is as follows: The debugging module 102 notifies the corresponding test person in charge to modify the manual test steps that fail the debugging in a specific way. After the test person in charge completes the modification of the manual test steps that fail the debugging, the modified manual test steps are obtained. The test person in charge updates the modified manual test steps to the Excel document, overwriting the original manual test steps. The debugging module 102, according to the scheduled import task, uses Python to periodically obtain the modified manual test steps in the Excel document, reconverts the modified manual test steps into modified automated test steps, and updates and stores the modified automated test steps into the defect information recorded in the Excel document, overwriting the original automated test steps. Preferably, the specific way is email.
[0066] 2. For the situation where the test class of the manual test steps does not exist, the solution is as follows: The debugging module 102 updates the automatic conversion program in Python to add the non-existent test class.
[0067] After executing the above solutions, the debugging module 102 performs secondary debugging on the automated test steps that fail the debugging to obtain the secondary debugging results. The secondary debugging results also include passing the debugging and failing the debugging, and the reasons for failing the debugging are the same as those corresponding to the first debugging results.
[0068] Continuously debug according to the above method, and the automated test steps that fail the debugging will continuously turn into automated test steps that pass the debugging until the debugging results of all automated test steps are all passing the debugging.
[0069] S203: Obtain the defect repair plan, and assign values to the code pull and flash task and the automatic regression test task according to the defect repair plan.
[0070] The assignment module 103 obtains tasks according to the defect repair plan, uses Python to periodically obtain the defect repair plan. The defect repair plan includes but is not limited to defect ID, repair version, estimated repair time, etc. Assign values to the code pull and flash task and the automatic regression test task according to the defect repair plan. The assignment scope includes but is not limited to the defect ID associated with the task, the first execution time of the task, the execution frequency of the task, etc.
[0071] S204: Pull the code of the electronic control unit according to the code pull and flash task, and flash the code into the electronic control unit.
[0072] The flashing module 104, according to the code pull and flash task, uses Python to periodically pull the code of the electronic control unit from the Git subsystem B, and then uses Python to drive the flashing device C to flash the code into the electronic control unit to obtain the flashing result. The flashing result includes flashing successfully and flashing failing.
[0073] If the flashing result is a flashing failure, perform secondary flashing to obtain a secondary flashing result, and decide whether to continue flashing according to the secondary flashing result. Try a predetermined number of times at most. If the flashing result still does not show a flashing failure after reaching the predetermined number of times, notify the tester to perform manual flashing through a specific method. The testers include the test person in charge corresponding to each defect information and other testers except the test person in charge corresponding to each defect information. Preferably, the predetermined number of times is 5 times, and the specific method is email.
[0074] S205: According to the automated regression test task and the automated test steps that have passed debugging, perform an automated regression test on the repaired defects to obtain a test result.
[0075] The regression test module 105 performs an automated regression test on the repaired defects regularly according to the automated regression test task through Python in accordance with the automated test steps that have passed debugging, and obtains a test result. The test result includes passing the test and failing the test.
[0076] If the test result is passing the test, modify the defect status to closed, and the repaired defect will no longer be tracked subsequently; if the test result is failing the test, do not modify the defect status, that is, the defect status remains open, and notify the corresponding development person in charge and test person in charge of the test result through a specific method. After receiving the test result, the development person in charge re-maintains the defect repair plan in the specified path, continues to repair the defect according to the defect repair plan, and after completing the repair, uploads the code to the Git system for the next round of automated regression testing. Preferably, the specific method is email.
[0077] In addition, after completing each round of automated regression testing and obtaining a test result, the regression test module 105 generates a test report based on the test result and notifies the testers of the test report through a specific method. The testers include the test person in charge corresponding to each defect information and other testers except the test person in charge corresponding to each defect information. Preferably, the specific method is email.
[0078] In another embodiment,
[0079] It is possible to first obtain the defect repair plan, assign the code flashing task and the automated regression test task according to the defect repair plan, and then debug the automated test steps to obtain the automated test steps that have passed debugging, that is, the overall execution steps are as follows:
[0080] S301: Import the defect information and convert the manual test steps in the defect information into automated test steps.
[0081] S302: Obtain the defect repair plan, and assign the code pull and flashing tasks and the automatic regression test tasks according to the defect repair plan.
[0082] S303: Debug the automatic test steps to obtain the automatically tested steps that pass the debugging.
[0083] S304: Obtain the code of the electronic control unit according to the code pull and flashing tasks, and flash the code into the electronic control unit.
[0084] S305: Perform an automatic regression test on the repaired defects according to the automatic regression test tasks and the automatically tested steps that pass the debugging to obtain the test results.
[0085] An embodiment of the present invention also provides a computer-readable storage medium storing a program or instructions. When the program or instructions are run on a computer, the computer is caused to execute the automatic re-verification method for software defects of an electronic control unit as described in the foregoing method embodiment.
[0086] As Figure 3 shown, an embodiment of the present invention also provides an electronic device, including: a processor 401, the processor 401 is coupled to a memory 402, and the processor 401 is configured to read and execute a computer program stored in the memory 402 to implement the automatic re-verification method for software defects of an electronic control unit as described in the foregoing method embodiment.
[0087] Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An automatic retesting method for software defects of an electronic control unit, characterized in that: include: Importing defect information, and converting manual test steps in the defect information into automatic test steps; Debugging the automatic test steps to obtain automatic test steps that have passed debugging; Obtain a defect repair plan, and assign values to code pulling and flashing tasks and automatic regression testing tasks according to the defect repair plan; Pull the code of the electronic control unit according to the code pulling and flashing task, and flash the code into the electronic control unit; According to the automatic regression test task and the automatic test steps that have passed the debugging, an automatic regression test is performed on the repaired defects to obtain a test result.
2. The method according to claim 1, characterized in that After importing the defect information, the following steps are also included: Maintain the defect fixing plan in the specified path.
3. The method according to claim 1 or 2, characterized in that: Debugging the automatic test steps to obtain the automatic test steps that have passed the debugging includes: Debug each group of the automatic test steps respectively to obtain debugging results, wherein the debugging results include debugging passed and debugging failed. For the automatic test steps that fail debugging, debug continuously according to a predetermined plan according to the reasons for the debugging failure until all the debugging results are debugging passed.
4. The method according to claim 1, characterized in that Pulling the code of the electronic control unit according to the code pulling and flashing task, and flashing the code into the electronic control unit, includes: According to the code pulling and flashing task, the code of the electronic control unit is pulled from the Git subsystem at a regular interval, and the flashing device is driven to flash the code into the electronic control unit to obtain the flashing result, which includes flashing success and flashing failure.
5. The method according to claim 4, characterized in that Pulling the code of the electronic control unit according to the code pulling and flashing task, and flashing the code into the electronic control unit, further comprising: When the flashing result is a flashing failure, the flashing is continuously repeated until the flashing succeeds or reaches a predetermined number of times.
6. The method according to claim 1, characterized in that According to the automatic regression test task and the automatic test steps passed by the debugging, automatic regression testing is performed on the repaired defects to obtain test results, including: After obtaining the test results, a test report is generated based on the test results.
7. An automatic retest system for electronic control unit software defects, characterized in that: include: A test subsystem, a Git subsystem and a flash device, wherein the test subsystem includes: An import module, used for importing defect information and converting manual test steps in the defect information into automatic test steps; A debugging module, used for debugging the automatic test steps to obtain the automatic test steps that have passed the debugging; An assignment module, used to assign values to code pulling and flashing tasks and automatic regression testing tasks according to the defect repair plan; A flashing module, used for pulling the code of the electronic control unit according to the code pulling and flashing task, and flashing the code into the electronic control unit; The regression test module is used to perform automatic regression testing on the repaired defects according to the automatic regression test tasks and the automatic test steps passed by the debugging to obtain test results.
8. A computer-readable storage medium, characterized in that: A program or instruction is stored, and when the program or instruction is run on a computer, the computer is caused to execute the method for automatic retesting of software defects of an electronic control unit as described in any one of claims 1 to 6.
9. An electronic device, characterized in that: comprising a processor coupled to a memory; The processor is used to read and execute the computer program stored in the memory to implement the automatic retesting method for software defects of an electronic control unit as described in any one of claims 1 to 6.