Software testing method and device, equipment, medium and program product

By building a test case library and a virtual ECU environment, the automation of automotive software testing is achieved, solving the problems of complex, tedious, repetitive and time-consuming testing processes, and improving testing efficiency and effectiveness.

CN120803958AActive Publication Date: 2025-10-17CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511281738.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-10-17
Estimated Expiration
2045-09-09

AI Technical Summary

Technical Problem

Existing automotive software testing methods and platforms have problems such as complex and cumbersome testing processes, repetitive and time-consuming testing processes, low testing efficiency, and test execution interruptions, which cannot effectively improve the efficiency and effectiveness of software testing.

Method used

By building a test case library, including a controlled model library, a common test keyword library, a functional test case basic library and a functional test case extension library, combined with a virtual ECU environment, automated testing can be achieved, reducing test complexity and improving test efficiency.

Benefits of technology

It realizes the automation of software testing, reduces the complexity and time consumption of testing, improves the efficiency and effect of testing, and solves the problems of cumbersome and repetitive testing processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803958A_ABST
    Figure CN120803958A_ABST
Patent Text Reader

Abstract

The invention provides a software testing method and device, equipment, a medium and a program product. Based on the software testing method, firstly, a management mode of constructing a test case public library is adopted, and a controlled model library, a public test keyword library, a function test case basic library and a function test case extension library are strictly added, modified and deleted through case tags; and the maximum reuse degree of the test cases among different items is effectively improved. And on the second aspect, in automatic testing and interrupt protection of the software interface, a backup and execution log management mode is adopted, automatic screening, recognition, conversion, interrupt processing and regression testing of the test cases are achieved, emergencies occurring in the testing process can be efficiently prevented, and it is guaranteed that the test cases are completely, stably and automatically executed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software testing, in particular to a software testing method and device, equipment, medium and program product. BACKGROUND

[0002] With the continuous success of automotive software in the field of new energy and intelligence, the automobile gradually changes from a highly mechanical and electrical integrated mechanical terminal to an intelligent, expandable and sustainable iterative upgrade mobile electronic terminal.

[0003] At present, the in-the-loop testing of automotive software mainly relies on virtual electronic control unit (ECU) technology. The common automotive software testing platform and method have problems such as complex and tedious testing process, repeated and time-consuming testing process, which greatly reduces the efficiency and effect of software testing. SUMMARY

[0004] The present application provides a software testing method and device, equipment, medium and program product, which reduces the testing complexity, reduces the testing time, and greatly improves the efficiency and effect of software testing.

[0005] In a first aspect, the present application provides a software testing method, which comprises: obtaining project source code, a software interface table, testing requirements and project function information; constructing a test case library based on the project source code, the software interface table and the project function information; wherein the test case library comprises at least one or more of the following: a controlled model library, a public test keyword library, a functional test case basic library and a functional test case extension library; constructing a virtual ECU-based test environment based on the project source code, the testing requirements, the project function information and the test case library; determining a first test case of a first project function based on the test case library and the testing requirements of the first project function in the virtual ECU-based test environment, and performing automatic testing on the first project function based on the first test case to obtain a test result; wherein the first project function is a project function to be tested.

[0006] It can be understood that the software testing method provided by the present application can construct a test case library, wherein the test case library can include a controlled model library, a public test keyword library, a functional test case basic library and a functional test case extension library constructed based on the project source code, the software interface table and the project function information, and then in the subsequent software testing process, the constructed test case library can be used to realize the running of the automatic testing of each project function in the built virtual ECU-based test environment in combination with the testing requirements, which reduces the testing complexity, reduces the testing time, and greatly improves the efficiency and effect of software testing.

[0007] In some embodiments, the test case library is constructed based on the project source code, the software interface table and the project function information, including: determining the newly added project function based on the project source code, the software interface table and the project function information, and determining the test mode of the newly added project function; in the case that the test mode of the newly added project function is a preset mode, designing the controlled model and the executable file of the controlled model; adding the controlled model and the executable file of the controlled model to the controlled model library.

[0008] It can be understood that the software testing method provided by the embodiments of the present application can identify the test mode for the newly added project function, and construct the controlled model library by using the identified test mode, and then in the subsequent software testing process, the automatic testing of each project function can be run by using the constructed controlled model library, which reduces the testing complexity, reduces the testing time consumption, and greatly improves the efficiency and effect of software testing.

[0009] In some embodiments, the test case library is constructed based on the project source code, the software interface table and the project function information, including: determining the newly added project function based on the project source code, the software interface table and the project function information; in the case that the second test case called by the newly added project function exists, generating the keyword information corresponding to the newly added project function based on the second test case; and adding the keyword information to the public test keyword library.

[0010] It can be understood that the software testing method provided by the embodiments of the present application can determine whether the second test case called by the newly added project function exists, and construct the public test keyword library in the case that the second test case called by the newly added project function exists, and then in the subsequent software testing process, the automatic testing of each project function can be run by using the constructed public test keyword library, which reduces the testing complexity, reduces the testing time consumption, and greatly improves the efficiency and effect of software testing.

[0011] In some embodiments, the method further includes: determining the newly added project function based on the project source code, the software interface table and the project function information; and performing project range identification on the newly added project function to determine the identification result of the newly added project function.

[0012] It can be understood that the software testing method provided by the embodiments of the present application can obtain the corresponding identification result through project scope identification for the newly added project function, and the identification result can be used to determine the project label of the test case in the construction process of the test case library, and then in the subsequent software testing process, the constructed test case library can be used to realize the running of the automation testing of each project function in the built test environment based on the virtual ECU in combination with the test requirements, thereby reducing the testing complexity, reducing the testing time consumption, and greatly improving the efficiency and effect of the software testing.

[0013] In some embodiments, the test case library is constructed based on the project source code, the software interface table and the project function information, including: performing basic design of the test case for the newly added project function based on the function definition file included in the project function information, to obtain the basic test case of the newly added project function; determining the project label of the basic test case of the newly added project function based on the identification result of the newly added project function; and adding the basic test case of the newly added project function and the project label to the function test case basic library.

[0014] It can be understood that the software testing method provided by the embodiments of the present application can perform basic design of the test case for the newly added project function, and construct the function test case basic library by using the obtained basic test case, and then in the subsequent software testing process, the constructed function test case basic library can be used to realize the running of the automation testing of each project function, thereby reducing the testing complexity, reducing the testing time consumption, and greatly improving the efficiency and effect of the software testing.

[0015] In some embodiments, the test case library is constructed based on the project source code, the software interface table and the project function information, including: performing extension design of the test case for the newly added project function based on the function definition file included in the project function information and the basic test case of the newly added project function, to obtain the extension test case of the newly added project function; and adding the extension test case of the newly added project function and the project label to the function test case extension library.

[0016] It can be understood that the software testing method provided by the embodiments of the present application can perform extension design of the test case for the newly added project function, and construct the function test case extension library by using the obtained extension test case, and then in the subsequent software testing process, the constructed function test case extension library can be used to realize the running of the automation testing of each project function, thereby reducing the testing complexity, reducing the testing time consumption, and greatly improving the efficiency and effect of the software testing.

[0017] In some embodiments, based on the project source code, the test requirement, the project function information and the test case library, a virtual ECU-based test environment is constructed, including: generating an executable file of a master model based on the project source code; obtaining a controlled model of a second project function and an executable file of the controlled model of the second project function in a controlled model library; wherein the second project function is a project function to be tested indicated by the test requirement; and constructing the virtual ECU-based test environment based on the executable file of the master model and the executable file of the controlled model of the second project function.

[0018] It can be understood that the software testing method provided by the embodiments of the present application can reduce the complexity of the test case, solve the problem of low test efficiency caused by repeated updating operation in the process of updating the test case, and ultimately solve the technical problems of complex and tedious test process and repeated time-consuming test process, thereby greatly improving the efficiency and effect of software testing.

[0019] In some embodiments, based on the test case library and the test requirement of the first project function, a first test case of the first project function is determined, including: determining a project number of the first project function to be tested; and determining the first test case in the test case library based on the project number and the test requirement of the first project function.

[0020] It can be understood that the software testing method provided by the embodiments of the present application can select the corresponding test case from the constructed test case library for testing by the project number and the test requirement of the project function to be tested in the running process of the automatic test of the virtual ECU-based test environment, thereby reducing the test complexity and test time consumption, and greatly improving the efficiency and effect of software testing.

[0021] In some embodiments, based on the first test case, an automatic test of the first project function is performed to obtain a test result, including: generating a first test case execution file based on the first test case in the virtual ECU-based test environment; and automatically running the first test case execution file to obtain the test result.

[0022] It can be understood that the software testing method provided by the embodiments of the present application can test by automatically running the first test case execution file corresponding to the first test case in the running process of the automatic test of the virtual ECU-based test environment, thereby reducing the test complexity and test time consumption, and greatly improving the efficiency and effect of software testing.

[0023] In some embodiments, the method further comprises: recording and storing a running log corresponding to the first test case during the automatic running of the first test case execution file; accordingly, the method further comprises: in the case of interruption of the automatic testing of the first project function, performing interruption protection processing based on the running log corresponding to the first test case.

[0024] It can be understood that the software testing method provided by the embodiments of the present application can record and store a running log corresponding to the first test case during the running of the automatic testing of the virtual ECU-based test environment, and perform interruption protection processing based on the running log corresponding to the first test case in the case of subsequent interruption, thereby reducing the testing complexity, reducing the testing time consumption, and greatly improving the efficiency and effect of software testing.

