Test method and test device for vehicle, and computer readable storage medium
By managing multiple test objects and test case warehouses, and dynamically allocating test cases with static priority and attribute dependency algorithms, the problem of inefficiency in testing a single test object is solved, and rapid verification and efficient testing are achieved.
Patent Information
- Application Number
- CN202410998747.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-11-08
AI Technical Summary
In the prior art, vehicle testing methods based on a single object to be tested cannot be quickly verified and solved, resulting in inefficient testing.
By managing multiple test objects and test case warehouses, creating tasks according to test needs, associating test objects and test cases, and adopting preset allocation strategies, such as static priority algorithms and attribute dependency algorithms, dynamically allocating test cases to adapt to different Test scenarios to improve testing efficiency and accuracy.
It realizes that the test tasks are completed through multiple objects under test, speed up the test progress, improve the test efficiency and result reliability, adapt to diverse test requirements, and reduce the wait time and errors of test cases execution.
Smart Images

Figure CN118916283A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle testing, and in particular to a vehicle testing method and testing device, and a computer-readable storage medium. Background Art
[0002] Vehicle testing is an important part of ensuring vehicle performance and safety. Traditional vehicle testing methods often require a lot of manpower and material resources, and also have problems such as high time consumption, unstable test results, and insufficient test coverage.
[0003] In the related art, an automated testing method for vehicles is disclosed. Based on a single machine, the vehicle testing work is converted into a test based on an automated test script to achieve automatic traversal of test cases.
[0004] In the process of implementing the above solution, the following problems arise: In test scenarios that require testing a large number of use cases, a single object under test cannot be quickly verified or problem-solved, resulting in low test efficiency. Summary of the invention
[0005] One of the purposes of the present invention is to provide a testing method for a vehicle to solve the problem in the prior art that it is based on a single object to be tested and cannot quickly verify or solve problems, resulting in low testing efficiency; a second purpose is to provide a testing device for a vehicle; and a third purpose is to provide a computer-readable storage medium.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] A vehicle testing method includes: managing multiple tested objects and test case warehouses; creating test tasks according to test requirements; associating tested objects and test cases according to the test tasks; and allocating test cases to be executed to multiple tested objects according to a preset allocation strategy, so that the multiple tested objects execute corresponding test cases.
[0008] According to the above technical means, multiple objects under test and a test case warehouse including multiple test cases are managed simultaneously through a background server. After the test task is created, one or more objects under test required for the test task are associated with one or more test cases required. In this way, the test task can be completed through multiple objects under test, thereby speeding up the test progress. Furthermore, in order to further improve the test efficiency, multiple test cases are allocated according to a preset allocation strategy to achieve dynamic allocation of test cases according to the test task, thereby being able to adapt to different test scenarios and meet diverse test needs.
[0009] Furthermore, the preset allocation strategy includes a static priority algorithm strategy. According to the preset allocation strategy, the step of allocating test cases to be executed for multiple objects under test includes: prioritizing multiple test cases associated with the test task according to the static priority algorithm strategy; allocating the test cases to the test object that sends a request to execute the test case in turn according to the priority sorting, and binding the test cases with the test objects.
[0010] According to the above technical means, according to the test requirements of the test task, a static priority algorithm strategy for the test case execution order is given. And the priority is sorted from high to low, and the test objects that send the case execution request are assigned in turn to execute the case test. In this way, key functions and main requirements can be fully tested, thereby improving the reliability of the test results.
[0011] Furthermore, the preset allocation strategy includes an attribute-dependent algorithm strategy. According to the preset allocation strategy, the step of allocating test cases to be executed for multiple objects under test includes: analyzing the types of multiple controllers corresponding to the multiple objects under test; grouping the multiple test cases according to the types of dependent controllers, to obtain multiple groups of test cases corresponding one-to-one to the multiple objects under test.
[0012] According to the above technical means, the test cases are grouped through the dependency relationship between the controller and the test cases, so that the controller and the test cases can be matched, thereby improving the accuracy and efficiency of the test.
[0013] Furthermore, the preset allocation strategy also includes a static priority algorithm strategy. According to the preset allocation strategy, the step of allocating test cases to be executed to multiple objects under test also includes: prioritizing each group of test cases according to the static priority algorithm strategy; and allocating the test cases to the objects under test in order of priority.
[0014] According to the above technical means, after the test cases and controllers are matched and grouped by the attribute dependency algorithm strategy, the multiple test cases in each group are further prioritized according to the static priority algorithm strategy. Then, the test cases are assigned to the objects under test in turn according to the priority ranking to perform the test case tests. By combining the priority ranking and the controller type matching, the waiting time for the test case execution is reduced and the test efficiency is improved.
[0015] Furthermore, before the step of allocating test cases to be executed to multiple tested objects according to a preset allocation strategy, the testing method also includes: performing initialization operations on the multiple tested objects respectively; after the initialization operation is successful, the tested object sends a request to execute the test case.
[0016] According to the above technical means, the object under test is initialized before executing the test case test, so that the test environment of the object under test remains consistent, thereby eliminating the impact of test environment differences on the test results. In addition, after the initialization operation is successful, a request to execute the test case is sent to complete the correct configuration before the test starts, reduce errors during the test process, and thus improve the efficiency of subsequent tests.
[0017] Furthermore, the steps of respectively initializing the multiple objects under test include: building a test environment based on the objects under test according to the test tasks; calling the script files of the test cases and downloading the test tools; and obtaining the tested software versions corresponding to the test tasks.
[0018] According to the above technical means, by completing the construction of the test environment, preparing the script files of the test cases, downloading the required test tools in advance, and obtaining the required version of the tested software before testing, the test preparation work can be made for the subsequent test steps, thereby improving the efficiency of the subsequent test process.
[0019] Furthermore, the steps of executing corresponding test cases for multiple objects under test include: calling the script files corresponding to the test cases to be executed in sequence, and executing the test cases; after successful execution, reporting the execution results and unbinding from the executed test cases; in case of execution failure, unbinding from the executed test cases and replacing the objects under test.
[0020] According to the above technical means, the object under test calls the corresponding script file of the test case and executes the case test. After each test case is successfully executed, the binding is released and the test of the next test case is looped until all the associated test cases are completed. In the case of failure of the test case execution, a new object under test is replaced for retesting to avoid error reporting and improve the flexibility and adaptability of the test process. In addition, by reporting the execution results, the execution status of each test case can be tracked and recorded.
[0021] A testing device for a vehicle comprises: a management unit for managing a plurality of tested objects and a test case warehouse; a creation unit for creating a test task according to a test requirement; an association unit for associating a tested object with a test case according to a test task; and an execution unit for allocating test cases to be executed to a plurality of tested objects according to a preset allocation strategy, so that the plurality of tested objects execute corresponding test cases.
[0022] A testing device for a vehicle comprises a processor and a memory storing program instructions, wherein the processor is configured to execute a testing method for a vehicle as described in any of the above technical solutions when running the program instructions.
[0023] A computer-readable storage medium stores program instructions, which, when executed, are used to cause a computer to execute a vehicle testing method as described in any of the above technical solutions.
[0024] Beneficial effects of the present invention:
[0025] (1) A backend server is used to simultaneously manage multiple objects under test and a test case repository including multiple test cases. After the test task is created, one or more objects under test required by the test task are associated with one or more test cases required, so that the test task can be completed through multiple objects under test, thereby speeding up the test progress.
[0026] (2) Multiple test cases are allocated according to a preset allocation strategy to achieve dynamic allocation of test cases according to test tasks, thereby being able to adapt to different test scenarios, meet diverse test requirements, and further improve test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic flow chart of a vehicle testing method provided by one embodiment of the present invention;
[0028] Figure 2 A schematic flow chart of a vehicle testing method provided by yet another embodiment of the present invention;
[0029] Figure 3 A schematic flow chart of a vehicle testing method provided by yet another embodiment of the present invention;
[0030] Figure 4 A schematic flow chart of a vehicle testing method provided by yet another embodiment of the present invention;
[0031] Figure 5 A network framework diagram for vehicle testing provided by an embodiment of the present invention;
[0032] Figure 6 A schematic flow chart of a vehicle testing method provided by yet another embodiment of the present invention;
[0033] Figure 7 A schematic diagram of a static priority algorithm strategy provided for an embodiment of the present invention;
[0034] Figure 8 A schematic flow chart of a vehicle testing method provided by yet another embodiment of the present invention;
[0035] Fig. 9 A schematic diagram of an attribute-dependent algorithm strategy provided for one embodiment of the present invention;
[0036] Fig.10 A schematic block diagram of a vehicle testing device provided by one embodiment of the present invention;
[0037] Fig.11 A schematic structural diagram of a vehicle testing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0039] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0040] Combination Figure 1 As shown, in some embodiments, a testing method for a vehicle is provided, comprising:
[0041] S101, managing multiple objects under test and test case repositories.
[0042] S102: Create a test task according to the test requirements.
[0043] S103, associating the tested object and the test case according to the test task.
[0044] S104: Allocate test cases to be executed to the multiple tested objects according to a preset allocation strategy, so that the multiple tested objects execute corresponding test cases.
[0045] According to the above embodiment, multiple objects under test and a test case warehouse including multiple test cases are managed simultaneously by a background server. After the test task is created, one or more objects under test required by the test task are associated with one or more test cases required. In this way, the test task can be completed by multiple objects under test, thereby speeding up the test progress. Furthermore, in order to further improve the test efficiency, multiple test cases are allocated according to a preset allocation strategy to achieve dynamic allocation of test cases according to the test task, thereby being able to adapt to different test scenarios and meet diverse test needs.
[0046] Combination Figure 2 As shown, in some embodiments, a testing method for a vehicle is provided, comprising:
[0047] S201, managing multiple objects under test and test case repositories.
[0048] S202: Create a test task according to the test requirements.
[0049] S203: Associating the tested object and the test case according to the test task.
[0050] One or more tested objects required for the test task are associated with one or more required test cases, so that the test task can be completed through multiple tested objects, thereby speeding up the test progress.
[0051] S204, prioritizing multiple test cases associated with the test task according to a static priority algorithm strategy, wherein the preset allocation strategy includes a static priority algorithm strategy.
[0052] S205, assigning the test cases to the test objects that sent the request to execute the test cases in sequence according to the priority.
[0053] S206, binding the test case with the test object, so that multiple tested objects can execute the corresponding test case.
[0054] According to the above embodiment, according to the test requirements of the test task, a static priority algorithm strategy for the test case execution order is given. And the priority is sorted from high to low, and the test objects that send the case execution request are assigned in sequence to execute the case test. In this way, the clear priority sorting makes the test plan more orderly, easy to execute and monitor. In addition, key functions and main requirements can be fully tested, thereby improving the reliability of the test results.
[0055] In one example, the static priority algorithm strategy is to sort the test tasks according to the importance of the functions they correspond to. That is, high-priority use cases usually correspond to key functions, and prioritizing execution can speed up the discovery of potential problems, thereby speeding up the entire test progress.
[0056] In one example, prioritization allows the test plan to be quickly adjusted when test requirements change, ensuring that changes are verified in a timely manner.
[0057] Combination Figure 3 As shown, in some embodiments, a testing method for a vehicle is provided, comprising:
[0058] S301, managing multiple objects under test and test case repositories.
[0059] S302: Create a test task according to the test requirements.
[0060] S303: Associating the tested object and the test case according to the test task.
[0061] One or more objects under test required by the test task are associated with one or more test cases required. In this way, the test task can be completed through multiple objects under test, thereby speeding up the test progress.
[0062] S304, analyzing types of multiple controllers corresponding to multiple measured objects.
[0063] S305 , according to the attribute dependency algorithm strategy, multiple test cases are grouped according to the types of dependent controllers to obtain multiple groups of test cases corresponding to the multiple tested objects.
[0064] According to the above embodiment, by analyzing the controller type of the object under test, it is ensured that the test case accurately matches the functional characteristics and requirements of the object under test. The grouping strategy enables the test case to be optimized for a specific type of controller, improves the pertinence and effectiveness of the test, and helps to more reasonably allocate test resources, including but not limited to hardware and software. In addition, after the test cases are grouped, the test can be performed on multiple objects under test at the same time, supporting parallel testing, thereby improving the test efficiency. Through the dependency between the controller and the test case, the test case is grouped so that the controller and the test case can be matched, thereby improving the accuracy and efficiency of the test. In addition, through the accurate matching of the controller and the test case, the waste of resources is reduced, thereby reducing the test cost.
[0065] S306, prioritize each group of test cases according to the static priority algorithm strategy.
[0066] S307, assigning the test cases to the tested object in order of priority.
[0067] According to the above embodiment, after the test cases are matched and grouped with the controllers through the attribute-dependent algorithm strategy, the multiple test cases in each group are further prioritized according to the static priority algorithm strategy. Then, the test cases are assigned to the objects under test in turn according to the priority ranking to perform the test case tests. By analyzing the controller type for grouping, it is ensured that the test cases are accurately matched with the functional characteristics of the objects under test, and the comprehensive coverage of test cases of different controller types is improved. Furthermore, the priority ranking of the test cases in the group ensures that the critical and urgent test cases are executed first, thereby improving the response speed of the test. In this way, by combining the priority ranking and the controller type matching, the waiting time for the test case execution is reduced, and the test efficiency is improved. In addition, the targeted test case allocation and priority ranking improve the accuracy and reliability of the test results.
[0068] In one example, there are multiple test cases associated with the test task. After the test cases that have dependencies on the controller are grouped according to the dependency relationship between the controller type and the test cases, there are still multiple test cases remaining associated with the test task. The multiple remaining test cases do not have a dependency relationship with the controller of the object under test. In this case, in one embodiment, the multiple remaining test cases are prioritized according to a static priority algorithm strategy, and are sequentially assigned to multiple objects under test according to the priority ranking. In one embodiment, random selection is performed according to a random algorithm to assign to multiple objects under test.
[0069] Combination Figure 4 As shown, in some embodiments, a testing method for a vehicle is provided, comprising:
[0070] S401, managing multiple test objects and test case repositories.
[0071] S402: Create a test task according to the test requirements.
[0072] S403: Associating the tested object and the test case according to the test task.
[0073] One or more tested objects required for the test task are associated with one or more required test cases, so that the test task can be completed through multiple tested objects, thereby speeding up the test progress.
[0074] S404, performing initialization operations on multiple objects under test respectively.
[0075] S405: After the initialization operation is successful, the object under test sends a request to execute a use case.
[0076] S406: Allocate test cases to be executed to the multiple tested objects according to a preset allocation strategy, so that the multiple tested objects execute corresponding test cases.
[0077] According to the above embodiment, the object under test is initialized before executing the test case test, so that the test environment of the object under test remains consistent, thereby eliminating the impact of test environment differences on the test results. In addition, after the initialization operation is successful, a request to execute the test case is sent to complete the correct configuration before the test starts, reduce errors during the test process, and thus improve the subsequent test efficiency.
[0078] Further, the steps of respectively initializing the multiple tested objects include: building a test environment based on the tested objects according to the test tasks, retrieving the script files of the test cases, and downloading the test tools, and obtaining the tested software versions corresponding to the test tasks.
[0079] According to the above embodiment, before testing, the test environment is constructed, the script files of the test cases are prepared, the required test tools are downloaded in advance, and the required version of the software to be tested is obtained, so as to prepare for the subsequent test steps and improve the efficiency of the subsequent test process.
[0080] In one example, the step of performing the initialization operation further includes starting monitoring software to monitor the execution process.
[0081] In one example, the step of performing the initialization operation also includes completing an upgrade of the software version under test so that the version of the object under test executed in this test is consistent.
[0082] In one example, the step of building a test environment based on the object under test includes: determining the required hardware environment and software environment according to the test requirements, preparing the required hardware equipment according to the hardware environment, and completing the construction of the hardware environment, and building the software based on the hardware environment to complete the software configuration.
[0083] Furthermore, the step of executing the corresponding test cases for the multiple tested objects includes: sequentially calling the script files corresponding to the test cases to be executed, and executing the test cases. After successful execution, the execution results are reported and the binding with the executed test cases is untied. In the case of execution failure, the binding with the executed test cases is untied, and the tested object is replaced.
[0084] According to the above embodiment, the object under test calls the corresponding script file of the test case and executes the case test. After each test case is successfully executed, the binding is released, and the test of the next test case is looped until all the associated test cases are completed. In the case of failure of the test case execution, a new object under test is replaced for retesting to avoid error reporting and improve the flexibility and adaptability of the test process. In addition, by reporting the execution results, the execution status of each test case can be tracked and recorded.
[0085] Combination Figure 5 As shown in the figure, the network framework diagram for vehicle testing, the backend service, the use case warehouse and multiple objects under test are connected through the TCP / IP network. Figure 6 As shown, in some embodiments, a testing method for a vehicle is provided, comprising:
[0086] S601, the backend service manages the tested object A, the tested object B, the tested object C and the test case warehouse.
[0087] S602, create a test task, select 100 test cases required for association, set priorities for the associated multiple test cases, and associate the test object A, the test object B, and the test object C at the same time for executing the test cases.
[0088] It should be noted that the 100 test cases listed here are only for illustrative purposes. The number of test cases required for actual testing is selected and determined based on actual testing requirements and is not limited to this.
[0089] S603, the parameters of the controllers owned by all the tested objects are kept the same, and the tested software versions are kept consistent.
[0090] S604: When starting to execute the task, all the objects under test need to be initialized.
[0091] Initialization operations include: preparing the test environment space, pulling test case scripts, downloading test tools, and obtaining the tested software version. Initialization operations can also include starting monitoring software and other steps.
[0092] S605, when the object A under test is initialized and initialized successfully, the object A under test requests the test cases to be executed, and the background service sorts them according to the priority and obtains the test cases to be executed that currently have the highest priority.
[0093] S606: The background service binds the object under test A to the test case with the highest priority to be executed.
[0094] S607, the background service sends the test case to be executed to the object under test A, and the object under test A finds the script file of the test case to be executed locally, and the test case is executed by the object under test A.
[0095] S608, after the test case is executed, the object under test A reports the execution result and test report, log and other information to the background service.
[0096] S609: The background service unbinds the object under test A from the test case.
[0097] S610, return to S605, the object A requests the next test case to be executed, if there is a test case to be executed, continue to execute S606, if there is no test case to be executed, the object A stops running.
[0098] S611, when the object under test B is initialized and initialized successfully, the object under test B requests the test cases to be executed, and the background service sorts them according to the priority and obtains the test cases to be executed that currently have the highest priority.
[0099] The test case to be executed that is currently at the highest priority here refers to the test case that is currently at the highest priority among the remaining test cases in an untested state among the multiple test cases sorted by priority.
[0100] S612: The background service binds the object under test B to the test case with the highest priority to be executed.
[0101] S613, the background service sends the test case to be executed to the object under test B, and the object under test B finds the script file of the test case to be executed locally, and the object under test B executes the test case.
[0102] S614, after the test case is executed, the object under test B reports the execution result and test report, log and other information to the background service.
[0103] S615: The background service unbinds the object under test B from the test case.
[0104] S616, return to S611, the object under test B requests the next test case to be executed, if there is a test case to be executed, continue to execute S612, if there is no test case to be executed, the object under test B stops running.
[0105] S617, when the object under test C is initialized and initialized successfully, the object under test C requests the test cases to be executed, and the background service sorts them according to the priority and obtains the test cases to be executed that currently have the highest priority.
[0106] The test case to be executed that is currently at the highest priority here refers to the test case that is currently at the highest priority among the remaining test cases in an untested state among the multiple test cases sorted by priority.
[0107] S618: The background service binds the object under test C to the test case with the highest priority to be executed.
[0108] S619, the background service sends the test case to be executed to the object under test C, and the object under test C finds the script file of the test case to be executed locally, and the test case is executed by the object under test C.
[0109] S620, after the test case is executed, the object under test C reports the execution result and test report, log and other information to the background service.
[0110] S621, the background service unbinds the object under test C from the test case.
[0111] S622, return to S617, the object under test C requests the next test case to be executed, if there is a test case to be executed, continue to execute S618, if there is no test case to be executed, the object under test C stops running.
[0112] S623, after receiving the result report, the background service determines whether all 100 test cases have been executed. After all test cases have been executed, the task is terminated, a test execution report is generated, and a notification message or email is sent to task-related personnel.
[0113] Among them, combined Figure 7 The static priority algorithm strategy diagram shown in the figure sorts multiple test cases according to their priorities, from low priority to high priority, from priority 1 to priority 6. The number of test cases corresponding to each priority can be 1 or more, and the sorting is set according to the test task. During the execution process, the three test cases corresponding to priority 6 are carried out first. After the three test cases complete the execution test, the two test cases of priority 5 are carried out, and so on, to complete the test of all test cases.
[0114] Combination Figure 5 As shown in the figure, the network framework diagram for vehicle testing, the backend service, the use case warehouse and multiple objects under test are connected through the TCP / IP network. Figure 8 As shown, in some embodiments, a testing method for a vehicle is provided, comprising:
[0115] S801, the backend service manages the tested object A, the tested object B, the tested object C and the test case warehouse.
[0116] S802, create a test task, select the required 100 test cases for association, and associate the tested object A, tested object B, and tested object C for executing the test case. Label the controller corresponding to the tested object A, the controller corresponding to the tested object B, and the controller corresponding to the tested object C respectively. Analyze the controllers that the 100 test cases depend on, and label the test cases with the same labels according to the labels of the controllers that the test cases depend on.
[0117] It should be noted that the 100 test cases listed here are only for illustrative purposes. The number of test cases required for actual testing is selected and determined based on actual testing requirements and is not limited to this.
[0118] S803, when starting to execute the task, it is necessary to perform initialization operations on all the objects to be tested.
[0119] Initialization operations include: preparing the test environment space, pulling test case scripts, downloading test tools, and obtaining the tested software version. Initialization operations can also include starting monitoring software or upgrading software versions.
[0120] S804, when the object A under test is initialized and initialized successfully, the object A under test requests a use case to be executed, and the background service obtains a use case to be executed that depends on the tag of the object A under test.
[0121] Among them, when there are multiple use cases that rely on this label, the use case to be executed first is filtered out again according to the priority algorithm or one is randomly obtained.
[0122] S805: The background service binds the object under test A to the test case with the highest priority to be executed.
[0123] S806, the background service sends the test case to be executed to the object under test A, and the object under test A finds the script file of the test case to be executed locally, and the test case is executed by the object under test A.
[0124] S807, after the test case is executed, the object A reports the execution result, test report, log and other information to the background service.
[0125] S808: The background service unbinds the object under test A from the test case.
[0126] S809, return to S804, the object A requests the next test case to be executed, if there is a test case to be executed, continue to execute S805, if there is no test case to be executed, the object A stops running.
[0127] S810, when the object under test B is initialized and successfully initialized, the object under test B requests a use case to be executed, and the background service obtains a use case to be executed that depends on the tag of the object under test B according to the tag of the object under test B.
[0128] Among them, when there are multiple use cases that rely on this label, the use case to be executed first is filtered out again according to the priority algorithm or one is randomly obtained.
[0129] S811, the background service binds the object under test B to the test case with the highest priority to be executed.
[0130] S812, the background service sends the test case to be executed to the object under test B, and the object under test B finds the script file of the test case to be executed locally, and the object under test B executes the test case.
[0131] S813, after the test case is executed, the object under test B reports the execution result and test report, log and other information to the background service.
[0132] S814, the background service unbinds the object under test B from the test case.
[0133] S815, return to S810, the object under test B requests the next test case to be executed, if there is a test case to be executed, continue to execute S811, if there is no test case to be executed, the object under test B stops running.
[0134] S816, when the initialization of the object under test C is completed and successful, the object under test C requests a use case to be executed, and the background service obtains a use case to be executed that depends on the tag of the object under test C according to the tag of the object under test C.
[0135] Among them, when there are multiple use cases that rely on this label, the use case to be executed first is filtered out again according to the priority algorithm or one is randomly obtained.
[0136] S817: The background service binds the object under test C to the test case with the highest priority to be executed.
[0137] S818, the background service sends the test case to be executed to the object under test C, and the object under test C finds the script file of the test case to be executed locally, and the test case is executed by the object under test C.
[0138] S819, after the test case is executed, the object under test C reports the execution result and test report, log and other information to the background service.
[0139] S820: The background service unbinds the object under test C from the test case.
[0140] S821, return to S816, the object under test C requests the next test case to be executed, and if there is a test case to be executed, the execution continues to S817, and if there is no test case to be executed, the object under test C stops running.
[0141] S822, after receiving the result report, the background service determines whether all 100 test cases have been executed. After all cases have been executed, the task is terminated, a test execution report is generated, and a notification message or email is sent to task-related personnel.
[0142] Among them, combined Fig. 9 As shown, a schematic diagram of the attribute dependency algorithm strategy is shown. According to the attributes of the controller, the controller of the device under test 1 is marked as controller A and controller B, and the controller of the device under test 2 is marked as controller C and controller D. According to the labels of the controllers on which the test cases depend, the test cases are calibrated as test cases (dependency A), test cases (dependency B), test cases (dependency C), and test cases (dependency D), wherein the number of test cases that depend on one controller may be one or more. This embodiment is only used as an example, and the specific number is set according to the specific analysis of the test task.
[0143] In some embodiments, in combination Fig.10 As shown, a test device 1000 for a vehicle is provided, comprising: a management unit 1001, for managing multiple test objects and a test case warehouse. A creation unit 1002, for creating a test task according to a test requirement. An association unit 1003, for associating a test object with a test case according to a test task. An execution unit 1004, for allocating test cases to be executed to multiple test objects according to a preset allocation strategy, so that the multiple test objects execute corresponding test cases.
[0144] In one example, the preset allocation strategy includes a static priority algorithm strategy, and the execution unit 1004 is specifically used to prioritize multiple test cases associated with the test task according to the static priority algorithm strategy. According to the priority ranking, the test cases are sequentially allocated to the test object that sends the execution case request, and the test cases are bound to the test objects.
[0145] In one example, the preset allocation strategy includes an attribute dependency algorithm strategy, and the execution unit 1004 is specifically used to analyze the types of multiple controllers corresponding to the multiple objects under test. Multiple test cases are grouped according to the types of dependent controllers to obtain multiple groups of test cases corresponding to the multiple objects under test.
[0146] In one example, the preset allocation strategy includes an attribute dependency algorithm strategy and a static priority algorithm strategy, and the execution unit 1004 is specifically used to analyze the types of multiple controllers corresponding to multiple objects under test. Multiple test cases are grouped according to the types of dependent controllers to obtain multiple groups of test cases corresponding to multiple objects under test. Each group of test cases is prioritized according to the static priority algorithm strategy. Test cases are assigned to the objects under test in order of priority.
[0147] In one example, combining Fig.10 As shown, the test device further includes: an initialization unit 1005, which is used to perform initialization operations on multiple objects under test respectively. After the initialization operation is successful, the object under test sends a request to execute a use case.
[0148] In one example, the initialization unit 1005 is specifically used to build a test environment based on the object under test according to the test task, retrieve the script file of the test case, and download the test tool, and obtain the version of the software under test corresponding to the test task.
[0149] In one example, the execution unit 1004 is further specifically used to sequentially retrieve the script files corresponding to the test cases to be executed and execute the test cases. After successful execution, the execution result is reported and unbound from the executed test cases. In the case of execution failure, the execution result is unbound from the executed test cases and the object under test is replaced.
[0150] Combination Fig.11 As shown, in some embodiments, a test device 1100 for a vehicle is provided, including a processor 1101 and a memory 1102. The device 110 may also include a communication interface 1103 and a bus 1104. The processor 1101, the communication interface 1103, and the memory 1102 may communicate with each other through the bus 1104. The communication interface 1103 may be used for information transmission. The processor 1101 may call the logic instructions in the memory 1102 to execute the test method for a vehicle of the above embodiment.
[0151] In addition, the logic instructions in the memory 1102 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
[0152] The memory 1102 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 1101 executes the function application and data processing by running the program instructions / modules stored in the memory 1102, that is, the vehicle test method in the above embodiment is implemented.
[0153] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function. The data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 1102 may include a high-speed random access memory and may also include a non-volatile memory.
[0154] In some embodiments, a computer-readable storage medium is provided, which stores program instructions. When the program instructions are executed, the computer is used to execute the vehicle testing method according to any of the above embodiments.
[0155] The above embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art on the basis of the present invention are all within the protection scope of the present invention. The embodiments represent only possible changes. Unless explicitly required, individual components and functions are optional, and the order of operations can be changed. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms as well. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or comprising refer to the existence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same or similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0156] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0157] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or 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 other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0158] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A testing method for a vehicle, characterized in that: include: Manage multiple test objects and test case repositories; Create test tasks according to test requirements; According to the test task, associate the tested object and the test case; According to the preset allocation strategy, test cases to be executed are allocated to multiple objects under test, so that the multiple objects under test can execute corresponding test cases.
2. The testing method according to claim 1, characterized in that: The preset allocation strategy includes a static priority algorithm strategy. According to the preset allocation strategy, the steps of allocating test cases to be executed for multiple objects under test include: According to the static priority algorithm strategy, multiple test cases associated with the test task are prioritized; The test cases are assigned to the test objects that send the execution request of the test cases in order of priority, and the test cases are bound to the test objects.
3. The testing method according to claim 1, characterized in that: The preset allocation strategy includes an attribute-dependent algorithm strategy. According to the preset allocation strategy, the steps of allocating test cases to be executed for multiple objects under test include: Analyze the types of multiple controllers corresponding to multiple measured objects; Multiple test cases are grouped according to the types of dependent controllers to obtain multiple groups of test cases corresponding to the multiple objects under test.
4. The testing method according to claim 3, characterized in that: The preset allocation strategy also includes a static priority algorithm strategy. According to the preset allocation strategy, the step of allocating test cases to be executed to multiple objects under test also includes: Prioritize each group of test cases according to the static priority algorithm strategy; Assign test cases to the object under test in order of priority.
5. The testing method according to any one of claims 1 to 4, characterized in that: Before the step of allocating the test cases to be executed to the multiple tested objects according to the preset allocation strategy, the testing method further includes: Perform initialization operations on multiple objects under test respectively; After the initialization operation is successful, the object under test sends a request to execute the use case.
6. The testing method according to claim 5, characterized in that: The steps of respectively performing initialization operations on multiple objects under test include: According to the test task, build the test environment based on the object under test; Retrieve the test case script file and download the test tool; and, Get the tested software version corresponding to the test task.
7. The testing method according to any one of claims 1 to 4, characterized in that: The steps of executing corresponding test cases for multiple objects under test include: Call the script files corresponding to the test cases to be executed in sequence and execute the test cases; After successful execution, the execution results are reported and unbound from the executed test cases; In case of execution failure, the executed test case is unbound and the object under test is replaced.
8. A testing device for a vehicle, characterized in that: include: Management unit, used to manage multiple objects under test and test case repositories; Create a unit to create test tasks according to test requirements; The association unit associates the tested object and the test case according to the test task; The execution unit is used to allocate test cases to be executed to multiple objects under test according to a preset allocation strategy, so that the multiple objects under test can execute corresponding test cases.
9. A testing device for a vehicle, characterized in that: The system comprises a processor and a memory storing program instructions, wherein the processor is configured to execute the vehicle testing method according to any one of claims 1 to 7 when running the program instructions.
10. A computer-readable storage medium storing program instructions, characterized in that: When the program instructions are executed, the computer is used to execute the vehicle testing method according to any one of claims 1 to 7.
