A software testing method, server, bench and computer program product
By obtaining test case links corresponding to changes in the smart device software, and using continuous integration/continuous deployment servers and target benches for automated testing, the problem of low testing efficiency for smart device software was solved, automated testing was achieved, and testing efficiency was improved.
Patent Information
- Application Number
- CN202411902183.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2044-12-20
AI Technical Summary
In existing technologies, software testing efficiency for smart devices is low, requiring manual intervention and resulting in inefficient testing.
By obtaining test case links corresponding to changes in the software under test, the software in smart devices can be automatically tested using continuous integration/continuous deployment servers and target test benches.
It automates software testing for smart devices, improves testing efficiency, and enables automatic testing after software updates, reducing manual intervention.
Smart Images

Figure CN119718951B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of vehicle technology, and in particular relates to a software testing method, server, test bench, and computer program product. Background Technology
[0002] When it is necessary to update the software in the Electronic Control Unit (ECU) of a smart device (such as a vehicle), the code of the newly released software can be automatically integrated, compiled, and deployed to the ECU of the smart device through a Continuous Integration / Continuous Deployment (CI / CD) server.
[0003] However, after the software in the electronic control unit of a smart device is refreshed, it is usually necessary to manually test the refreshed software in the smart device, which reduces the testing efficiency of the software in the smart device. Summary of the Invention
[0004] In view of this, embodiments of this application provide a software testing method, server, test bench, and computer program product to solve the technical problem of low testing efficiency of software in smart devices in existing technologies.
[0005] In a first aspect, embodiments of this application provide a software testing method applied to a first server, the software testing method comprising:
[0006] Obtain at least one first identifier, which is used to identify changes in the software under test; the version of the software under test is the first version.
[0007] Based on at least one of the first identifiers, obtain a first link of a first test case corresponding to the changed content in the software under test; the first test case is used to test the software under test.
[0008] A first message is sent to the target test bench of the smart device. The first message includes the first link. The first message is used to instruct the target test bench to obtain the first test case according to the first link and to test the software to be tested installed in the smart device according to the first test case.
[0009] Optionally, obtaining the first link of the first test case corresponding to the changed content in the software under test based on at least one of the first identifiers includes:
[0010] For each of the first identifiers, the first link corresponding to the first identifier is obtained from a preset test case database, wherein the test case database includes the first link corresponding to each of the first identifiers.
[0011] Optionally, the test case database further includes any associated change identifier associated with the first identifier, and the step of obtaining the first link of the first test case corresponding to the change content in the software under test based on at least one first identifier includes:
[0012] Based on any of the first identifiers, retrieve the first link corresponding to any of the first identifiers and the first link corresponding to the associated change identifier from the test case database;
[0013] The first link corresponding to the first identifier and the first link corresponding to the associated change identifier are used as the first link of the first test case corresponding to the change content.
[0014] Optionally, before sending the first link to the target rack of the smart device, the method further includes:
[0015] Obtain the second link and version information of the software to be tested;
[0016] Obtain the first flash test case template;
[0017] Based on the version information of the software under test and the second link, the first flash test case template is updated to obtain a second flash test case template. The second flash test case template includes at least the second link and the version information. The second flash test case template is used to test whether the smart device successfully flashes the version of the software under test. The second link is the storage address of the first version of the software under test in the second server.
[0018] A second message is sent to the target test bench. The second message includes a third link corresponding to the second flash test case template. The third link is the storage address of the second flash test case template in the second server. The second message is used to instruct the target test bench to flash the software to be tested to the smart device according to the third link and to report the flash result to the first server.
[0019] Optionally, the method further includes:
[0020] Receive test results for the software under test from the target test bench;
[0021] Based on the test results, determine the first test case that failed.
[0022] Based on the first test case that failed, determine the test failure items;
[0023] Obtain the data start time, data end time, and data type information corresponding to the failed test item;
[0024] Based on the data start time, the data end time, and the data type information, target analysis data is obtained from the test data generated by the smart device. The target analysis data is used to determine the reason for the test failure of the first test case.
[0025] Secondly, embodiments of this application provide a software testing method applied to a target test bench, the software testing method comprising:
[0026] Receive a first message from a first server, the first message including a first link; the first link is a link to a first test case corresponding to the changes in the first version of the software to be tested;
[0027] The first test case is obtained from the second server according to the first link;
[0028] The software to be tested installed in the smart device is tested according to the first test case, and the test results are obtained.
[0029] Optional, also includes:
[0030] The method further includes:
[0031] The system receives a third link from the server, which is used to obtain a second flash test case template. The second flash test case template includes at least the second link and the version information of the software under test. The second flash test case template is used to determine whether the smart device has successfully flashed the version of the software under test. The second link is the storage address of the first version of the software under test in the second server.
[0032] According to the third link, obtain the second flash test case template from the second server;
[0033] According to the second flashing test case template, obtain the software to be tested and the version information of the software to be tested corresponding to the second link from the second server;
[0034] The software to be tested is refreshed to the smart device, and the refresh result is determined based on the version information.
[0035] Thirdly, embodiments of this application provide a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the software testing method as described in any of the first aspects.
[0036] Fourthly, embodiments of this application provide a test bench including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the software testing method as described in any of the first aspects.
[0037] Fifthly, embodiments of this application provide a software testing system, including a server as described in the third aspect and a test bench as described in the fourth aspect.
[0038] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the software testing method as described in either the first or second aspect above.
[0039] In a seventh aspect, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to perform the steps of the software testing method as described in either the first or second aspect above.
[0040] The software testing method, server, test bench, and computer program product provided in this application have the following beneficial effects:
[0041] The software testing method provided in this application can be applied to a first server, specifically including: obtaining at least one first identifier, the first identifier being used to identify changes in the software under test; the version of the software under test being a first version; obtaining a first link of a first test case corresponding to the changes in the software under test based on at least one first identifier; the first test case being used to test the software under test; and sending a first message to a target test bench of a smart device, the first message including the first link, the first message being used to instruct the target test bench to obtain the first test case according to the first link, and to test the software under test installed in the smart device according to the first test case. Through the method of this application, the test bench can obtain test cases to test the software under test in the smart device, enabling automatic testing of the software under test in the smart device and improving the testing efficiency of the software in the smart device. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 A software testing system provided in this application embodiment;
[0044] Figure 2 A schematic diagram of a test case database provided in an embodiment of this application;
[0045] Figure 3 A flowchart illustrating the implementation of a software testing method provided in this application embodiment;
[0046] Figure 4 A flowchart illustrating the implementation of a software testing method according to another embodiment of this application;
[0047] Figure 5 This application provides a schematic diagram of the structure of a server according to an embodiment of the present application.
[0048] Figure 6 This is a schematic diagram of the structure of a stand provided in an embodiment of this application;
[0049] Figure 7 A schematic diagram of the structure of a server provided in another embodiment of this application;
[0050] Figure 8 This is a schematic diagram of the structure of a stand provided for another embodiment of this application. Detailed Implementation
[0051] It should be noted that the terminology used in the embodiments of this application is only for explaining specific embodiments of this application and is not intended to limit this application. In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, "at least one" or "one or more" means one, two or more. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0052] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0053] like Figure 1 As shown, Figure 1 A software testing system provided in this application embodiment includes:
[0054] First server, second server, and target rack.
[0055] The first server can be a Continuous Integration / Continuous Deployment (CI / CD) server, used to execute the software testing methods in this embodiment and to refresh the software to be tested on the smart device. The smart device can be a driving device, a smart car, a robot, or other similar device. For example, the smart device in this embodiment can refer to a vehicle.
[0056] The second server can be in the cloud and is used to store the test case database in the embodiments of this application, as well as one or more first test cases.
[0057] The test case database records the first link corresponding to each first identifier, and each first link corresponds to a first test case stored in the second server. In addition, the test case database can also record the associated identifiers corresponding to each first identifier, as well as the changes to the first identifier and the description of the first test case. Furthermore, the test case database can also record the person in charge information corresponding to the first identifier.
[0058] Please see Figure 2 , Figure 2 This is a schematic diagram of a test case database provided in an embodiment of this application. Figure 2 As shown, the test case database may include change IDs (i.e., the first identifier in this embodiment of the application) and associated change IDs (i.e., the associated change IDs in this embodiment of the application). Optionally, the test case database may also include test case links (i.e., the first links in this embodiment of the application), and may also include content descriptions and responsible persons.
[0059] In practical applications, users can predefine a first identifier corresponding to each change in the software under test, predetermine a first test case corresponding to each change, and predetermine the association between each first test case and a first link. Then, the test case database obtained from the first identifier, first test case, and first link corresponding to each change is uploaded to a second server, allowing the first server to obtain the test case database from the second server. It is understood that in this embodiment, each record in the test case database includes a change ID, associated change ID, test case link, content description, and a mapping relationship between the responsible party and the change ID.
[0060] It is worth noting that, Figure 2 The test case database shown does not have a corresponding change ID for every change ID; there may be a change ID that does not have a corresponding change ID.
[0061] As an example, the system described above may also include a smart device. This smart device contains the software to be tested. Taking a vehicle as an example, the electronic control unit within the vehicle contains the software to be tested.
[0062] The software testing method provided in this application can be applied to scenarios where software to be tested is installed in smart devices. Specifically, the software testing method provided in this application can be applied to scenarios where software to be tested is installed in vehicles. More specifically, the software testing method provided in this application can be applied to scenarios where software to be tested is installed in electronic control units in vehicles.
[0063] The software testing method provided in this application can be executed by a first server and a test bench. The first server can be a continuous integration / continuous deployment server, and it can communicate with the test bench. Specifically, when it is necessary to automatically test the software to be tested installed in the electronic control unit of a vehicle, the various steps of the software testing method provided in this application can be executed by the server and the test bench respectively.
[0064] Please see Figure 3 , Figure 3 This is a flowchart illustrating the implementation of a software testing method provided in this application embodiment. The software testing method provided in this application embodiment can be applied to a first server, and the method may include steps S101 to S103, detailed below:
[0065] In S101, at least one first identifier is obtained, which is used to identify the changes in the software under test; the version of the software under test is the first version.
[0066] In this embodiment of the application, when it is necessary to automatically test the software to be tested installed in the electronic control unit of a vehicle, the first server can first obtain a first identifier used to identify the changes in the software to be tested. The changes in the software to be tested can be one or more, and accordingly, the first identifier can also be one or more.
[0067] The software to be tested can be software in the electronic control unit that has been updated but not yet tested. Changes in the software to be tested can be differences between the software under test and the old software. The old software can be the initial software already installed in the electronic control unit corresponding to the software under test.
[0068] In this implementation, when developing the software to be tested, after processing a change, the user can upload the first identifier corresponding to the change and the first link of the first test case corresponding to the change to the test case database of the second server.
[0069] As an example, the first server can access a database of test cases stored on the second server.
[0070] In practical applications, users can input the first identifier corresponding to each change in the software under test into the first server, so that the first server can obtain the first identifier corresponding to each change in the software under test.
[0071] In S102, based on at least one first identifier, the first link of the first test case corresponding to the changed content in the software under test is obtained, and the first test case is used to test the software under test.
[0072] In this embodiment of the application, the first test case corresponding to the changed content in the software to be tested may include: the test case corresponding to the changed content, that is, the test case corresponding to the changed content is used to test the software to be tested during testing.
[0073] Alternatively, the first test case corresponding to the changes in the software under test can include: a test case for the associated change ID of the changes and the test case for the changes themselves. That is, during testing, the test case for the changes and the test case for the associated change ID are used together to test the software under test.
[0074] In one possible implementation, S102 can be achieved through step a. Details are as follows:
[0075] In step a, for each first identifier, the first link corresponding to the first identifier is obtained from the preset test case database.
[0076] The test case database includes the first link corresponding to each first identifier.
[0077] In this implementation, after obtaining the first identifier, the first server can obtain a preset test case database from the second server. Then, the first server can obtain the first link corresponding to each first identifier from the preset test case database, thereby obtaining the first link of the first test case corresponding to the changed content in the software under test.
[0078] In another possible implementation, S102 can be achieved through steps b to c. Details are as follows:
[0079] In step b, based on any first identifier, the first link corresponding to any first identifier and the first link corresponding to the associated change identifier are obtained from the test case database.
[0080] In this implementation, after obtaining the first identifier, the first server can obtain a preset test case database from the second server. Then, the first server can obtain the first link corresponding to each first identifier and the first link corresponding to the associated change identifier of the first identifier from the preset test case database according to each first identifier.
[0081] In step c, the first link corresponding to the first identifier and the first link corresponding to the associated change identifier are used as the first link of the first test case corresponding to the change content.
[0082] In this implementation, after obtaining the first link corresponding to each of the first identifiers and the first link corresponding to the associated change identifier of the first identifier, the first server can use the first link corresponding to the first identifier and the first link corresponding to the associated change identifier as the first link of the first test case corresponding to the changed content.
[0083] In S103, a first message is sent to the target test bench of the smart device. The first message includes a first link and is used to instruct the target test bench to obtain a first test case according to the first link and to test the software to be tested installed in the smart device according to the first test case.
[0084] In this embodiment of the application, after obtaining the first link, the first server can send a first message including the first link to the target stand of the smart device, so as to instruct the target stand to obtain the first test case according to the first link, and test the software to be tested installed in the smart device according to the first test case.
[0085] In one possible implementation, while the target bench is testing the software to be tested installed in the smart device according to the first test case, the target bench can also acquire various types of data from the vehicle during the test and send the acquired data to the first server.
[0086] The various types of data can include, but are not limited to, Controller Area Network (CAN) data, Local Interconnect Network (LIN) data, Diagnostic Information (DI) data, Analog to Digital Converter (ADC) data, and ETH (an automotive communication protocol based on Ethernet technology) bus data.
[0087] Based on this, the first server can also obtain data for analysis through steps d to h.
[0088] Details are as follows:
[0089] In step d, test results for the software under test are received from the target test bench.
[0090] In this implementation, after the target test bench tests the software under test in the smart device according to the first test case, the first server can also receive the test results for the software under test from the target test bench.
[0091] The test results for the software under test can include the sub-test results corresponding to each first test case. The test results can include whether the test was successful or failed.
[0092] In step e, based on the test results, the first test case that failed is identified.
[0093] In this implementation, the first server can determine the first test case that failed based on the sub-test results corresponding to each first test case.
[0094] Specifically, the target chassis can determine the sub-test result corresponding to any first test case in the following way. The first test case may include expected values for several target data points. Based on this, when the target chassis tests the software to be tested installed in the vehicle's electronic control unit according to the first test case, it can obtain the actual values of the target data. Then, it can compare the actual value of each target data point with the expected value of the corresponding target data. If the actual value of any target data point differs from the expected value of the corresponding target data point, the sub-test result corresponding to that first test case can be determined as a test failure.
[0095] In step f, the failed test items are determined based on the first failed test case.
[0096] In this implementation, after identifying the first test case that failed, the first server can determine the test failure items. Specifically, the user can predefine several test items in each first test case, define several test steps for each test item, and define the actual and expected values of several target data corresponding to each test step. Based on this, the first server can identify test failure steps in the first test case where the actual and expected values of the target data differ, thereby determining the test failure items based on the test failure steps.
[0097] In step g, the start time, end time, and data type information of the data corresponding to the failed test item are obtained.
[0098] In this implementation, after obtaining a failed test item, the first server can acquire the corresponding data information. Specifically, the first server can acquire the data start time, data end time, and data type information corresponding to the failed test item. The data start time describes the time when the failed test item begins generating data, the data end time describes the time when the failed test item stops generating data, and the data type information describes the data type of the failed test item.
[0099] In step h, target analysis data is obtained from the test data generated by the smart device based on the data start time, data end time, and data type information. The target analysis data is used to determine the reason for the failure of the first test case.
[0100] In this implementation, after obtaining the data start time, data end time, and data type information corresponding to the failed test item, the first server can obtain target analysis data from the test data generated by the electronic control unit based on the data start time, data end time, and data type information.
[0101] For example, the data start time can be time 1, the data end time can be time 2, and the data type information can be controller local area network bus data type. Based on this, the first server can obtain data with controller local area network bus data type from the test data generated by the electronic control unit, and use the data generated within the time range consisting of time 1 and time 2 as the target analysis data.
[0102] After the first server obtains the target analysis data, it can upload the target analysis data to the second server, so that users can obtain the target analysis data from the second server and analyze the reasons for the test failure based on the target analysis data.
[0103] In addition, the first server can also display the project information of the test failure items corresponding to the target analysis data, the step information of the test failure steps corresponding to the target analysis data, and the actual and expected values of the target data corresponding to the test failure steps corresponding to the target analysis data in a preset manner, so that customers can analyze the reasons for the test failure based on the above information.
[0104] In another embodiment of this application, before testing the software to be tested, the first server may also refresh the software to be tested into the electronic control unit.
[0105] In this embodiment of the application, the first server can refresh the software to be tested into the electronic control unit through steps i to l. Details are as follows:
[0106] In step i, the second link and version information of the software to be tested are obtained.
[0107] In this embodiment, the first server can access the version information of the software to be tested. This version information describes the software to be tested as a first version.
[0108] In step j, the first flash test case template is obtained.
[0109] In this embodiment of the application, the first server can obtain the first flash test case template from the second server.
[0110] In step k, the first flash test case template is updated based on the version information of the software to be tested and the second link to obtain the second flash test case template. The second flash test case template includes at least the second link and version information. The second flash test case template is used to test whether the smart device successfully flashes the version of the software to be tested. The second link is the storage address of the first version of the software to be tested on the second server.
[0111] In this embodiment of the application, after obtaining the version information and second link of the software to be tested, as well as the first flash test case template, the first flash test case template can be updated according to the version information and second link of the software to be tested to obtain the second flash test case template, so that the second flash test case template includes at least the second link and version information.
[0112] In step 1, a second message is sent to the target test bench. The second message includes a third link corresponding to the second flash test case template. The third link is the storage address of the second flash test case template in the second server. The second message is used to instruct the target test bench to flash the software to be tested to the smart device according to the third link and to report the flashing result to the first server.
[0113] In this embodiment of the application, after obtaining the second flash test case template, the first server can send a second message to the target test bench including a third link corresponding to the second flash test case template, so as to instruct the target test bench to flash the software to be tested to the smart device according to the third link, and to report the flashing result to the first server.
[0114] Specifically, after receiving the second message, the target test bench can obtain the second flashing test case template from the second server based on the third link in the second message. It can then obtain the second link and version information from the second server based on the second flashing test case template, and obtain the software to be tested from the second server based on the second link. Furthermore, it can flash the obtained software to be tested into the vehicle's electronic control unit (ECU). Afterward, the target test bench can obtain the current version information of the software in the vehicle's ECU. If the current version information matches the version information of the software to be tested, the flashing is considered successful; otherwise, the flashing is considered a failure. Specifically, if the version of the software to be tested is version one, and the target test bench determines that the current software version in the vehicle's ECU is version one based on the current version information, the flashing is considered successful. If the target test bench determines that the current software version in the vehicle's ECU is version two based on the current version information, the flashing is considered a failure.
[0115] Optionally, if the first server determines that the refresh has failed, the relevant steps for testing the software under test (such as S101 to S103) can be skipped, and the software under test can be directly considered to have failed the test. If the first server determines that the refresh has succeeded, the relevant steps for testing the software under test can be executed.
[0116] As can be seen from the above, the software testing method provided in this application embodiment can be applied to a first server, specifically including: obtaining at least one first identifier, the first identifier being used to identify changes in the software to be tested; the version of the software to be tested being a first version; obtaining a first link of a first test case corresponding to the changes in the software to be tested based on at least one first identifier; the first test case being used to test the software to be tested; sending a first message to a target test bench of a smart device, the first message including the first link, the first message being used to instruct the target test bench to obtain the first test case based on the first link, and to test the software to be tested installed in the smart device based on the first test case. Through the method of this application, the test bench can obtain test cases to test the software to be tested in the smart device, enabling automatic testing of the software to be tested in the smart device after refreshing the software in the smart device, thus improving the testing efficiency of the software in the smart device.
[0117] In practical applications, there can be multiple first servers and multiple target test benches, which enables automatic testing of the software to be tested installed in the electronic control units of multiple vehicles at the same time, further improving the testing efficiency of the software in the electronic control units.
[0118] Please see Figure 4 , Figure 4 The following is a flowchart illustrating the implementation of a software testing method according to another embodiment of this application. The software testing method provided in this embodiment can be applied to a target test bench and may include steps S201 to S203, as detailed below:
[0119] In S201, a first message is received from the first server. The first message includes a first link; the first link is a link to the first test case corresponding to the changes in the first version of the software to be tested.
[0120] In this embodiment of the application, after receiving a first message from a first server, the target platform can obtain a first link based on the first message.
[0121] In S202, the first test case is obtained from the second server based on the first link.
[0122] In this embodiment of the application, after the target test bench obtains the first link, it can obtain the first test case from the second server based on the first link.
[0123] In S203, the software to be tested installed in the smart device is tested according to the first test case, and the test results are obtained.
[0124] In this embodiment of the application, after the target test bench obtains the first test case, it can test the software to be tested installed in the smart device according to the first test case and obtain the test results.
[0125] After obtaining the test results, the target test bench can send the test results back to the smart device.
[0126] In another embodiment of this application, the target test bench may also refresh the software to be tested into the vehicle's electronic control unit before testing the software to be tested.
[0127] In this embodiment of the application, the target test bench can refresh the software to be tested into the electronic control unit through steps m to p. Details are as follows:
[0128] In step m, a third link is received from the server. The third link is used to obtain a second flash test case template. The second flash test case template includes at least the second link and the version information of the software to be tested. The second flash test case template is used to determine whether the smart device has successfully flashed the version of the software to be tested. The second link is the storage address of the first version of the software to be tested in the second server.
[0129] In this embodiment, the target test bench can receive a third link from the server. This third link is obtained by the first server updating the first test case template based on the version information of the software under test and the second link.
[0130] In step n, the second flash test case template is obtained from the second server based on the third link.
[0131] In this embodiment of the application, the target test bench can download the second flash test case template from the second server after receiving a third link from the server.
[0132] In step o, based on the second test case template, the software to be tested and its version information corresponding to the second link are obtained from the second server.
[0133] In this embodiment of the application, after obtaining the second flashing test case template, the target test bench can download the second link and version information of the software to be tested from the second server according to the second flashing test case template, and download the software to be tested from the second server according to the second link of the software to be tested.
[0134] In step p, the software to be tested is refreshed to the smart device, and the refresh result is determined based on the version information.
[0135] In this embodiment of the application, after obtaining the second link and version information, the target test bench can refresh the software to be tested to the smart device according to the second link, and determine the refresh result according to the version information.
[0136] After the refresh result is confirmed, the target platform can send the refresh result back to the first server.
[0137] Based on the software testing method provided in the above embodiments, this application further provides a server and test bench for implementing the above method embodiments.
[0138] Please see Figure 5 , Figure 5 This application provides a schematic diagram of the structure of a server, as shown in the embodiment of the present application. Figure 5 As shown, the server 50 may include an identifier acquisition unit 51, a connection acquisition unit 52, and a message sending unit 53, wherein:
[0139] The identifier acquisition unit 51 is used to acquire at least one first identifier, which is used to identify the changes in the software under test; the version of the software under test is the first version.
[0140] The first link acquisition unit 52 is used to acquire the first link of the first test case corresponding to the changed content in the software to be tested based on at least one first identifier; the first test case is used to test the software to be tested.
[0141] The first message sending unit 53 is used to send a first message to the target test bench of the smart device. The first message includes a first link and is used to instruct the target test bench to obtain a first test case according to the first link and to test the software to be tested installed in the smart device according to the first test case.
[0142] Optionally, the first link acquisition unit 52 is specifically used for:
[0143] For each first identifier, the first link corresponding to the first identifier is obtained from the preset test case database. The test case database includes the first link corresponding to each first identifier.
[0144] Optionally, the first link acquisition unit 52 is further used for:
[0145] Based on any of the first identifiers, retrieve the first link corresponding to any of the first identifiers and the first link corresponding to the associated change identifier from the test case database;
[0146] The first link corresponding to the first identifier and the first link corresponding to the associated change identifier are used as the first link of the first test case corresponding to the change content.
[0147] Optionally, the server 50 may also include a first refresh unit, wherein:
[0148] The first refresh unit is specifically used for:
[0149] Obtain the secondary link and version information of the software to be tested;
[0150] Obtain the first flash test case template;
[0151] Based on the version information of the software under test and the second link, the first flash test case template is updated to obtain the second flash test case template. The second flash test case template includes at least the second link and version information. The second flash test case template is used to test whether the smart device successfully flashes the version of the software under test. The second link is the storage address of the first version of the software under test on the second server.
[0152] A second message is sent to the target test bench. The second message includes a third link corresponding to the second flash test case template. The third link is the storage address of the second flash test case template in the second server. The second message is used to instruct the target test bench to flash the software to be tested to the smart device according to the third link and to report the flashing result to the first server.
[0153] Optionally, the server 50 may also include a data acquisition unit, wherein:
[0154] The data acquisition unit is specifically used for:
[0155] Receive test results for the software under test from the target test bench;
[0156] Based on the test results, determine the first test case that failed.
[0157] Based on the first test case that failed, identify the items that failed in the test;
[0158] Obtain the start time, end time, and data type information for the projects that failed the test.
[0159] Based on the data start time, data end time, and data type information, target analysis data is obtained from the test data generated by the smart device. The target analysis data is used to determine the reason for the failure of the first test case.
[0160] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a stand provided in an embodiment of this application, such as... Figure 6 As shown, the test bench 60 may include a message receiving unit 61, a test case acquisition unit 62, and a test unit 63, wherein:
[0161] The message receiving unit 61 is used to receive a first message from a first server, the first message including the first link; the first link is a link to a first test case corresponding to the changes in the first version of the software to be tested.
[0162] The test case acquisition unit 62 is used to acquire the first test case from the second server based on the first link.
[0163] Test unit 63 is used to test the software to be tested installed in the smart device according to the first test case and obtain the test results.
[0164] Optionally, the rack 60 may also include a second refresh unit, wherein:
[0165] The second refresh unit is specifically used for:
[0166] The system receives a third link from the server, which is used to obtain a second flash test case template. The second flash test case template includes at least the second link and the version information of the software under test. The second flash test case template is used to determine whether the smart device has successfully flashed the version of the software under test. The second link is the storage address of the first version of the software under test in the second server.
[0167] According to the third link, obtain the second flash test case template from the second server;
[0168] According to the second flashing test case template, obtain the software to be tested and the version information of the software to be tested corresponding to the second link from the second server;
[0169] The software to be tested is refreshed to the smart device, and the refresh result is determined based on the version information.
[0170] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a server provided for another embodiment of this application. For example... Figure 7 As shown, the server 7 provided in this embodiment may include: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70. For example, a program corresponding to a software testing method. When the processor 70 executes the computer program 72, it implements the steps described above applied in the software testing method embodiment, for example... Figure 3 As shown in S101 to S103, when the processor 70 executes the computer program 72, it implements the functions of each module / unit in the embodiment corresponding to the server 50 described above, for example... Figure 5 The functions of units 51 to 53 shown.
[0171] For example, computer program 72 can be divided into one or more modules / units, one or more of which are stored in memory 71 and executed by processor 70 to complete this application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of computer program 72 in server 7. For example, computer program 72 can be divided into an identifier acquisition unit 51, a link acquisition unit 52, and a message sending unit 53. For the specific functions of each unit, please refer to [link to relevant documentation]. Figure 5 The relevant descriptions in the corresponding embodiments are not repeated here.
[0172] Those skilled in the art will understand that Figure 7 This is merely an example of server 7 and does not constitute a limitation on server 7. It may include more or fewer components than shown, or combine certain components, or use different components.
[0173] Please see Figure 8 , Figure 8 This is a schematic diagram of a stand according to another embodiment of this application. Figure 8 As shown, the test bench 8 provided in this embodiment may include: a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and executable on the processor 80. For example, a program corresponding to a software testing method. When the processor 80 executes the computer program 82, it implements the steps described above in the software testing method embodiment, for example... Figure 4 As shown in S201 to S203, when the processor 80 executes the computer program 82, it implements the functions of each module / unit in the embodiment corresponding to the test bench 60, for example... Figure 6 The functions of units 61 to 63 shown.
[0174] For example, computer program 82 can be divided into one or more modules / units, one or more of which are stored in memory 81 and executed by processor 80 to complete this application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of computer program 82 in test bench 8. For example, computer program 82 can be divided into message receiving unit 61, test case acquisition unit 62, and test unit 63. For the specific functions of each unit, please refer to... Figure 6 The relevant descriptions in the corresponding embodiments are not repeated here.
[0175] Those skilled in the art will understand that Figure 8 This is merely an example of bench 8 and does not constitute a limitation on bench 8. It may include more or fewer components than shown, or combine certain components, or use different components.
[0176] Processors 80 and 60 can be central processing units (CPUs), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0177] Memory 81 and memory 61 can be internal storage units of rack 8 and server 6, such as hard drives or memory in rack 8 and server 6. Memory 81 and memory 61 can also be external storage devices of rack 8 and server 6, such as plug-in hard drives, smart media cards (SMCs), secure digital (SD) cards, or flash cards equipped on rack 8 and server 6. Furthermore, memory 81 and memory 61 can include both internal storage units and external storage devices in rack 8 and server 6. Memory 81 and memory 61 are used to store computer programs and other programs and data required by electronic devices. Memory 81 and memory 61 can also be used to temporarily store data that has been output or will be output.
[0178] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units is merely an example. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the server and rack can be divided into different functional units to complete all or part of the functions described above. The functional units in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0179] This application also provides a software testing system, which may include a server and a test bench.
[0180] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the various method embodiments described above.
[0181] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.
[0182] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
[0183] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0184] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A software testing method, characterized in that, Applied to the first server, the software testing method includes: Obtain at least one first identifier, which is used to identify changes in the software under test; the version of the software under test is the first version. Based on at least one of the first identifiers, obtain a first link of a first test case corresponding to the changed content in the software under test; the first test case is used to test the software under test. Send a first message to a target test bench of a smart device. The first message includes the first link and is used to instruct the target test bench to test the software to be tested installed in the smart device according to the first test case obtained from the first link. The step of obtaining the first link of the first test case corresponding to the changed content in the software under test based on at least one of the first identifiers includes: For each of the first identifiers, the first link corresponding to the first identifier is obtained from the test case database, wherein the test case database includes at least the first link corresponding to each of the first identifiers; The test case database also includes an associated change identifier associated with any of the first identifiers. The step of obtaining the first link of the first test case corresponding to the changed content in the software under test based on at least one of the first identifiers includes: Based on any of the first identifiers, retrieve the first link corresponding to any of the first identifiers and the first link corresponding to the associated change identifier from the test case database; The first link corresponding to the first identifier and the first link corresponding to the associated change identifier are used as the first link of the first test case corresponding to the change content; Before sending the first link to the target rack of the smart device, the method further includes: Obtain the second link and version information of the software to be tested; Obtain the first flash test case template; Based on the version information of the software under test and the second link, the first flash test case template is updated to obtain a second flash test case template. The second flash test case template includes at least the second link and the version information. The second flash test case template is used to determine whether the smart device has successfully flashed the version of the software under test. The second link is the storage address of the first version of the software under test in the second server. A second message is sent to the target test bench. The second message includes a third link corresponding to the second flash test case template. The third link is the storage address of the second flash test case template in the second server. The second message is used to instruct the target test bench to refresh the version of the software to be tested according to the second flash test case template.
2. The method according to claim 1, characterized in that, The method further includes: Receive test results for the software under test from the target test bench; Based on the test results, determine the first test case that failed. Based on the first test case that failed, determine the test failure items; Obtain the data start time, data end time, and data type information corresponding to the failed test item; Based on the data start time, the data end time, and the data type information, target analysis data is obtained from the test data generated by the smart device. The target analysis data is used to determine the reason for the test failure of the first test case.
3. A software testing method, characterized in that, Applied to the target test bench, the software testing method includes: Receive a first message from a first server, the first message including a first link; the first link is a link to a first test case corresponding to the changes in the first version of the software to be tested; The first test case is obtained from the second server according to the first link; The software to be tested installed in the smart device is tested according to the first test case, and the test results are obtained. The first link is determined by the first server in the following way: For each first identifier, the first link corresponding to the first identifier is obtained from the test case database, wherein the test case database includes at least the first link corresponding to each first identifier; wherein the first identifier is used to identify the changed content in the software under test; The test case database also includes any associated change identifier associated with the first identifier; The first link is determined by the first server in the following way: Based on any of the first identifiers, retrieve the first link corresponding to any of the first identifiers and the first link corresponding to the associated change identifier from the test case database; The first link corresponding to the first identifier and the first link corresponding to the associated change identifier are used as the first link of the first test case corresponding to the change content; The software testing method also includes: Receive a second message from the first server, the second message including a third link corresponding to the second flash test case template, the third link being the storage address of the second flash test case template in the second server; According to the second flash test case template, refresh the version of the software to be tested; The second flash test case template is determined by the first server in the following way: Obtain the second link and version information of the software to be tested; Obtain the first flash test case template; Based on the version information of the software under test and the second link, the first flash test case template is updated to obtain the second flash test case template. The second flash test case template includes at least the second link and the version information. The second flash test case template is used to determine whether the smart device has successfully flashed the version of the software under test. The second link is the storage address of the first version of the software under test in the second server.
4. The method according to claim 3, characterized in that, The method further includes: The system receives a third link from the server, which is used to obtain a second flash test case template. The second flash test case template includes at least the second link and the version information of the software under test. The second flash test case template is used to determine whether the smart device has successfully flashed the version of the software under test. The second link is the storage address of the first version of the software under test in the second server. According to the third link, obtain the second flash test case template from the second server; According to the second flashing test case template, obtain the software to be tested and the version information of the software to be tested corresponding to the second link from the second server; The software to be tested is refreshed to the smart device, and the refresh result is determined based on the version information.
5. A server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the software testing method as described in any one of claims 1 to 2.
6. A test bench comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the software testing method as described in any one of claims 3 to 4.
7. A computer program product, characterized in that, When the computer program product is run on a computer device, the computer device performs the software testing method as described in any one of claims 1 to 2, or implements the software testing method as described in any one of claims 3 to 4.
Citation Information
Patent Citations
Software testing method and device, computing equipment and storage medium
CN109960647A
Batch flashing pressure testing method and device, storage medium and computer equipment
CN115033466A