[0025] In a second aspect, the embodiments of the present application provide a software testing device, which comprises: An acquisition unit is configured to acquire project source code, a software interface table, test requirements, and project function information. A construction unit is configured to construct a test case library based on the project source code, the software interface table, and the project function information; wherein the test case library comprises at least one or more of the following: a controlled model library, a public test keyword library, a functional test case basic library, and a functional test case extension library. The construction unit is further configured to construct a virtual ECU-based test environment based on the project source code, the test requirements, the project function information, and the test case library. A determination unit is configured to determine a first test case of a first project function based on the test case library and test requirements of the first project function under the virtual ECU-based test environment; wherein the first project function is a project function to be tested. A test unit is configured to perform automatic testing of the first project function based on the first test case, and obtain a test result.

[0026] In a third aspect, the embodiments of the present application provide an electronic device, which comprises a memory and a processor, the memory stores a computer program capable of running on the processor, and the processor implements the software testing method of the first aspect when executing the program.

[0027] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the software testing method of the first aspect.

[0028] In a fifth aspect, the embodiments of the present application provide a computer program product, which comprises a computer program or instructions, and the computer program or instructions are executed by a processor to implement the software testing method of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0029] The accompanying drawings herein are incorporated into and constitute a part of this specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, serve to illustrate the technical solutions of the present application. Obviously, the drawings described below are merely some embodiments of the present application. Those skilled in the art can, without inventive effort, derive other drawings from these drawings.

[0030] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0031] Figure 1 A schematic diagram of the implementation process of a software testing method provided in the embodiment of the present application Figure 1 ; Figure 2 A schematic diagram of a test case library provided in an embodiment of the present application; Figure 3 A schematic diagram of a functional test case base library provided in an embodiment of the present application; Figure 4 A schematic diagram of the functional test case extension library provided in an embodiment of the present application; Figure 5 Schematic diagram of the implementation of the test case design provided in the embodiment of the application; Figure 6 A schematic diagram of implementing the screening of test cases based on test requirements provided in an embodiment of the present application; Figure 7 A schematic diagram of the implementation process of a software testing method provided in the embodiment of the present application Figure 2 ; Figure 8 A schematic diagram illustrating the implementation of interrupt protection for a test case provided in an embodiment of the present application; Figure 9 A schematic diagram of the implementation process of a software testing method provided in the embodiment of the present application Figure 3 ; Figure 10 A schematic diagram of the architecture of a test system provided in an embodiment of the present application; Figure 11 A schematic diagram of a software testing device provided in an embodiment of the present application; Figure 12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application.

[0033] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in the following with reference to the drawings, and the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Therefore, the described embodiments should not be regarded as limitations on the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present application.

[0034] In the following description, “some embodiments / other embodiments” are described, which describe a subset of all possible embodiments. However, it can be understood that “some embodiments / other embodiments” can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0035] In the following description, the terms “first / second” are only to distinguish similar objects, and do not represent a specific order of the objects. It can be understood that “first / second” can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.

[0037] In the mobile travel era, cars have gradually changed from purely mechanically driven hardware to software-driven electronic products. The hardware configurations of products of different car manufacturers have gradually converged. In the case of limited cost and functional improvement space, the reconstruction of the traditional automobile value chain is imperative. The core elements of car manufacturers to create differentiation have shifted to automobile software that was previously deeply integrated with hardware. With the continuous success of automobile software in the new energy and intelligent fields, it has become an industry consensus to enter the era of “Software Defined Vehicles (SDV)”. “Software Defined Vehicles” reflects the transformation of cars from highly mechanical and electrical integrated mechanical terminals to intelligent, expandable, and sustainable iterative and upgraded mobile electronic terminals.

[0038] To achieve this goal, the vehicle is pre-embedded with high-performance hardware before the standard operating procedure, and the functions and values are gradually unlocked and released through over-the-air technology (OTA) during the life cycle. The impact is first that the software and automotive electronics gradually increase the development cost of the entire vehicle, and the value of in-vehicle software and electronic hardware will gradually exceed the hardware and become the core of the entire vehicle value. Second, the performance and functionality changes brought about by software and software updates will determine the differences of future cars. Therefore, software updates and maintenance are the most economical, convenient and fastest way for OEMs to provide differentiated experiences and improve customer satisfaction. Automotive software development uses a software and hardware decoupling approach to develop software and hardware independently, thereby reducing development costs, improving efficiency, and avoiding repeated vehicle verification. Therefore, how to transition the pure software development and verification process from the prototype vehicle or hardware-in-the-loop test to the software-in-the-loop test and verification is the key problem of flexible updates during the vehicle life cycle.

[0039] Currently, automotive software-in-the-loop testing mainly relies on virtual electronic control unit (ECU) technology, which converts real controllers into virtual controllers and deploys them to computer integration environments and joint simulation platforms to move automotive software testing to the early development stage to form a closed loop, thereby reducing automotive software development costs and time. Among them, the conversion input process requires multiple processing of automotive software source code, the conversion process requires different interface plugging according to project requirements, and the testing process requires manual testing of test cases one by one, which is relatively cumbersome. Moreover, the basic functions of automotive software for different vehicle models have many similarities, and designing test cases for each project separately prolongs the software development cycle and wastes a lot of testing human resources. In addition, manual testing often cannot effectively prevent interruptions caused by computers, testing tools or human errors, and the testing process needs to be manually reset, which greatly affects the testing completion time.

[0040] Currently, common automotive software testing platforms and methods, while being able to solve the problems of complex testing process and low testing efficiency to some extent, still have certain limitations and cannot solve the problems of complex and tedious testing process, time-consuming testing process, and testing interruption, greatly reducing the efficiency and effectiveness of software testing.

[0041] To solve the above problems, the embodiment of the application provides a software testing method, project source code, a software interface table, test requirements and project function information are acquired; a test case library is constructed based on the project source code, the software interface table and the project function information; wherein the test case library comprises at least one or more of the following: a controlled model library, a public test keyword library, a function test case basic library and a function test case extension library; a virtual ECU-based test environment is constructed based on the project source code, the test requirements, the project function information and the test case library; in the virtual ECU-based test environment, a first test case of a first project function is determined based on the test case library and the test requirements of the first project function, and automatic testing of the first project function is performed based on the first test case to obtain a test result; wherein the first project function is a project function to be tested. It can be seen that in the embodiment of the application, the test case library can be constructed, wherein the test case library can comprise the controlled model library, the public test keyword library, the function test case basic library and the function test case extension library constructed based on the project source code, the software interface table and the project function information, wherein the controlled model library and the public test keyword library can be used for building the virtual ECU-based test environment, and the function test case basic library and the function test case extension library can be used for screening test cases, so that in the subsequent software testing process, the complexity of the screened test cases is reduced by using the built virtual ECU-based test environment, and the test case library is constructed to realize the operation of automatic testing of each project function in combination with the test requirements. That is, the scheme provided in the embodiment of the application can reduce the test complexity, reduce the test time consumption, and greatly improve the efficiency and effect of software testing.

[0042] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application.

[0043] An embodiment of the application provides a software testing method, which can be applied to a software testing device or an electronic device, and can also be applied to any terminal or any vehicle device comprising the software testing device or the electronic device.

[0044] It can be understood that the software testing method provided in the embodiment of the application can comprise a virtual ECU-based automatic software interface testing method, which is a high-efficiency and reliable, simple-to-operate and stable automatic software interface testing mechanism. All steps in the testing process are concentrated together, agile development and rapid iteration can be realized under rapid change of function requirements, the reuse problem of test cases between different projects is solved, testing interruption caused by external reasons is avoided, automatic testing of software interfaces is realized, and the overall process of software-in-the-loop testing is greatly optimized.

[0045] Below, taking a software testing device as an example, the software testing method proposed in the embodiments of the present application is exemplarily described.

[0046] Further, in the embodiments of the present application, Figure 1 The implementation flow of a software testing method provided in the embodiments of the present application is shown in Figure 1 As shown in Figure 1 The software testing method comprises the following steps: Step 101, obtaining project source code, software interface table, testing requirement and project function information.

[0047] In the embodiments of the present application, the software testing device can first obtain project source code, software interface table, testing requirement and project function information.

[0048] In some embodiments, the project source code, software interface table, testing requirement and project function information can be obtained after the software development is completed. For example, after the automobile software is developed, the software testing device can obtain the project source code, software interface table, testing requirement and project function information through the submission of data and information performed by the developer.

[0049] In some embodiments, the project source code can be understood as a project source project.

[0050] In some embodiments, the software interface table is a list of all software interfaces designed for implementing the project functions in the project source code; wherein the software interface table can include software interfaces used for implementing functions, mapping connections, etc.

[0051] In some embodiments, the testing requirement is the functional range (testing functional range) contained in the software testing, that is, the functional range of the corresponding test can be determined through the testing requirement.

[0052] In some embodiments, the project function information can include at least one or more of the following: project function list, function definition file, configuration word, etc. Wherein the project function list can include the project functions to be tested and the corresponding project function names; the function definition file can include a file for specifically describing the project functions; the configuration word can be used to implement the project functions, for example, the configuration words corresponding to different project functions are different, and the implemented functions are different.

[0053] In some embodiments, if a project function does not have a corresponding configuration word, it can be defaulted that the test on the project function is not needed.

[0054] Exemplarily, in some embodiments, the configuration word corresponding to the project function A can be 1, the configuration word corresponding to the project function B can be 2, and the project function C does not have a corresponding configuration word.

[0055] Exemplarily, in some embodiments, after the software development is completed, the developer can perform the submission of data and information, and accordingly, the software testing device can acquire one or more of the project source code, the project function list, the function definition file, the configuration word, etc.

[0056] Exemplarily, in some embodiments, the software testing device can also acquire the project source code, the software interface table, the test requirement and the project function information in the form of a test admission specification. The test admission specification can include one or more of the project source code, the project function list, the function definition file, the software interface table, the configuration word, etc.

[0057] Step 102, based on the project source code, the software interface table and the project function information, a test case library is constructed; wherein the test case library at least includes one or more of the following: a controlled model library, a public test keyword library, a function test case basic library, a function test case extension library.

[0058] In the embodiments of the present application, after the project source code, the software interface table, the test requirement and the project function information are acquired, the construction of the test case library can be further performed, i.e., based on the project source code, the software interface table and the project function information, the test case library is constructed.

[0059] Exemplarily, in some embodiments, the software testing device can determine one or more of the project source code, the newly added function list (including the newly added project function in the project function list), the function definition file, the software interface table, the configuration word, etc. based on the acquired test admission specification, and then further construct the test case library based on one or more of the above information.

[0060] In some embodiments, the test case library can at least include one or more of the following: a controlled model library, a public test keyword library, a function test case basic library, a function test case extension library.

[0061] In some embodiments, the controlled model library and the public test keyword library in the test case library can be used for subsequent construction of a virtual ECU-based test environment. The virtual ECU-based test environment constructed based on the controlled model library and the public test keyword library as a test environment for subsequent software testing can reduce the complexity of the test case, and solve the problem of low test efficiency caused by repeated updating operation in the process of updating the test case, and finally solve the technical problems of complex and tedious test flow, repeated and time-consuming test process, etc.

[0062] In some embodiments, the function test case basic library and the function test case extension library in the test case library can be used for selection and determination of the test case in the subsequent software testing process.

[0063] Exemplarily, in some embodiments, a macroscopic architecture diagram of the test case library is as shown in FIG. 1. Figure 2 As shown in FIG. 1, the test case library can include a controlled model library, a public test keyword library, a functional test case basic library, and a functional test case extension library; wherein the controlled model library and the public test keyword library can be distinguished by function tags, for example, the controlled model library adopts function 1, function 2, and the like function tags, and the public test keyword library adopts function a, function b, and the like function tags; the functional test case basic library and the functional test case extension library can be distinguished by project tags, for example, the functional test case basic library adopts platformization, project A, project B, project C, project D, and the like project tags, and the functional test case extension library adopts platformization, project A, project B, project C, project D, and the like project tags.

[0064] In some embodiments, the controlled model library can be used to store controlled models used in the software testing process, wherein the controlled models can be stored in the controlled model library in the form of executable files in Functional Mock-up Unit (FMU) format.

[0065] In some embodiments, the public test keyword library can be used to store other functional test cases called in the software testing process, wherein the called other functional test cases can be stored in the public test keyword library in the form of being encapsulated into public test keywords.

[0066] In some embodiments, the functional test case basic library can be used to store basic test cases used in the software testing process, wherein the basic test cases can be stored in the functional test case basic library together with corresponding project tags.

[0067] In some embodiments, the functional test case extension library can be used to store extension test cases used in the software testing process, wherein the extension test cases can be stored in the functional test case extension library together with corresponding project tags.

[0068] In the embodiments of the present application, when the test case library is constructed based on the project source code, the software interface table, and the project function information, the newly added project function can be determined based on the project source code, the software interface table, and the project function information, and the test mode of the newly added project function is determined; in the case that the test mode of the newly added project function is a preset mode, the controlled model and the executable file of the controlled model are designed; and the controlled model and the executable file of the controlled model are added to the controlled model library.

[0069] In some embodiments, the software testing device can determine the newly added project functions based on the project source code, the software interface table and the project function information. Among them, all the project functions indicated by the project function information (i.e. all the project functions included in the project function list) can include project functions for which test cases have been generated and / or project functions for which test cases have not been generated. Among them, these project functions for which test cases have not been generated are the newly added project functions.

[0070] Exemplarily, in some embodiments, the software testing device can detect and identify all the project functions included in the project function list based on the project source code, so as to determine the newly added project functions (new function list).

[0071] In some embodiments, the test mode can be understood as the test implementation mode of the software test of the project function. Among them, the test mode can include a preset mode, which can be understood as the test implementation mode using the controlled model.

[0072] In some embodiments, the software testing device can further identify the test implementation mode of each newly added project function according to the new function list and the source code project (project source code), and determine whether the newly added project function can be directly tested through the software interface or whether the controlled model needs to be designed to simulate the read-write interaction between the underlying hardware and the application layer software, so as to finally determine the test mode corresponding to the newly added project function.

[0073] In some embodiments, if it is determined that the test mode of the newly added project function is the preset mode, i.e. the test implementation mode using the controlled model, then the controlled model needs to be further designed, and the executable file of the controlled model is generated. Among them, the executable file of the controlled model can be an executable file in FMU format.

[0074] Exemplarily, in some embodiments, for the newly added project functions that cannot be directly tested through the software interface, the software testing device can further design the corresponding controlled model, then generate an executable file in FMU format, and add it to the controlled model library. Among them, the FMU executable file of the controlled model is a functional model unit of a single model generated based on the Functional Mock-up Interface (FMI) standard.

[0075] In some embodiments, the testing method of the newly added project function can be understood as the specific test implementation method determined by the function definition analysis of the newly added project function. For example, the testing method may include but is not limited to a method that requires the underlying module to provide real-time interface change input, or a method that requires the output to be fed back to the input after other functions are implemented, or a method that can be directly tested through a software interface, etc.

[0076] In some embodiments, a preset method can be used to determine whether the design conditions of the controlled model are met. For example, if the preset method requires the controlled model to be designed to simulate the read and write interaction between the underlying hardware and the application layer software, then if the preset method requires the controlled model to be designed to simulate the read and write interaction between the underlying hardware and the application layer software, then it can be determined that it is the preset method, and the controlled model can be designed.

[0077] For example, in some embodiments, during the construction of the controlled model library, the corresponding test function scope may be determined based on the test requirements, and then the controlled model library may be further constructed based on the test function scope.

[0078] For example, in some embodiments, when building a controlled model library based on the test function scope, the function definition is analyzed for the function items in the test function scope. If the function requires the underlying module to provide real-time interface change input, a controlled model can be further constructed. The controlled model is used to simulate the underlying real-time input. The controlled model is then added to the controlled model library and a function tag (such as Figure 2 The preset method includes a test method that requires the underlying module to provide real-time interface change input.

[0079] For example, in some embodiments, when building a controlled model library based on the test function scope, the function definition is analyzed for the function items in the test function scope. If the function requires the output to be fed back to the input after the implementation of other functions, a controlled model is built. The controlled model is used to simulate the underlying signal transmission. The controlled model is then added to the controlled model library and a function tag (such as Figure 2 The preset method includes a test method that requires output feedback to input after other functions are implemented.

[0080] For example, in some embodiments, when building a controlled model library based on the test function scope, the function definition is analyzed for the function items in the test function scope. If the expected result of the function changes dynamically, a controlled model is built. The controlled model is used to automatically identify the dynamic change of the expected result and feedback the identification result. The controlled model is then added to the controlled model library and a function tag (such as Figure 2The preset mode includes a test mode requiring automatic identification and feedback of dynamic changes of expected results.

[0081] For example, in some embodiments, when the controlled model library is built based on the test function range, for a function item in the test function range, the function definition is analyzed. If the function needs to assign values to the input interface at an unspecified time during the function implementation process, a controlled model is constructed for automatically assigning values to the input interface during the function implementation process. Then, the controlled model is added to the controlled model library, and a function label (such as Figure 2 The preset mode includes a test mode requiring automatic assignment of values to the input interface during the function implementation process.

[0082] That is, in the embodiments of the present application, the construction of the controlled model library includes building controlled models based on the test function range determined according to the test requirements, which can include but are not limited to the following time limit modes: (1) For a function item in the test function range, the function definition is analyzed. If the function needs real-time interface change input provided by the underlying module, a controlled model is constructed to simulate the real-time input of the underlying module, and is added to the controlled model library, and a function label (such as Figure 2 shown) is added. (2) For a function item in the test function range, the function definition is analyzed. If the output after the implementation of the other function needs to be fed back to the input, a controlled model is constructed to simulate the signal transmission of the underlying module, and is added to the controlled model library, and a function label (such as Figure 2 shown) is added. (3) For a function item in the test function range, the function definition is analyzed. If the expected result of the function dynamically changes, a controlled model library is constructed to automatically identify the dynamic changes of the expected result and feed back the identification result, and is added to the controlled model library, and a function label (such as Figure 2 shown) is added. (4) For a function item in the test function range, the function definition is analyzed. If the function needs to assign values to the input interface at an unspecified time during the function implementation process, a controlled model library is constructed to automatically assign values to the input interface during the function implementation process, and is added to the controlled model library, and a function label (such as Figure 3 shown) is added.

[0083] In the embodiments of the present application, when the test case library is built based on the project source code, the software interface table and the project function information, the newly added project function can be determined based on the project source code, the software interface table and the project function information. In the case where the newly added project function exists a second test case, the keyword information corresponding to the newly added project function is generated based on the second test case. The keyword information is added to the public test keyword library.

[0084] In some embodiments, before a test case for each newly added function (newly added project function) is designed, whether the test case of each newly added project function exists in a case of calling other function test cases as preconditions can be identified based on the newly added project function and the project source code, and if so, the same (called test cases) can be encapsulated into a public test keyword and added to a public test keyword library. The public test keyword is used for direct calling of other test cases, facilitating management and simplifying subsequent modification operations.

[0085] In the embodiments of the present application, the software testing device can determine the newly added project function based on the project source code, the software interface table and the project function information, perform project scope identification on the newly added project function, and determine the identification result of the newly added project function.

[0086] In some embodiments, the project scope identification can be used to determine the scope to which the project function belongs.

[0087] Exemplarily, in some embodiments, for the newly added function list (including the list of newly added project functions) in the obtained project function list, the scope to which each newly added function (newly added project function) belongs can be identified according to the newly added function list, and it is confirmed whether the newly added project function belongs to a platform function, i.e., a function common to all projects, or a function unique to a single project.

[0088] Exemplarily, in some embodiments, after the project scope identification of the newly added project function, the corresponding identification result determined can include but is not limited to a platform function, a project unique function, etc.

[0089] In the embodiments of the present application, when the test case library is constructed based on the project source code, the software interface table and the project function information, the basic design of the test case for the newly added project function can be performed based on the function definition file included in the project function information to obtain the basic test case of the newly added project function, the project tag of the basic test case of the newly added project function is determined based on the identification result of the newly added project function, and the basic test case of the newly added project function and the project tag are added to the function test case basic library.

[0090] In some embodiments, when the basic test case is designed, the test case can be designed in a forward direction based on excel by checking the function definition file, and the project tag is added to each basic test case and then added to the function test case basic library.

[0091] In some embodiments, the test cases are designed based on Excel, the main purpose of which is to facilitate the management and identification of the test cases. Necessary explanatory text can be added to the Excel file to facilitate the identification and understanding of the test cases.

[0092] In some embodiments, the label (project label) added to each test case in the Excel source file is derived from the identification result determined after the project scope is identified, wherein the identification result includes but is not limited to: platform functions, project-specific functions, etc.

[0093] Exemplarily, in some embodiments, if the recognition result is a platform function, the project label of the test case can be determined as "PLATFORMIZATION"; if the recognition result is a project-unique function, the project label of the test case can be determined as "Project X", where "Project X" is the project code; if the function is shared by multiple projects, the project label of the test case can be determined as "Project X1, Project X2", where "Project X1" and "Project X2" are both project codes.

[0094] For example, in some embodiments, Figure 4 As shown, the test cases such as Forward 1 and Forward 2 are basic test cases. Of course, the functional test case basic library can also include other basic test cases besides Forward 1 and Forward 2.

[0095] In an embodiment of the present application, when constructing a test case library based on the project source code, software interface table and project function information, the test case extension design can be performed for the newly added project function based on the function definition file included in the project function information and the basic test case of the newly added project function to obtain the extended test case of the newly added project function; the extended test case and project label of the newly added project function can be added to the functional test case extension library.

[0096] In some embodiments, when designing basic test cases, you can refer to the function definition file and the corresponding basic function test cases (basic test cases), design extended test cases based on Excel, add project tags to each extended test case, and add them to the functional test case extension library.

[0097] Exemplarily, in some embodiments, the extended test cases may mainly include at least one or more of the following: a reverse test case, a boundary condition test case, a state switching test case, etc.

[0098] Exemplarily, in some embodiments, for the same item function, the item label of the generated extended test case is consistent with the item label of the basic test case, that is, the test cases (including the basic test case and / or the extended test case) corresponding to the same item function have the same item label.

[0099] Exemplarily, in some embodiments, as shown in Figure 5 , the reverse 1, the reverse 2, the reverse 3, the reverse 4, the switching and the like test cases are extended test cases, of course, the function test case extension library can also include other extended test cases in addition to the reverse 1, the reverse 2, the reverse 3, the reverse 4, and the switching.

[0100] Exemplarily, in some embodiments, the design principles of the basic test case and the extended test case are as shown in Figure 6 and Table 1, the basic test case is a forward test case of the function, and the extended test case includes reverse test cases, state switching and the like, wherein the reverse test case needs to set a premise condition not to be met for output detection, and the state switching needs to set a trigger condition to change after the normal execution of the forward test case for output detection.

[0101] Table 1

[0102] Step 103, based on the item source code, the test requirement, the item function information and the test case library, a virtual ECU-based test environment is constructed.

[0103] In the embodiments of the present application, after the test case library is constructed based on the item source code, the software interface table and the item function information, the virtual ECU-based test environment can be further constructed based on the item source code, the test requirement, the item function information and the test case library.

[0104] In some embodiments, after the construction of the test case library is completed, the software testing device can further perform the construction of the virtual ECU-based test environment based on the constructed test case library, that is, the test environment is constructed based on the virtual ECU.

[0105] In the embodiments of the present application, after the test requirement is obtained, the function range of the test can be further determined based on the test requirement, that is, the test requirement can be used to determine the function range of the corresponding test, and then the construction of the virtual ECU-based test environment can be performed through the function range of the test in the subsequent processing process.

[0106] In some embodiments, the test requirement can include but is not limited to full-amount testing, incremental testing and the like. Among them, the full-amount testing is to test all functions of the project, and the incremental testing is to test the newly added functions, the basic functions and the associated functions of the project.

[0107] In some embodiments, if the test requirement is full volume testing, the functional scope of the test includes, but is not limited to, all test cases in the test case base library and the test case extension library with the platformization label and in line with the project number.

[0108] In some embodiments, if the test requirement is incremental testing, the functional scope of the test includes, but is not limited to, newly added test cases, all test cases in the test case base with the platformization label and in line with the project number, and all test cases in the test case extension library related to the newly added function with the platformization label and in line with the project number.

[0109] In some embodiments, when constructing the virtual ECU-based test environment based on the project source code, the test requirement, the project function information, and the test case library, an executable file of the master model can be generated based on the project source code first; the slave model of the second project function and the executable file of the slave model of the second project function are obtained from the slave model library; the second project function is the project function to be tested indicated by the test requirement; and the virtual ECU-based test environment is constructed based on the executable file of the master model and the executable file of the slave model of the second project function.

[0110] In some embodiments, for the second project function, the slave model library can be screened for the slave model first to obtain the slave model corresponding to the second project function. In the determination of the slave model corresponding to the second project function, the test function scope corresponding to the second project function can be determined based on the test requirement of the second project function, and then the function label corresponding to the second project function can be determined based on the determined test function scope of the second project function, and thus the slave model of the second project function can be screened from the slave model library based on the function label corresponding to the second project function.

[0111] Illustratively, in some embodiments, for the second project function to be tested indicated by the test requirement, the corresponding test function scope can be determined first. For example, if the test requirement corresponding to the second project function is full volume testing, the functional scope of the test (test function scope) can be determined as all functions specified by the project function list corresponding to the second project function. If the test requirement corresponding to the second project function is incremental testing, the functional scope of the test can be determined as the function changed this time and all functions associated with the function in the project function list corresponding to the second project function.

[0112] Illustratively, in some embodiments, after the test function scope corresponding to the second project function is determined, i.e., after the functions to be tested are determined, the function labels of these functions to be tested can be further determined, i.e., the function label corresponding to the second project function is determined.

[0113] It can be seen that, in the embodiments of the present application, the implementation of constructing the virtual ECU-based test environment relies on the screening of the controlled models in the controlled model library. In the screening of the required controlled models, the test function range can be determined based on the test requirements, and then the controlled models corresponding to all the function items to be tested are screened from the controlled model library based on the determined function range (test function range), i.e., based on all the function items to be tested. If the test requirements are full-amount testing, the function range for testing is all the functions specified in the project function list. If the test requirements are incremental testing, the function range for testing is the function changed in this test and all the functions associated with the function.

[0114] In some embodiments, based on one or more of the acquired project source code, test requirements, project function information, and constructed test case library, the software testing device can determine the executable file corresponding to the master model and the executable file corresponding to the controlled model, respectively. Finally, the virtual ECU-based test environment can be built using the executable file corresponding to the master model and the executable file corresponding to the controlled model.

[0115] Exemplarily, in some embodiments, the executable file corresponding to the master model and the executable file corresponding to the controlled model can include FMU format executable files. The virtual ECU can use FMU format files.

[0116] Exemplarily, in some embodiments, the executable file of the master model can be generated based on the project source code. The software testing device can acquire the source code required for constructing the virtual ECU through the project source project (project source code), wherein the required source code includes C code source files, C code header files, ARXML files, task scheduling timing, etc. Then, the project source code (source code required for constructing the virtual ECU) is preprocessed using a script, and the initial value of the configuration word corresponding part of the interface is simulated to write the initial value of the underlying layer. Finally, the FMU format executable file can be generated based on the preprocessed source code, i.e., the executable file of the master model.

[0117] In some embodiments, the second project function can be the project function to be tested indicated by the test requirements, and / or the second project function can be any one of the project functions in the project function list.

[0118] In some embodiments, in the process of constructing the test case library, the controlled model corresponding to the second project function can be stored in the controlled model library. The controlled model of the second project function can be stored in the form of an executable file of the controlled model.

[0119] Exemplarily, in some embodiments, for the second item function indicated by the test requirement to be implemented by the controlled model, the software testing device can screen and obtain the FMU file corresponding to the required controlled model (the controlled model of the second item function) in the controlled model library in the test case library. Finally, the virtual ECU-based test environment can be built based on the FMU file of the project source project (the executable file of the master control model) and the FMU file of the controlled model (the executable file of the controlled model).

[0120] In some embodiments, after determining the executable file of the master control model and the executable file of the controlled model of the second item function, the virtual ECU-based test environment can be further built in combination with the public test keyword library. In the process of building the test environment, the master control model and the controlled model are both run in the form of executable files, and other functional test cases called in the public test keyword library are run in the form of public test keywords.

[0121] Exemplarily, in some embodiments, for other functional test cases called in the software testing process, i.e., existing test cases as preconditions, based on the public test keyword library, the virtual ECU-based test environment can be further built in the form of public test keywords, so that the subsequent software testing process can realize the direct calling and updating of other functional test cases as preconditions in the virtual ECU-based test environment.

[0122] As can be seen, the virtual ECU-based test environment is built by the controlled model library in the test case library and the public test keyword library. Therefore, the controlled models to be called and other functional test cases to be called already exist in the built virtual ECU-based test environment, and the subsequent test case screening process in the virtual ECU-based test environment can obtain simpler test cases, reducing the complexity of the test cases (first test cases) in the testing process.

[0123] Step 104, in the virtual ECU-based test environment, based on the test case library and the test requirement of the first item function, determine the first test case of the first item function, and execute the automatic test of the first item function based on the first test case, and obtain the test result; wherein the first item function is the item function to be tested.

[0124] In an embodiment of the present application, after building a test environment based on a virtual ECU based on the project source code, test requirements, project function information and a test case library, it is possible to further determine a first test case for the first project function based on the test case library and the test requirements of the first project function in the test environment based on the virtual ECU, and perform automated testing of the first project function based on the first test case to obtain a test result.

[0125] In some embodiments, when determining the first test case of the first project function based on the test case library and the test requirements of the first project function, the project number of the first project function to be tested is determined; then, based on the project number and the test requirements of the first project function, the first test case is determined in the test case library.

[0126] In an embodiment of the present application, for the first project function to be tested, the functional scope of the corresponding test can be determined first based on the test requirements of the first project function, that is, the test requirements of the first project function can be used to determine the functional scope of the test corresponding to the first project function, and then the corresponding test case screening process can be executed through the functional scope of the test of the first project function in the subsequent processing flow.

[0127] In some embodiments, the test requirements for the first project function may include but are not limited to full testing, incremental testing, etc. Full testing is to test all functions of the project, and incremental testing is to test new functions, basic functions, and related functions of the project.

[0128] In some embodiments, if the test requirement of the first project function is full testing, the functional scope of the test of the first project function includes but is not limited to: all test cases with platform tags and project numbers in the test case basic library and the test case extension library.

[0129] In some embodiments, if the test requirement of the first project function is incremental testing, the functional scope of the test of the first project function includes but is not limited to: newly added test cases, all test cases in the test case base that have platform labels and match the project numbers, and all test cases in the test case extension library that are related to the newly added functions and have platform labels and match the project numbers.

[0130] Exemplarily, in some embodiments, the software testing device can screen and obtain corresponding test cases (first test cases) in the test case library according to the project number of the first project function and the test requirement of the first project function. For example, if the test requirement is full-amount testing, all test cases with the project label of “PLATFORMIZATION” and the corresponding project number label (project number) in the basic library of function test cases and the extended library of function test cases need to be screened out as corresponding first test cases.

[0131] Exemplarily, in some embodiments, the software testing device can screen and obtain corresponding test cases (first test cases) in the test case library according to the project number of the first project function and the test requirement of the first project function. For example, if the test requirement is full-amount testing, all test cases with the project label of “PLATFORMIZATION” and the corresponding project number label (project number) in the basic library of function test cases and the extended library of function test cases need to be screened out as corresponding first test cases.

[0132] Exemplarily, in some embodiments, the process of screening test cases based on test requirements can be as shown in Figure 7 Exemplarily, in some embodiments, the process of screening test cases based on test requirements can be as shown in

[0133] Exemplarily, in some embodiments, when screening related test cases in the extended library of function test cases, Chinese keyword screening can be performed by using scripts.

[0134] In some embodiments, since the virtual ECU-based test environment is built by the controlled model library and the public test keyword library in the test case library, for the test requirement of the first project function, the controlled model to be invoked and the other function test case to be invoked already exist in the built virtual ECU-based test environment. Therefore, the controlled model to be invoked and the other function test case to be invoked do not need to be considered when the first test case is screened, which can greatly simplify the complexity of the first test case.

[0135] In some embodiments, when the automatic test of the first project function based on the first test case is performed, and the test result is obtained, in the virtual ECU-based test environment, the first test case execution file can be generated based on the first test case; then the first test case execution file is automatically run to obtain the test result.

[0136] Exemplarily, in some embodiments, the software testing device can process the excel-based test case (the first test case) by using the script, generate the test case execution file (the first test case execution file) based on the Robot Framework framework; then the generated first test case execution file can be automatically run by using the script, and finally the test result of the run test case execution file is output.

[0137] In some embodiments, the test result can be understood as the automatic running result of the first test case execution file, and can include but is not limited to one or more of the following: running conclusion, failure item record, etc. The running conclusion can be used to determine whether there is a failure item.

[0138] Exemplarily, in some embodiments, during the automatic test process, after each test case is run, the software testing device can backup the test result of each test case and record the test result of the previous running test case.

[0139] In the embodiments of the present application, Figure 2 The implementation process of the software testing method provided in the embodiments of the present application is shown in Figure 7 As shown in Figure 8 The software testing method can further include the following steps: Step 105, during the automatic running of the first test case execution file, the running log corresponding to the first test case is recorded and stored.

[0140] In some embodiments, during the automatic running of the first test case execution file, the software testing device can record and store the running log corresponding to the first test case. The running log corresponding to the first test case can be used for subsequent interruption protection processing.

[0141] Exemplarily, in some embodiments, during the automated testing process, the software testing device can record the test results of the executed test case execution files, and can record and store the running log (execution log) corresponding to the first test case. In the execution log (running log), the label of the test case execution file that is not executed can be "Fail"; the label of the test case execution file that is successfully executed can be "Success"; the label of the test case execution file that is failed to execute can be "Error", and the title of the test case execution file that is failed to execute can be recorded at the same time; and the label of the test case execution file that is interrupted can remain "Fail".

[0142] Step 106, in the case of interruption of the automated testing of the first project function, performing interruption protection processing based on the running log corresponding to the first test case.

[0143] In the embodiments of the present application, if the automated testing of the first project function is interrupted, the software testing device can perform interruption protection processing based on the running log corresponding to the first test case.

[0144] In some embodiments, interruption can be understood as the case that the automated testing in step S5 is interrupted before all the test case execution files are executed due to any reason.

[0145] In some embodiments, based on the recorded and stored running log, the software testing device can automatically resume the interruption of the test case.

[0146] Exemplarily, in some embodiments, after the interruption of the automated software interface testing system, based on the running log, the test case name of the last running and the test case execution file name can be obtained from the saved test case results of the last running; then, all the corresponding test cases can be reselected from the test case library according to the project number and the test requirements; all the test cases based on excel can be preprocessed by using the script, and the test case execution files based on the Robot Framework framework can be regenerated; then, all the newly generated test case execution files can be compared with the test case execution files recorded in the running log (execution log), the test case execution files that are not recorded can be added to the execution log, and the initial label "Fail" can be added; then, the "Fail" items in the execution log can be retested by using the script: whether the test case execution file of the last running is the current file, if yes, the test case of the last running is retested, otherwise, all the test cases need to be tested.

[0147] Exemplarily, in some embodiments, in the process of test case execution interruption protection, the software testing device can back up the result after each test case is run and record the result of the previous test case.

[0148] In some embodiments, based on the recorded and stored running log, the software testing device can also perform regression testing on the modified test case.

[0149] Exemplarily, in some embodiments, the software testing device can use a script to perform regression testing on the "Error" item in the running log (execution log): automatically test all the test cases that failed in the test recorded in the execution log.

[0150] Exemplarily, in some embodiments, as Figure 9 shown, in the process of test case interruption protection, it can be determined whether the interruption protection type is execution interruption or regression testing (step 801), if the interruption protection type is execution interruption, the test record of the previous execution interruption can be parsed to obtain the test case where the interruption occurred (step 802), then the Fail item in the test log that has not been tested is read (step 803), then it is determined whether the test interruption test case is located in the current Fail item file (step 804), if yes, the test is continued from the test interruption test case (step 805), otherwise, the test is continued from the first test case based on the current Fail item file (step 806). If the interruption protection type is regression testing, the test log can be parsed to obtain the test case execution file of the test ERROR item and the corresponding failed test case (step 807), then the modified test case is processed, the test case execution file based on the Robot Framework framework is regenerated (step 808), then the test case that failed in the test is selected from the newly generated test case execution file for retesting (step 809).

[0151] In the embodiments of the present application, after the software testing based on the project source code and the project function information is completed, the software testing device can generate a complete test report based on the corresponding test results of the first project function, and then output the complete test report.

[0152] Exemplarily, in some embodiments, the software testing device can merge the test results obtained in the execution process of the automatic test and the test results obtained after the interruption protection processing, and output the complete test results.

[0153] In the embodiments of the present application, after the software testing based on the project source code and the project function information is completed, the software testing device can also perform fault localization on the test case that failed in the execution, and output the fault localization.

[0154] Exemplarily, in some embodiments, the software testing device can output all test cases that fail the test, including: steps that fail the test, interface states, etc.

[0155] In embodiments of the present application, after completing the software testing based on the project source code and the project function information, the software testing device can also determine the release of the software code according to the complete test results.

[0156] Exemplarily, in some embodiments, if all test cases are executed successfully, the software code and the complete test results are released; if the test cases fail the test, the release of the software code is blocked and the complete test results are fed back.

[0157] In some embodiments, the complete test results can at least include one or more of the following: test result statistics of the test cases, test pass rate, execution log of each test case, failure steps and fault interface states of the test cases that fail the test, execution time of the test cases, etc.

[0158] In embodiments of the present application, Figure 3 An implementation flowchart of a software testing method provided by embodiments of the present application is shown in Figure 9 As shown in Figure 10 The software testing method can further include the following steps: Step 107, triggering test automation execution in the case of changes in the project source code.

[0159] Step 108, triggering test case automation execution in the case of changes in the test case library.

[0160] In embodiments of the present application, the software testing device also has the function of test engineering change identification, that is, the software testing device can identify changes in the test engineering and perform subsequent automation processing based on the identified changes.

[0161] In some embodiments, for the first time of submitting code (project source code) with new functions, the step of test engineering change identification does not need to be performed; after completing the software testing, based on the execution results of each time, partial adjustment of the submitted code or changes in the test cases can be performed, and the step of test engineering change identification can be performed.

[0162] In some embodiments, if the project source engineering (project source code) has new changes, test automation execution is triggered; if the test case library has new changes, test case automation execution is triggered.

[0163] Exemplarily, in some embodiments, a new change of a project source project (project source code) can be understood as a software repair, at this time, the function does not change, and therefore the test automation execution can be directly triggered; if the function changes or the (function) interface changes, the test case design needs to be performed first, the test case library is updated, and then the test case automation execution is triggered.

[0164] In some embodiments, in the process of performing software testing in the virtual ECU-based test environment, if a new change needs to be tested, the test case needs to be updated, at this time, for the controlled model that needs to be called and the other function test cases that need to be called in the virtual ECU-based test environment, only one update needs to be performed, and the controlled model and the other function test cases called in the subsequent retesting process are all updated, which can solve the problem of repeated time consumption caused by repeated update processing when the controlled model and the other function test cases are called each time.

[0165] As can be seen, in the embodiments of the present application, the virtual ECU-based test environment built based on the controlled model library and the public test keyword library is used as the test environment for subsequent software testing, which can reduce the complexity of the test case on the one hand, and solve the problem of low test efficiency caused by repeated update operations in the process of updating the test case on the other hand, and finally solve the technical problems of complex and tedious test flow and repeated time consumption in the test process.

[0166] The software testing method proposed in the embodiments of the present application, first, adopts the management mode of constructing a test case public library, and strictly adds, modifies and deletes the controlled model library, the public test keyword library, the function test case basic library and the function test case extension library through the use case tag, which effectively improves the maximum reuse degree of the test cases between different projects. Among them, according to the new function list, the test implementation mode is to design the controlled model to simulate the read-write interaction of the bottom hardware and the application layer software of the new added function, design the controlled model, and generate an executable file in FMU format, and add it to the controlled model library; before designing each test case of the new added function, based on the new added function and the source code, it is identified whether each test case of the new added function calls other function test cases as a precondition, if so, the called other function test cases are encapsulated into public test keywords, and added to the public test keyword library; based on the function definition file, the test case of the new added function is designed in a forward basis function, and a project tag is added to each basis test case, and added to the function test case basic library; based on the function definition file and the corresponding basis function test case, the extension test case of the new added function is designed, and a project tag is added to each extension test case, and added to the function test case extension library.

[0167] The software testing method provided in the embodiments of the present application, in the second aspect, in the automatic testing and interruption protection of the software interface, a backup and execution log management method is adopted to realize automatic filtering, identification, conversion, interruption processing and regression testing of test cases, efficiently prevent sudden situations from occurring in the testing process, and ensure complete, stable and automatic execution of the test cases. The test case execution files are automatically run to obtain the execution results of the test case execution files; the test case execution files with no execution or execution failure are interrupted and recovered, i.e., the test case name of the last execution and the test case execution file name are obtained from the test case results of the last execution saved; all corresponding test cases are re-filtered and obtained from the test case library according to the project number and the test requirements; all test cases are preprocessed to re-generate the test case execution files based on the Robot Framework framework; all newly generated test case execution files are compared with the test case execution files recorded in the execution log, the test case execution files not recorded are added to the execution log, and the initial label "Fail" is added; the "Fail" items in the execution log are automatically tested by using a script: it is judged whether the test case execution file of the last execution is the current file, if yes, the test case of the last execution recorded is tested again, otherwise, all test cases need to be tested; the test case execution files with execution errors are subjected to regression testing.

[0168] In summary, the automatic software interface testing system and method based on virtual ECU provided in the embodiments of the present application utilize the virtual ECU technology to complete the automatic in-the-loop testing of the automobile software, quickly intervene in the function and interface testing after the software program module development is completed, identify the system vulnerabilities and errors as early as possible, reduce the development time and cost, and solve the problem of how to realize agile development and rapid iteration under the rapid change of function requirements; in the test case management, the management method of the test case public library is adopted, the controlled model library, the public test keyword library, the function test case basic library and the function test case extension library are strictly added, modified and deleted through the test case label, and the maximum reuse degree of the test cases between different projects is effectively improved; in the automatic testing and interruption protection of the software interface, the backup and execution log management method is adopted to realize automatic filtering, identification, conversion, interruption processing and regression testing of test cases, efficiently prevent sudden situations from occurring in the testing process, and ensure complete, stable and automatic execution of the test cases. The system and method are more intelligent than the prior art, can effectively reduce the development time and testing cost of the automobile software, avoid frequent repeated design and writing of the test cases, meet the demand for stable and automatic testing, and greatly optimize the overall process of the software in-the-loop testing.

[0169] The embodiment of the application provides a software testing method, acquires project source code, a software interface table, testing requirements and project function information; based on the project source code, the software interface table and the project function information, a test case library is constructed; wherein the test case library comprises at least one or more of the following: a controlled model library, a public test keyword library, a function test case basic library and a function test case extension library; based on the project source code, the testing requirements, the project function information and the test case library, a virtual ECU-based test environment is constructed; in the virtual ECU-based test environment, based on the test case library and the testing requirements of a first project function, a first test case of the first project function is determined, and based on the first test case, automatic testing of the first project function is performed to obtain a test result; wherein the first project function is a project function to be tested. It can be seen that in the embodiment of the application, the construction of the test case library can be performed, wherein the test case library can comprise the controlled model library, the public test keyword library, the function test case basic library and the function test case extension library constructed based on the project source code, the software interface table and the project function information, wherein the controlled model library and the public test keyword library can be used for the establishment of the virtual ECU-based test environment, and the function test case basic library and the function test case extension library can be used for the screening of test cases, so that in the subsequent software testing process, the complexity of the screened test cases is reduced through the established virtual ECU-based test environment, and the automatic testing of various project functions can be performed by using the constructed test case library in combination with the testing requirements. That is, the scheme provided in the embodiment of the application can reduce the testing complexity, reduce the testing time consumption and greatly improve the efficiency and effect of software testing.

[0170] Based on the above embodiment, another embodiment of the application provides a software testing method, comprising an automatic software interface testing system and method based on a virtual ECU, which is an automatic software interface testing mechanism that is efficient and reliable, easy to operate and stable in operation. All steps in the testing process are concentrated together, agile development and rapid iteration can be realized under rapid change of function requirements, the reuse of test cases between different projects is solved, testing interruption caused by external reasons is avoided, automatic testing of software interfaces is realized, and the overall process of software-in-the-loop testing is greatly optimized.

[0171] In order to realize efficient and reliable software testing functions, the following problems need to be considered: 1. How to realize agile development and rapid iteration under rapid change of function requirements, so as to perform software verification as early as possible and discover and correct important errors in the code; 2. How to efficiently manage test cases to realize maximum reuse of test cases between different projects; 3. How to stably perform automatic testing of software interfaces and interruption protection.

[0172] To solve the problems of how to realize agile development and rapid iteration under rapid change of functional requirements, how to efficiently manage test cases to realize maximum reuse of test cases between different projects, and how to stably perform automatic testing and interruption protection of software interfaces, embodiments of the present application provide a virtual ECU-based automatic software interface testing system and method, as shown in Figure 3 The macro architecture of the test system 1000 proposed in the embodiments of the present application mainly includes a project source engineering submission module 1001, a test case library construction module 1002, a test engineering change identification module 1003, a virtual ECU-based test environment building module 1004, a test case automatic execution module 1005, a test case execution interruption protection module 1006, a test result output and fault positioning module 1007, a software code and test result release module 1008, and the like.

[0173] In some embodiments, the project source engineering submission module can be used for a developer to submit a project source engineering after completing development of automotive software. The submission of the project source engineering can include the following steps: S11, obtaining project source code (master model), project function list, function definition file, software interface table, and configuration word; the project function list includes function names; the function definition file is a file describing functions in detail; the software interface table is a software interface used to realize functions and mapping connection; and the configuration word is different, and the realized functions are different.

[0174] S12, obtaining a test admission specification.

[0175] Further, in S12, the test admission specification mainly includes test scope and test requirements, and then a tester needs to audit the test admission specification, feed back parts of the admission requirements that are not clear or missing, and require the developer to supplement them.

[0176] For example, in some embodiments, the test admission specification can include a function A required to be tested.

[0177] In some embodiments, the test case library construction module can be used for designing test cases according to the submission files of the project source engineering submission module. The design of the test cases can include the following steps: S21, obtaining project source code, added function list, function definition file, software interface table, and configuration word according to the test admission specification; S22, identifying the scope of each added function according to the added function list, and confirming whether the function belongs to a platform function (all projects) or a single project unique function; S23, according to the newly added function list and source code engineering, the test implementation mode of each newly added function is identified, and it is confirmed whether the function can be directly tested through the software interface, or the controlled model needs to be designed to simulate the read-write interaction between the underlying hardware and the application layer software; S24, a controlled model is designed and an executable file in the function model unit (FMU) format is generated, and the controlled model library is added; wherein the FMU executable file of the controlled model is a function model unit of a single model generated based on the function model interface (FMI) standard.

[0178] S25, before designing the test case for each newly added function, it is identified based on the newly added function and the source code whether the test case of each newly added function has a calling other function test case as a precondition, if so, it is encapsulated into a public test keyword and added to the public test keyword library; wherein the public test keyword is used for direct calling of other test cases, facilitating management and simplifying subsequent modification operations.

[0179] S26, based on excel, the test cases are designed for the basic functions in the positive direction, and the project tags are added to each basic test case, and added to the basic function test case library, for example Figure 4 The first two test cases in Table 1, and the first two test cases in Table 1; S27, based on excel, the extended test cases are designed by comparing the function definition file and the corresponding basic function test cases, and the project tags are added to each extended test case, and added to the extended function test case library, for example Figure 2 The first five test cases in Table 1, and the last five test cases in Table 1; In S26, the test cases are designed based on excel, the main function is to provide convenience for the management and identification of test cases, and necessary explanatory words can be added in the excel file to facilitate the identification and understanding of test cases; in addition, the tags added to each test case in the excel source file are derived from the identification results in S22, if the function is a platform function, the test case tag is "PLATFORMIZATION", if the function is a project unique function, the test case tag is "project X", wherein "project X" is the project code, if the function is shared by multiple projects, the test case tag is "project X1, project X2", wherein "project X1" and "project X2" are project codes; In S27, the extended test cases mainly include reverse cases, boundary condition cases, state switching cases, etc., and the tags of the extended test cases should be consistent with the tags of the basic test cases.

[0180] wherein the macroscopic architecture diagram of the test case library is as followsFigure 5 As shown, it mainly includes the controlled model library, the public test keyword library, the functional test case basic library, and the functional test case extension library; among them, the controlled model library and the public test keyword library are distinguished by function labels, and the functional test case basic library and the functional test case extension library are distinguished by project labels.

[0181] Among them, the design and implementation of basic test cases and extended test cases are as follows Figure 11 As shown in Table 1, the basic test cases are forward test cases of the functions, and the extended test cases include reverse test cases, state switching, etc. Among them, the reverse test cases need to set a certain prerequisite (for example, input different pre-set conditions, including but not limited to one or more of condition 1, condition 2, condition 3, condition 4, etc.) and perform output detection after it is not met. The state switching requires that after the forward test case is executed normally, a certain trigger condition is set to perform output detection after it changes. Finally, the test result is further determined based on the output result (for example, output result 1, output result 2, etc.).

[0182] In some embodiments, a test project change identification module can be used to identify changes to the test project. For the first submission of code with new functionality, the change identification step does not need to be performed. Subsequently, based on the results of each execution, if partial adjustments are made to the submitted code or test case changes occur, the change identification step needs to be performed.

[0183] Identifying changes to a test project can include the following steps: S31. If there is a new change in the project source project, the test automation execution is triggered; S32. If new changes occur in the test case library, the test case automatic execution is triggered.

[0184] Furthermore, in S31 / S32, if the new change in the project source engineering is a software repair and the function has not changed, the test automation execution is directly triggered; if the function has changed or the (functional) interface has changed, it is necessary to first design the test case, update the test case library, and then trigger the test case automation execution.

[0185] In some embodiments, a test environment building module based on a virtual ECU can be used to build a test environment based on a virtual ECU. Building a test environment based on a virtual ECU can include the following steps: S41. Obtain project source code required for building a virtual ECU in the project source project. The project source code to be obtained includes: C code source files, C code header files, ARXML files, task scheduling timing, etc. S42, preprocessing the project source code using the script, and initializing the interface corresponding to at least the configuration word pair to simulate the initial value writing of the underlying layer; S43, generating an executable file in FMU format based on the project source code; the virtual ECU must use this format file for construction.

[0186] S44, according to the first function that needs to be implemented through the controlled model in the project function list, filtering and obtaining the FMU file corresponding to the controlled model (the controlled model corresponding to the first function) in the controlled model library in the test case library; S45, based on the FMU file of the project source project and the FMU file of the controlled model, building a test environment based on the virtual ECU.

[0187] In some embodiments, the automatic execution module of the test case can be used to automatically execute the test case. The automatic execution of the test case can include the following steps: S51, according to the project number of the project function to be tested and the test requirement of the project function to be tested, filtering and obtaining the corresponding test case in the test case library, for example, if the test requirement is full-amount test, all test cases with the "PLATFORMIZATION" label and the project number label need to be filtered out in the function test case basic library and the function test case extended library; if the test requirement is incremental test, the test cases to be filtered include: all newly added test cases, all test cases with the "PLATFORMIZATION" label and the project number label in the function test case basic library, and all test cases related to the newly added test cases in the function test case extended library; wherein, the related test cases in the function test case extended library are filtered by using a script to filter Chinese keywords; S52, processing the test case based on excel by using a script to generate a test case execution file based on the Robot Framework framework; S53, automatically running the generated test case execution file by using a script; S54, recording the test results of the running test case execution file during the automatic test process, and outputting the execution log, wherein the running result record includes the running conclusion (whether there is a failed item) and the record of the failed item; in the execution log, the label of the test case execution file that has not been run is "Fail"; the label of the test case execution file that has been successfully run is "Success"; the label of the test case execution file that has failed to run is "Error" and the title of the test case that has failed to run is recorded at the same time; the label of the test case execution file that has been interrupted remains "Fail"; S55, in the automated test process, the result of each test case run is backed up, and the test case result of the previous run is recorded. Interrupted In some embodiments, the test case execution interruption protection module can be used to recover the test case automation execution interruption and perform regression testing after test case modification. Recovering the test case automation execution interruption and performing regression testing after test case modification can include the following steps: S61, after the interruption of the automated software interface test system, first, from the saved test case results of the previous run, get the test case name of the last run and the test case execution file name; S62, according to the project number and test requirements, all corresponding test cases are obtained by re-screening in the test case library; S63, all test cases based on excel are preprocessed by using scripts, and test case execution files based on RobotFramework framework are regenerated; S64, compare all newly generated test case execution files with test case execution files recorded in the execution log, add test case execution files not recorded to the execution log, and add the initial label "Fail"; S65, use scripts to automatically test the "Fail" items in the execution log: determine whether the test case execution file of the last run is the current file, if yes, start testing from the recorded last test case, otherwise, all test cases need to be tested; S66, use scripts to perform regression testing on "Error" items in the execution log: automatically test all test cases that failed in the execution log; S67, in the test case execution interruption protection process, the result of each test case run is backed up, and the test case result of the previous run is recorded.

[0188] Further, in S61, the test case execution interruption protection module can handle interruptions including any reason causing the automated test in S5 to be interrupted before all test case execution files are run, the processing method corresponds to S62-S65; regression testing after test case execution failure, the processing method corresponds to S66.

[0189] In some embodiments, the test result output and fault location module can be used to output complete test reports and locate faults in test cases that fail to execute. Outputting complete test reports and locating faults in test cases that fail to execute can include the following steps: S71, merging the test results backed up in the automatic execution module of the test case and the test case execution interruption protection module, and outputting complete test results; S72, outputting all test cases that fail, including steps that fail, interface states, etc.

[0190] In some embodiments, the software code and test result release module can be used to determine the release of the software code according to the test results. The determination of the release of the software code according to the test results can include the following steps: S81, if all test cases are executed successfully, releasing the software code and the test results; S82, if the test cases fail, blocking the release of the software code and feeding back the test results.

[0191] Further, in S81 and S82, the test results include test result statistics of the test cases, test pass rates, execution logs of each test case, failure steps and fault interface states of test cases that fail to run, execution times of the test cases, etc.

[0192] In summary, the application embodiment provides an automatic software interface test system and method based on virtual ECU, which uses virtual ECU technology to complete the automatic in-loop test of automobile software. After the software program module is developed, the function and interface test is completed quickly, the system vulnerabilities and errors are identified as early as possible, the development time and cost are reduced, and the problem of how to realize agile development and rapid iteration under the rapid change of functional requirements is solved. In terms of test case management, the management method of the test case public library is adopted, the controlled model library, the public test keyword library, the functional test case basic library and the functional test case extension library are strictly added, modified and deleted through the use case label, and the maximum reuse degree of test cases between different projects is effectively improved. In terms of automatic testing and interruption protection of software interface, the backup and execution log management method is adopted, the test case automatic screening, identification, conversion, interruption processing and regression test are realized, the sudden situation occurring in the test process can be efficiently prevented, and the complete, stable and automatic execution of the test case is ensured. Compared with the prior art, the system and method are more intelligent, can effectively reduce the development time and test cost of automobile software, avoid frequent repeated design and writing of test cases, meet the demand of stable automatic test, and greatly optimize the overall process of software in-loop test.

[0193] The embodiment of the present application provides a software testing method, which can construct a test case library, wherein the test case library can include a controlled model library, a public test keyword library, a function test case basic library and a function test case extension library which are constructed based on project source code, a software interface table and project function information, wherein the controlled model library and the public test keyword library can be used for building a virtual ECU-based test environment, and the function test case basic library and the function test case extension library can be used for test case screening, so that in the subsequent software testing process, the complexity of the screened test cases is reduced through the built virtual ECU-based test environment, and the constructed test case library can be used to realize the operation of automatic testing of various project functions in combination with test requirements. That is, the scheme provided in the embodiment of the present application can reduce the test complexity, reduce the test time consumption, and greatly improve the efficiency and effect of software testing.

[0194] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the purpose and scope of the technical solutions of the present application, and they should be covered in the protection scope of the present application.

[0195] It should be noted that although the steps of the method in the present application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. In addition or alternatively, some steps can be omitted, a plurality of steps can be combined into one step, and / or one step can be divided into a plurality of steps, etc.; or the steps in different embodiments can be combined into a new technical solution. Based on the foregoing embodiments, the embodiments of the present application provide a device including the modules included therein and the units included in the modules, which can be realized by a processor; of course, it can also be realized by a specific logic circuit; in the implementation process, the processor can be an AI acceleration engine (such as NPU), a graphics processing unit (GPU), a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0196] Figure 11 A schematic diagram of a software testing device provided by the embodiment of the present application is shown in FIG. 11. Figure 12 As shown in FIG. 11, the software testing device 1100 includes an acquisition unit 1101, a construction unit 1102, a determination unit 1103 and a testing unit 1104; wherein, The acquisition unit 1101 is configured to acquire project source code, a software interface table, test requirements and project function information. The construction unit 1102 is configured to construct a test case library based on the project source code, the software interface table and the project function information, wherein the test case library comprises at least one or more of the following: a controlled model library, a public test keyword library, a function test case basic library and a function test case extension library. The construction unit 1102 is further configured to construct a virtual ECU-based test environment based on the project source code, the test requirement, the project function information and the test case library. The determination unit 1103 is configured to determine a first test case of a first project function based on the test case library and a test requirement of the first project function in the virtual ECU-based test environment, wherein the first project function is a project function to be tested. The test unit 1104 is configured to perform an automatic test on the first project function based on the first test case, and obtain a test result.

[0197] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the descriptions of the method embodiments of the present application.

[0198] It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical function division. In actual implementation, another division mode can be used. In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or can be physically separated, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of a software functional unit. It can also be realized in the form of a combination of software and hardware.

[0199] It should be noted that, in the embodiments of the present application, if the above method is realized in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a vehicle to execute all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various program code storage media. Thus, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0200] The embodiments of the present application provide an electronic device, Figure 12 A structural schematic diagram of the electronic device provided by the embodiments of the present application is shown in ​As shown, the electronic device 1200 includes a memory 1201 storing a computer program executable on a processor 1202, and the processor 1202 implements the steps in the methods provided in the above embodiments when executing the program.

[0201] It should be noted that the memory 1201 is configured to store instructions and applications executable by the processor 1202, and can also buffer data (for example, image data, audio data, voice communication data and video communication data) to be processed or having been processed by the processor 1202 and each module in the electronic device 1200, which can be implemented by FLASH or Random Access Memory (RAM).

[0202] In some embodiments, the electronic device includes a cloud server or a vehicle.

[0203] The embodiments of the present application provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps in the methods provided in the above embodiments.

[0204] The embodiments of the present application provide a computer program product containing instructions, which, when run on a computer, causes the computer to perform the steps in the methods provided in the above method embodiments.

[0205] It should be noted that the descriptions of the above storage medium and vehicle embodiments are similar to the descriptions of the above method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the storage medium and vehicle embodiments of the present application, please refer to the descriptions of the method embodiments of the present application.

[0206] It should be understood that the "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" or "in some embodiments" appearing throughout the specification does not necessarily mean the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of each process does not mean the execution order, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The serial number of the above embodiments of the present application is only for description, not representing the advantages and disadvantages of the embodiments. The above description of each embodiment tends to emphasize the differences between each embodiment, and the same or similar parts can be referred to each other. For the sake of brevity, this paper will not repeat here.

[0207] The term "and / or", merely describes an associated relationship, which means that there can be three relationships, for example, object A and / or object B, which can represent: object A alone, object A and object B together, and object B alone.

[0208] It should be noted that the terms "comprising", "including", or any other variant thereof, are intended to cover a non-exclusive inclusion, such that processes, methods, articles, or devices that comprise a list of elements not only include those elements, but also include other elements not expressly listed or inherent to such processes, methods, articles, or devices. Without more limitations, an element defined by the statement "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or device including the element.

[0209] In several embodiments provided in the present application, it should be understood that the disclosed vehicle and method can be implemented in other ways. The above-described embodiments are only illustrative, for example, the division of the modules is only a logical functional division, and actual implementation can have another division manner, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each component part shown or discussed can be through some interface, indirect coupling or communication connection between vehicles or modules can be electrical, mechanical or other forms.

[0210] The above-described modules described as separate components can be or can not be physically separated, and the components shown as modules can be or can not be physical modules; they can be located in one place or distributed on multiple network units; some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment.

[0211] In addition, each functional module in each embodiment of the present application can be integrated in one processing unit, or each module can be a separate unit, or two or more modules can be integrated in one unit; the above integrated modules can be realized in the form of hardware or hardware plus software functional units.

[0212] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, and the foregoing program can be stored in a computer readable storage medium, and the program performs the steps of the above-mentioned method embodiments when executed; and the foregoing storage medium includes a mobile storage device, a read only memory (ROM), a magnetic disc or an optical disc and various storage medium capable of storing program codes.

[0213] Alternatively, the integrated units of the present application can be stored in a computer readable storage medium if they are realized in the form of software function modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software product, and the computer software product is stored in a storage medium, and includes several instructions to make the vehicle execute all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes a mobile storage device, a ROM, a magnetic disc or an optical disc and various storage medium capable of storing program codes.

[0214] The methods disclosed in the several method embodiments provided by the present application can be combined arbitrarily without conflict to obtain new method embodiments.

[0215] The features disclosed in the several product embodiments provided by the present application can be combined arbitrarily without conflict to obtain new product embodiments.

[0216] The features disclosed in the several method or vehicle embodiments provided by the present application can be combined arbitrarily without conflict to obtain new method embodiments or vehicle embodiments.

[0217] The above is only the implementation of the present application, but the protection scope of the present application is not limited to this, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application.

Claims

1. A software testing method, characterized in that: The method comprises: Obtain project source code, software interface table, test requirements and project function information; Based on the project source code, the software interface table and the project function information, a test case library is constructed; wherein the test case library includes at least one or more of the following: a controlled model library, a common test keyword library, a functional test case basic library, and a functional test case extension library; Building a test environment based on a virtual electronic control unit ECU based on the project source code, the test requirements, the project function information and the test case library; In the virtual ECU-based test environment, based on the test case library and the test requirements of the first project function, a first test case of the first project function is determined, and an automated test of the first project function is performed based on the first test case to obtain a test result; wherein, the first project function is the project function to be tested.

2. The method according to claim 1, characterized in that The step of constructing a test case library based on the project source code, the software interface table, and the project function information includes: Determining new project functions based on the project source code, the software interface table, and the project function information, and determining a test method for the new project functions; When the test mode of the newly added project function is the preset mode, designing a controlled model and an executable file of the controlled model; The controlled model and the executable file of the controlled model are added to the controlled model library.

3. The method according to claim 1, characterized in that The step of constructing a test case library based on the project source code, the software interface table, and the project function information includes: Determining newly added project functions based on the project source code, the software interface table, and the project function information; In the case where it is determined that the newly added project function has a second test case that calls it, generating keyword information corresponding to the newly added project function based on the second test case; The keyword information is added to the public test keyword library.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Determining newly added project functions based on the project source code, the software interface table, and the project function information; Perform project scope identification on the newly added project function and determine the identification result of the newly added project function.

5. The method according to claim 4, characterized in that The step of constructing a test case library based on the project source code, the software interface table, and the project function information includes: Performing basic design of test cases for the newly added project functions based on the function definition file included in the project function information to obtain basic test cases for the newly added project functions; Determining, based on the identification result of the newly added project function, a project label of a basic test case of the newly added project function; Add the basic test cases of the newly added project functions and the project tags to the functional test case basic library.

6. The method according to claim 5, characterized in that The step of constructing a test case library based on the project source code, the software interface table, and the project function information includes: Based on the function definition file included in the project function information and the basic test case of the newly added project function, perform extended test case design for the newly added project function to obtain extended test case for the newly added project function; Add the extended test case of the newly added project function and the project tag to the functional test case extension library.

7. The method according to any one of claims 1-3, 5, and 6, characterized in that: The step of constructing a virtual ECU-based test environment based on the project source code, the test requirements, the project function information, and the test case library includes: Generate an executable file of the master control model based on the project source code; Obtaining a controlled model of the second project function and an executable file of the controlled model of the second project function from the controlled model library; wherein the second project function is the project function to be tested indicated by the test requirement; The virtual ECU-based test environment is constructed based on the executable file of the master control model and the executable file of the controlled model of the second project function.

8. The method according to any one of claims 1-3, 5, and 6, characterized in that: The determining, based on the test case library and the test requirements of the first project function, a first test case for the first project function includes: For the first project function to be tested, determining the project number of the first project function; Based on the project number and the test requirement of the first project function, the first test case is determined in the test case library.

9. The method according to claim 8, characterized in that The performing of automated testing on the first project function based on the first test case to obtain a test result includes: In the virtual ECU-based test environment, generating a first test case execution file based on the first test case; Automatically run the first test case execution file to obtain the test result.

10. The method according to claim 9, characterized in that The method further comprises: During the automatic running of the first test case execution file, recording and storing a running log corresponding to the first test case; Accordingly, the method further comprises: In the event that the automated test of the first project function is interrupted, interruption protection processing is performed based on the running log corresponding to the first test case.

11. A software testing device, characterized in that: The software testing device comprises: Acquisition unit, used to obtain project source code, software interface table, test requirements and project function information; A construction unit is configured to construct a test case library based on the project source code, the software interface table, and the project function information; wherein the test case library includes at least one or more of the following: a controlled model library, a common test keyword library, a functional test case basic library, and a functional test case extension library; The construction unit is further configured to construct a test environment based on the virtual ECU based on the project source code, the test requirements, the project function information, and the test case library; a determining unit, configured to determine, in the virtual ECU-based test environment, a first test case for the first project function based on the test case library and a test requirement of the first project function; wherein the first project function is a project function to be tested; The testing unit is used to perform automated testing on the first project function based on the first test case to obtain a test result.

12. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 10 is implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

14. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Automatic testing method for power supply partition software

    CN112699030A

  • Vehicle testing method and device

    CN114062806A

  • Automatic test system and method, electronic equipment and storage medium

    CN115576817A

  • Test case generator and user interface

    US20210248057A1

  • Test case generation method and apparatus, test management method and system, and storage medium

    WO2025098159A1