Method, device, electronic equipment and storage medium for software testing
Patent Information
- Application Number
- CN202211564397.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-07
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2042-12-07
AI Technical Summary
相关技术中,由于软件测试的过程中存在对大量测试资源耗费甚至测试失败的情况,因此,软件测试存在效率低下的问题
[0008]本申请实施例提供的软件测试的方法、装置、电子设备以及存储介质,通过获取目标评价指标;根据预设指标代码关系,获取与目标评价指标对应的初筛测试代码版本集,其中,初筛测试代码版本集中包括至少两个测试代码版本,其中,预设指标代码关系中包括评价指标与代码版本的对应关系;根据目标评价指标,获取目标测试用例;对初筛测试代码版本集中包括的测试代码版本进行筛选,获得第一测试代码版本以及第二测试代码版本;基于目标测试用例,从第一测试代码版本以及第二测试代码版本中确定目标测试代码版本;基于目标测试用例以及目标测试代码版本,获得回溯报告,其中,回溯报告用于表征目标测试代码版本对目标评价指标的影响,进而通过评价指标与软件代码的关系自动回溯测试软件的代码版本,减少了对无效代码版本的测试确认,提高了回溯测试软件的效率。
Smart Images

Figure CN115952082B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software testing technology, and more specifically, to a software testing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of the software industry, software development and testing face increasing challenges. Software testing, in particular, is the process of running or measuring a software system using manual or automated methods. Its purpose is to verify whether it meets specified requirements or to clarify the difference between expected and actual results. In related technologies, software testing suffers from inefficiency due to the significant consumption of testing resources and the possibility of test failures. Summary of the Invention
[0003] In view of the above problems, this application proposes a software testing method, apparatus, electronic device, and storage medium, which can automatically trace back the software code version by the relationship between evaluation indicators and software code, reducing the testing and confirmation of invalid code versions and improving the efficiency of backtracking software testing.
[0004] In a first aspect, embodiments of this application provide a software testing method, the method comprising: obtaining a target evaluation metric; obtaining a set of initial screening test code versions corresponding to the target evaluation metric according to a preset metric-code relationship, wherein the set of initial screening test code versions includes at least two test code versions, and the preset metric-code relationship includes a correspondence between the evaluation metric and the code version; obtaining target test cases according to the target evaluation metric; filtering the test code versions included in the set of initial screening test code versions to obtain a first test code version and a second test code version; determining a target test code version from the first test code version and the second test code version based on the target test cases; and obtaining a backtracking report based on the target test cases and the target test code version, wherein the backtracking report is used to characterize the impact of the target test code version on the target evaluation metric.
[0005] Secondly, embodiments of this application provide a software testing apparatus, the apparatus comprising: a target evaluation index acquisition module, a preliminary screening test code version set acquisition module, a target test case acquisition module, a screening module, a target test code version determination module, and a backtracking report acquisition module. The system includes the following modules: a target evaluation metric acquisition module for acquiring target evaluation metrics; a preliminary screening test code version set acquisition module for acquiring a preliminary screening test code version set corresponding to the target evaluation metrics based on a preset indicator-code relationship, wherein the preliminary screening test code version set includes at least two test code versions, and the preset indicator-code relationship includes a correspondence between evaluation metrics and code versions; a target test case acquisition module for acquiring target test cases based on the target evaluation metrics; a filtering module for filtering the test code versions included in the preliminary screening test code version set to obtain a first test code version and a second test code version; a target test code version determination module for determining a target test code version from the first test code version and the second test code version based on the target test cases; and a backtracking report acquisition module for obtaining a backtracking report based on the target test cases and the target test code version, wherein the backtracking report characterizes the impact of the target test code version on the target evaluation metrics.
[0006] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor performs the above-described method.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code, which can be invoked by a processor to execute the above-described method.
[0008] The software testing method, apparatus, electronic device, and storage medium provided in this application embodiment obtain a target evaluation index; according to a preset index code relationship, obtain a set of initial screening test code versions corresponding to the target evaluation index, wherein the set of initial screening test code versions includes at least two test code versions, and the preset index code relationship includes the correspondence between the evaluation index and the code version; obtain target test cases according to the target evaluation index; filter the test code versions included in the set of initial screening test code versions to obtain a first test code version and a second test code version; determine the target test code version from the first test code version and the second test code version based on the target test cases; and obtain a backtracking report based on the target test cases and the target test code version, wherein the backtracking report is used to characterize the impact of the target test code version on the target evaluation index, and thus automatically backtracks the code version of the tested software through the relationship between the evaluation index and the software code, reducing the testing confirmation of invalid code versions and improving the efficiency of backtracking the tested software. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0010] Figure 1 A flowchart illustrating a software testing method provided in an embodiment of this application is shown.
[0011] Figure 2 A flowchart illustrating a software testing method provided in an embodiment of this application is shown.
[0012] Figure 3 A flowchart illustrating a software testing method provided in an embodiment of this application is shown.
[0013] Figure 4 A flowchart illustrating a software testing method provided in an embodiment of this application is shown.
[0014] Figure 5 A flowchart illustrating a software testing method provided in an embodiment of this application is shown.
[0015] Figure 6 A flowchart illustrating a software testing method provided in an embodiment of this application is shown.
[0016] Figure 7 A flowchart illustrating a software testing method provided in an embodiment of this application is shown.
[0017] Figure 8 A flowchart illustrating a software testing method provided in an embodiment of this application is shown.
[0018] Figure 9 A block diagram of a software testing apparatus according to an embodiment of this application is shown;
[0019] Figure 10 A block diagram of an electronic device for performing a software testing method according to an embodiment of this application is shown;
[0020] Figure 11 An embodiment of this application shows a storage unit for storing or carrying program code that implements a software testing method according to an embodiment of this application. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0022] With the development of the software industry, software testing has become crucial to software development. Software testing can improve software quality and enhance its reliability by measuring its quality. Overall, software testing verifies the implementation of software functions, its usability, and checks for errors. Essentially, the core of software testing is to improve user experience.
[0023] In related technologies, when a software's performance indicator changes within a certain version range, it's necessary to locate and analyze the version that caused the change to improve software quality. Most methods for locating this issue involve manually checking version commit records and then conducting confirmation tests on all suspected versions, or automating the process by testing each commit within the range. Understandably, if the number of commits within the software version range is large, the entire backtesting process will consume significant testing resources, and may even fail to complete. Therefore, these technologies suffer from inefficiency due to the high resource consumption and potential test failures during software testing.
[0024] To address the aforementioned problems, the inventors, through long-term research, discovered and proposed the software testing method, apparatus, electronic device, and storage medium provided in the embodiments of this application. By automatically tracing back the code version of the tested software through the relationship between evaluation indicators and software code, the testing and confirmation of invalid code versions is reduced, thus improving the efficiency of backtracking software testing. The specific software testing method will be described in detail in the subsequent embodiments.
[0025] Please see Figure 1 , Figure 1 A flowchart illustrating a software testing method according to an embodiment of this application is shown. This software testing method automatically backtracks the test software's code version by analyzing the relationship between evaluation metrics and software code, reducing the need to verify invalid code versions and improving the efficiency of backtracking the test software. In specific embodiments, this software testing method can be applied to, for example... Figure 9 The software testing apparatus 200 and the electronic device 100 equipped with the software testing apparatus 200 are shown. Figure 10 The following will use an electronic device as an example to illustrate the specific process of this embodiment. Of course, it is understood that the electronic device used in this embodiment may include smartphones, tablets, wearable electronic devices, etc., and is not limited thereto. The following will focus on... Figure 1 The process shown will be described in detail. The software testing method may specifically include the following steps:
[0026] Step S110: Obtain the target evaluation indicators.
[0027] In some implementations, the electronic device may include different software programs, and the electronic device can simulate these different software programs to obtain evaluation metrics after each simulation. These evaluation metrics may include indicators of the software's quick response (QR) and performance metrics. Examples include the timing of the software simulation, the chip area occupied by the entire logic of the software simulation, and the memory used by the software simulation. Furthermore, the electronic device can simulate different software programs by having its processor control different software programs to run different use cases for simulation.
[0028] In some implementations, the software in an electronic device may include multiple code versions. The electronic device can identify a target software from these multiple software versions and simulate it to obtain evaluation metrics for the target software. Further, the electronic device can obtain the target evaluation metric by: acquiring an evaluation metric that changes during the simulation of multiple code versions of the target software; acquiring any evaluation metric acquired during the simulation of multiple code versions of the target software; or acquiring an evaluation metric of the same type as a pre-set evaluation metric in the electronic device during the simulation of multiple code versions of the target software. The target evaluation metric can be a quick response (QR) metric of the target software, a performance metric of the target software, etc. For example, the timing of the target software simulation, the chip area occupied by the entire logic of the target software simulation, the memory occupied by the target software simulation, etc. It is understood that the electronic device can obtain the target evaluation metric and then backtest the software version based on the target evaluation metric to improve the software quality.
[0029] Step S120: According to the preset indicator code relationship, obtain the set of preliminary screening test code versions corresponding to the target evaluation indicator, wherein the set of preliminary screening test code versions includes at least two test code versions, and the preset indicator code relationship includes the correspondence between the evaluation indicator and the code version.
[0030] In some implementations, the electronic device may have a pre-set preset indicator code relationship; the electronic device may also obtain the preset indicator code relationship from a related cloud or electronic device via wireless communication technology (e.g., WiFi, Bluetooth, Zigbee, etc.); the electronic device may also obtain the preset indicator code relationship from a related electronic device via a serial communication interface (e.g., a serial peripheral interface). The preset indicator code relationship may include a correspondence between evaluation indicators and code versions.
[0031] The correspondence between evaluation metrics and code versions can be a correspondence between software source code and various evaluation metrics. The software source code can include files, directories, etc. In some implementations, after acquiring the software source code and various evaluation metrics, the electronic device can establish a preset metric-code relationship based on the correspondence between each evaluation metric and code version. This preset metric-code relationship can be a mapping table including the correspondence between each evaluation metric and code version, or it can be a first dataset including the correspondence between each evaluation metric and code version. One software's source code can correspond to multiple evaluation metrics, and one evaluation metric type can correspond to the source code of multiple software programs.
[0032] In some implementations, after obtaining the target evaluation index, the electronic device can acquire a set of preliminary screening test code versions corresponding to the target evaluation index based on a preset index code relationship. Specifically, the electronic device can acquire the source code corresponding to the target evaluation index; further, the electronic device can acquire a source code version range corresponding to the source code, wherein the source code version range may include one or more code versions; further still, the electronic device uses all code versions within the source code version range as test code versions to construct a set of preliminary screening test code versions.
[0033] As one implementation method, the electronic device can obtain the target evaluation index by acquiring the changed evaluation index obtained by simulating the target software based on multiple code versions included in the target software. Further, the electronic device can obtain the source code corresponding to the target evaluation index according to a preset index-code relationship. Further still, the electronic device can obtain the commit record data of all versions within the source code version range from the software's logs as a second dataset, and obtain at least two test code versions based on this second dataset. Then, it can construct a preliminary test code version set based on these at least two test code versions; wherein the preliminary test code version set includes at least two test code versions; and wherein the commit record data may include a list of files submitted by each code version within the source code version range.
[0034] Step S130: Obtain target test cases based on the target evaluation indicators.
[0035] In some implementations, the electronic device may have one or more test cases pre-set; the electronic device may also obtain one or more test cases from an associated cloud or electronic device via wireless communication technology; the electronic device may also obtain one or more test cases from an associated electronic device via a serial communication interface. Optionally, after obtaining a test case, the electronic device may determine that test case as the target test case; after obtaining multiple test cases, the electronic device may determine one test case as the target test case from the multiple test cases, or it may determine multiple test cases as target test cases from the multiple test cases; wherein, the electronic device may determine multiple test cases as target test cases from the multiple test cases according to the type of the target evaluation indicator. For example, the electronic device may determine a set of target test cases for evaluating the target evaluation indicator as a third dataset according to the type of the target evaluation indicator.
[0036] In some implementations, the electronic device may determine a list of all code versions that affect the target evaluation metric based on a first dataset and a second dataset, and use this list as a fourth dataset.
[0037] Step S140: Filter the test code versions included in the initial screening test code version set to obtain the first test code version and the second test code version.
[0038] In some implementations, after obtaining the initial screening test code version set, the electronic device can sort the test code versions included in the initial screening test code version set according to the version number of each test code version. For example, the test code versions can be arranged in ascending order from smallest to largest version number, or in descending order from largest to smallest version number. In the embodiments of this application, the order of the test code versions in the initial screening test code version set is not limited.
[0039] In some implementations, after obtaining a preliminary set of test code versions, the electronic device can filter the test code versions included in the preliminary set to obtain a first test code version and a second test code version. Specifically, if the preliminary set of test code versions includes two test code versions, the electronic device can determine the first test code version as the first test code version and the last test code version as the second test code version.
[0040] In some implementations, if the initial screening test code version set includes more than two test code versions, the electronic device can obtain multiple initial screening test code version subsets by dividing the initial screening test code version set into two adjacent test code versions once based on the arrangement order of the test code versions in the initial screening test code version set. The first test code version in each initial screening test code version subset is determined as the first test code version, and the last test code version in the initial screening test code version set is determined as the second test code version.
[0041] In some implementations, if the initial screening test code version set includes more than two test code versions, the electronic device can perform a halving of the initial screening test code version set to obtain a first test code version and a second test code version. Specifically, the electronic device can perform this halving to obtain the first and second test code versions by: extracting and compiling code from the first test code version in the initial screening set, controlling the execution of target test cases for that test code version, and recording the first test data; and extracting and compiling code from the last test code version in the initial screening set, controlling the execution of target test cases for that test code version, and recording the last test data. Furthermore, the electronic device can construct a fifth dataset based on the first and last test data.
[0042] Furthermore, the electronic device can extract, compile, and control the execution of target test cases for intermediate test code versions in the initial screening test code version set, and record intermediate test data. The electronic device can compare the intermediate test data with the first and last test data respectively. If the similarity between the intermediate and first test data is less than a test similarity threshold, the initial screening test code version set is segmented. A new initial screening test code version set is constructed based on the test code versions from the first to the intermediate test code versions in the initial screening test code version set, and the step of determining whether to segment the newly constructed initial screening test code version set is returned. This process continues until the newly constructed initial screening test code version set includes two test code versions, and the first test code version in the newly constructed initial screening test code version set is designated as the first test code version, and the last test code version as the second test code version. If the similarity between the intermediate test data and the tail test data is less than the test similarity threshold, the initial screening test code version set is split. A new initial screening test code version set is constructed based on the test code versions from the intermediate test code version to the tail test code version in the initial screening test code version set, and the step of determining whether to split the newly constructed initial screening test code version set is returned. This process continues until the newly constructed initial screening test code version set includes two test code versions, and the first test code version in the newly constructed initial screening test code version set is taken as the first test code version, and the tail test code version is taken as the second test code version.
[0043] Understandably, using a binary split approach to process the initial screening test code version set of electronic devices can reduce the determination of invalid test code versions during the backtesting process, thereby improving the efficiency of backtesting based on evaluation metrics and saving test resources.
[0044] Step S150: Based on the target test case, determine the target test code version from the first test code version and the second test code version.
[0045] In some implementations, after the electronic device obtains the first test code version, the second test code version, and the target test case, it can determine the target test code version from the first test code version and the second test code version based on the target test case.
[0046] In some implementations, the electronic device can extract, compile, and run target test cases from a first test code version to obtain first simulation test data; the electronic device can also extract, compile, and run target test cases from a second test code version to obtain second simulation test data. Further, the electronic device can compare the first simulation test data with the second simulation test data. If the similarity between the first and second simulation test data is less than a simulation similarity threshold, the second test case is determined as the target test code version; or if the similarity between the first and second simulation test data is greater than or equal to the simulation similarity threshold, the first test case is determined as the target test code version. Further, the electronic device can construct a target list that influences the target evaluation index as a sixth dataset based on the obtained multiple target test code versions and the first test code version in the initial screening test code version set. The test codes in this target list can be arranged in ascending order according to their version numbers.
[0047] Step S160: Based on the target test cases and the target test code version, obtain a backtracking report, wherein the backtracking report is used to characterize the impact of the target test code version on the target evaluation index.
[0048] In some implementations, after the electronic device obtains the target test code version, it can obtain a backtracking report based on the target test cases and the target test code version; wherein, the backtracking report is used to characterize the impact of the target test code version on the target evaluation metrics.
[0049] In some implementations, the electronic device can extract, compile, and run target test cases on the target test code version to obtain test data for the target test code version. Furthermore, the electronic device can calculate the contribution rate of each target test code version to the target evaluation metric based on the test data of all target test code versions. For example, the electronic device can calculate the average, median, mode, and arithmetic mean of the test data for all target test code versions as the contribution rate of each target test code version to the target evaluation metric and generate a backtracking report. The backtracking report may also include files and directories for each target test code version.
[0050] For example, please refer to Figure 2This document illustrates a flowchart of a software testing method provided in an embodiment of this application. After acquiring target evaluation metrics, the electronic device can proceed to a preprocessing stage for backtracking software testing based on these metrics. In this preprocessing stage, the electronic device can obtain a preliminary set of test code versions based on the target evaluation metrics and preset metric-code relationships. Specifically, the electronic device can preliminarily screen test code versions based on the correspondence between the target evaluation metrics and source code, as well as source code submission records. Further, after obtaining the preliminary set of test code versions, the electronic device can proceed to an iterative backtracking stage in the backtracking process based on the target evaluation metrics. In this iterative backtracking stage, the electronic device can iteratively process the preliminary set of test code versions using a binary split approach, and acquire, compile, and run target test cases for the test code versions in the preliminary set to obtain test data. It can then further obtain the target test code version based on this test data. Finally, after obtaining the target test code version, the electronic device can proceed to the data generation and report generation stage in the backtracking process based on the target evaluation metrics. In the data generation and report generation phase, the electronic device can obtain a backtracking report based on the target test cases and the target test code version. In other words, the electronic device can analyze the test data of all target test code versions running the target test cases and generate a backtracking report.
[0051] Understandably, electronic devices perform range version pre-screening based on the relationship between target evaluation metrics and source code, as well as version submission records. During the backtracking testing of the software, a binary splitting method is used to obtain the target test code version, reducing the testing and confirmation of invalid code versions that have no impact on the target evaluation metrics. This greatly improves the efficiency of the backtracking testing software and enhances the user experience.
[0052] An embodiment of this application provides a software testing method that involves: obtaining a target evaluation metric; obtaining a preliminary set of test code versions corresponding to the target evaluation metric based on a preset metric-code relationship, wherein the preliminary set of test code versions includes at least two test code versions, and the preset metric-code relationship includes a correspondence between the evaluation metric and the code version; obtaining target test cases based on the target evaluation metric; filtering the test code versions included in the preliminary set of test code versions to obtain a first test code version and a second test code version; determining a target test code version from the first and second test code versions based on the target test cases; and obtaining a backtracking report based on the target test cases and the target test code version, wherein the backtracking report is used to characterize the impact of the target test code version on the target evaluation metric, thereby automatically backtracking the code version of the tested software through the relationship between the evaluation metric and the software code, reducing the testing confirmation of invalid code versions, and improving the efficiency of backtracking the tested software.
[0053] Please see Figure 3 , Figure 3 A flowchart illustrating a software testing method according to an embodiment of this application is shown. This method is applied to the aforementioned electronic device, and will be discussed below. Figure 3 The process shown will be described in detail. The software testing method may specifically include the following steps:
[0054] Step S210: Obtain target evaluation indicators.
[0055] For a detailed description of step S210, please refer to the previous description of step S110, which will not be repeated here.
[0056] Step S220: According to the preset indicator code relationship, obtain the set of preliminary screening test code versions corresponding to the target evaluation indicator, wherein the set of preliminary screening test code versions includes at least two test code versions, and the preset indicator code relationship includes the correspondence between the evaluation indicator and the code version.
[0057] In some implementations, after obtaining the target evaluation index, the electronic device can initially screen all test code versions that have an impact on the target evaluation index based on the correspondence between the target evaluation index and the software source code and the source code version submission record. In other words, the electronic device can obtain the initial set of test code versions corresponding to the target evaluation index based on the preset index code relationship.
[0058] In some implementations, please refer to Figure 4 Step S220 may include steps S221-S222.
[0059] Step S221: Obtain the submission record data corresponding to the code version in the preset indicator code relationship.
[0060] In some implementations, the electronic device may have a pre-set mapping table between evaluation metrics and source code files, i.e., a preset metric-code relationship, which can be stored in a preset mapping data file within the electronic device. This mapping data file can also be understood as a software source code repository; the software source code repository may also store logs of the software source code; and the software source code logs may include commit record data for the version range of the software source code.
[0061] Among them, the electronic device can extract the commit record data of the software source code corresponding to the target evaluation index from the software source code repository, that is, extract all code commit information of the backtracking version range, that is, obtain the commit record data corresponding to the code version in the preset index code relationship, and further save it in the preset version commit information file in the electronic device.
[0062] Step S222: Based on the preset indicator code relationship and the submission record data, obtain the initial screening test code version set corresponding to the target evaluation indicator.
[0063] In some implementations, after obtaining the commit record data corresponding to the code versions in the preset indicator code relationship, the electronic device can obtain a preliminary set of test code versions corresponding to the target evaluation indicator based on the preset indicator code relationship and the commit record data. Specifically, the electronic device can compare the source code version submission information in the commit record data with the preset indicator code relationship to determine all commit records that affect the target evaluation indicator, generating a list of versions to be backtracked, i.e., the preliminary set of test code versions. Alternatively, the electronic device can add the first code version of the source code version range to all the commit records that affect the target evaluation indicator, and then sort the test code versions in ascending order of the version numbers of the test code versions that affect the target evaluation indicator, thus obtaining the preliminary set of test code versions. In other words, the electronic device can pre-screen code commit versions that may affect the evaluation indicator based on the correspondence between the evaluation indicator and the source code, as well as the commit records in the software source code repository, thereby reducing the testing and confirmation of invalid test code versions and lowering the power consumption of the electronic device.
[0064] Step S230: Obtain target test cases according to the type of the target evaluation index.
[0065] In some implementations, the electronic device can obtain target test cases based on the type of the target evaluation metric. The type of target evaluation metric may include QR evaluation metric types and software performance metric types, which are not limited here. Target test cases may include one or more, which are not limited here, and the electronic device can obtain a target test case set based on multiple target test cases.
[0066] Step S240: Filter the test code versions included in the initial screening test code version set to obtain the first test code version and the second test code version.
[0067] In some implementations, after obtaining a preliminary set of test code versions, the electronic device can filter the test code versions included in the preliminary set to obtain a first test code version and a second test code version. Specifically, the electronic device can iteratively backtrack and confirm the test code versions in the preliminary set using a binary splitting approach, gradually narrowing down the screening range of the preliminary set to obtain the first and second test code versions.
[0068] In some implementations, the initial screening test code version set includes at least two test code versions arranged in ascending order based on the version number of each test code version. Further, step S240 may include step S2410 or step S2420.
[0069] Step S2410: If the initial screening test code version set includes two test code versions, then the first test code version in the initial screening test code version set is determined as the first test code version, and the last test code version in the initial screening test code version set is determined as the second test code version.
[0070] In some implementations, if the electronic device obtains two test code versions from the initial screening test code version set, the electronic device may further determine the first test code version in the initial screening test code version set as the first test code version, and determine the last test code version in the initial screening test code version set as the second test code version.
[0071] Step S2420: If the initial screening test code version set includes more than two test code versions, then based on the target test case, the test code versions included in the initial screening test code version set are filtered to obtain the first test code version and the second test code version.
[0072] In some implementations, if the electronic device obtains a preliminary set of test code versions including more than two test code versions, the electronic device can further filter the test code versions included in the preliminary set of test code versions based on the target test cases to obtain a first test code version and a second test code version.
[0073] In some implementations, please refer to Figure 5 Step S2420 may include steps S2421-S2423.
[0074] Step S2421: If the initial screening test code version set includes more than two test code versions, then obtain the first evaluation test data obtained by running the target test case on the first test code version in the initial screening test code version set, obtain the second evaluation test data obtained by running the target test case on the last test code version in the initial screening test code version set, and obtain the third evaluation test data obtained by running the target test case on the middle test code version in the initial screening test code version set.
[0075] In some implementations, if the electronic device obtains more than two test code versions in the initial screening test code version set, the electronic device may further obtain the first evaluation test data obtained by running the target test case of the first test code version in the initial screening test code version set, the second evaluation test data obtained by running the target test case of the last test code version in the initial screening test code version set, and the third evaluation test data obtained by running the target test case of the middle test code version in the initial screening test code version set.
[0076] Step S2422: If the similarity between the third evaluation test data and the first evaluation test data is less than the first similarity threshold, then a new set of initial screening test code versions is constructed based on the test code versions from the first test code version to the intermediate test code version in the initial screening test code version set. The step of determining the number of test code versions included in the newly constructed set of initial screening test code versions is repeated until the newly constructed set of initial screening test code versions includes two test code versions. Then, the first test code version in the newly constructed set of initial screening test code versions is determined as the first test code version, and the last test code version in the newly constructed set of initial screening test code versions is determined as the second test code version.
[0077] In some implementations, after obtaining the first test data, the second test data, and the third test data, the electronic device can compare the third test data with the first test data and the second test data, respectively. If the similarity between the third evaluation test data and the first evaluation test data is less than a first similarity threshold, a new set of initial screening test code versions is constructed based on the test code versions from the first test code version to the intermediate test code versions in the initial screening test code version set. The step of determining the number of test code versions included in the newly constructed set of initial screening test code versions is repeated until the newly constructed set of initial screening test code versions includes two test code versions. At this point, the first test code version in the newly constructed set of initial screening test code versions is determined as the first test code version, and the last test code version in the newly constructed set of initial screening test code versions is determined as the second test code version.
[0078] Step S2423: If the similarity between the third evaluation test data and the second evaluation test data is less than the first similarity threshold, then a new set of initial screening test code versions is constructed based on the test code versions from the middle test code version to the tail test code version in the initial screening test code version set. The step of determining the number of test code versions included in the newly constructed set of initial screening test code versions is repeated until the newly constructed set of initial screening test code versions includes two test code versions. Then, the first test code version in the newly constructed set of initial screening test code versions is determined as the first test code version, and the tail test code version in the newly constructed set of initial screening test code versions is determined as the second test code version.
[0079] In some implementations, after obtaining the first test data, the second test data, and the third test data, the electronic device can compare the third test data with the first test data and the second test data, respectively. If the similarity between the third evaluation test data and the second evaluation test data is less than a first similarity threshold, a new set of initial screening test code versions is constructed based on the test code versions from the middle to the end of the initial screening test code version set. The step of determining the number of test code versions included in the newly constructed set is repeated until the new set includes two test code versions. At this point, the first test code version in the new set is determined as the first test code version, and the last test code version is determined as the second test code version.
[0080] It is understood that step S2423 can be performed before or after step S2422, and steps S2423 and S2422 can also be performed simultaneously. In the embodiments of this application, the execution order of steps S2423 is not limited.
[0081] Step S250: Based on the target test case, determine the target test code version from the first test code version and the second test code version.
[0082] In some implementations, after obtaining the first test code version and the second test code version, the electronic device can determine the target test code version from the first test code version and the second test code version based on the target test cases. Specifically, after obtaining the first test code version and the second test code version, the electronic device can sequentially acquire, compile, and run the target test cases on the first test code version and the second test code version to obtain test data, and then determine the target test code version from the first test code version and the second test code version based on the test data.
[0083] In some implementations, step S250 may include steps S251, S252 and S253 or steps S251, S252 and S254.
[0084] Step S251: Obtain the fourth evaluation test data obtained by running the target test case in the first test code version.
[0085] In some implementations, the electronic device can acquire, compile, and run target test cases on the first test code version to obtain fourth evaluation test data. In some implementations, there may be multiple target test cases, and the corresponding fourth evaluation test data may be the average, median, mode, etc., of the test data obtained by acquiring, compiling, and running target test cases on the first test code version, which is not limited here.
[0086] Step S252: Obtain the fifth evaluation test data obtained by running the target test case in the second test code version.
[0087] In some implementations, the electronic device can acquire, compile, and run target test cases on the second test code version to obtain fifth evaluation test data.
[0088] Step S253: If the similarity between the fourth evaluation test data and the fifth evaluation test data is greater than the second similarity threshold, then the first test code version is determined as the target test code version.
[0089] In some implementations, after the electronic device obtains the fourth evaluation test data and the fifth evaluation test data, it can compare the fourth evaluation test data with the fifth evaluation test data. If the similarity between the fourth evaluation test data and the fifth evaluation test data is greater than the second similarity threshold, then the first test code version is determined as the target test code version.
[0090] Step S254: If the similarity between the fourth evaluation test data and the fifth evaluation test data is less than or equal to the second similarity threshold, then the second test code version is determined as the target test code version.
[0091] In some implementations, after the electronic device obtains the fourth evaluation test data and the fifth evaluation test data, it can compare the fourth evaluation test data with the fifth evaluation test data. If the similarity between the fourth evaluation test data and the fifth evaluation test data is less than or equal to a second similarity threshold, then the second test code version is determined as the target test code version.
[0092] For example, please refer to Figure 6 This document illustrates a flowchart illustrating a method for obtaining a target test code version by halving a set of initially screened test code versions, according to an embodiment of this application. The electronic device can generate initial slices based on the initially screened test code version set and construct an initial slice list. Specifically, in the first step, the electronic device uses the initially screened test code version set as the initial slice and constructs an initial slice list including the initial slices. Further, in the second step, if the slice list is empty, the process ends; if the slice list is not empty, the process proceeds to the third step, constructing a new empty slice list to store the new slices, and proceeding to the fourth step. In the fourth step, all slices in the existing slice list are processed sequentially. The processing steps include steps four through eleven. If a slice contains only two test code versions, the process jumps to the fifth step; otherwise, it jumps to the eighth step.
[0093] In the process, step 5 involves the following steps: if the test data obtained by running the target test cases on the first and last test code versions of the slice are the same, proceed to step 6; otherwise, proceed to step 7. Step 6 determines the first test code version of the slice as the target test code version, adds it to the list of versions affecting the evaluation metrics, and proceeds to step 11. Step 7 determines the last test code version of the slice as the target test code version, adds it to the list of versions affecting the evaluation metrics, and proceeds to step 11. Step 8 involves acquiring, compiling, and running the target test cases on the intermediate test code versions within the slice, saving the test data, and then proceeding to step 9. Step 9 involves the following steps: if the evaluation metric test data of the intermediate test code version and the first test code version of the slice are different, a new slice is generated from the first test code version to the intermediate test code version of the slice, the new slice is added to a new slice list, and proceeds to step 10.
[0094] In step ten, if the test data of the intermediate test code version and the end test code version of the slice are different, a new slice is generated from the intermediate test code version to the end test code version, and the process jumps to step eleven. In step eleven, if all slices in the current slice list have been processed, the process jumps to step twelfth; otherwise, it jumps to step four to continue processing the next slice. In step twelfth, the existing slice list is replaced with the new slice list, and the process jumps to step two.
[0095] Step S260: Based on the target test cases and the target test code version, obtain a backtracking report, wherein the backtracking report is used to characterize the impact of the target test code version on the target evaluation index.
[0096] In some implementations, after obtaining the target test cases, the electronic device can generate a backtracking report based on the target test cases and the target test code version. Specifically, the electronic device can pre-save test data from backtracking confirmation of the target test code version running the target test cases; furthermore, the electronic device can use this test data to determine the degree of influence of each target test code version on the target evaluation metrics.
[0097] In some implementations, please refer to Figure 7 Step S260 may include steps S2610-S2630.
[0098] Step S2610: Sort the target test code versions in ascending order according to the version number of the target test code version to obtain the impact evaluation index version list.
[0099] In some implementations, the target test code versions obtained by the electronic device may include one or more; further, the electronic device may sort the obtained target test code versions in ascending order according to their version numbers to obtain a list of impact evaluation indicator versions. The electronic device may also add the first test version of the source code version range corresponding to the target evaluation indicator to this impact evaluation indicator version list as the initial first test code of the evaluation indicator version list.
[0100] Step S2620: Obtain test data of the target test code version running the target test case.
[0101] In some implementations, after obtaining the impact evaluation index version list, the electronic device can obtain the test data of all test code versions in the impact evaluation index version list running the target test cases, that is, obtain the test data of the target test code version running the target test cases.
[0102] Step S2630: Based on the list of impact assessment indicator versions and the test data, obtain the backtracking report.
[0103] In some implementations, after the electronic device obtains the list of impact assessment indicator versions and the test data of all test code versions in the list running the target test cases, it can obtain a backtracking report based on the list of impact assessment indicator versions and the test data.
[0104] In some implementations, please refer to Figure 8 Step S2630 may include steps S2631-S2632.
[0105] Step S2631: Obtain the ratio of test data of adjacent target test code versions in the impact evaluation index version list.
[0106] In some implementations, after the electronic device obtains the list of impact evaluation index versions and the test data of all test code versions in the list running the target test cases, it can obtain the ratio of the test data of adjacent target test code versions in the impact evaluation index version list. That is, the electronic device can compare the changes in the test data of adjacent target test code versions in turn. By obtaining the ratio of the test data of adjacent target test code versions in the impact evaluation index version list, that is, the ratio of the test data of the target test code version with the higher version number to the test data of the lower version number, it can be used as the degree of influence of the target test code version with the higher version number on the target evaluation index.
[0107] Step S2632: Obtain the backtracking report based on the ratio.
[0108] In some implementations, after obtaining the ratio of test data for adjacent target test code versions in the impact evaluation indicator version list, the electronic device can generate a backtracking report based on this ratio. Specifically, the electronic device can sequentially compare the changes in test data for adjacent target test code versions, and by obtaining the ratio of test data for adjacent target test code versions in the impact evaluation indicator version list, it can use the higher version number of the adjacent target test code versions as the degree of influence on the target evaluation indicator. Furthermore, the electronic device can combine the submission record data and the degree of influence for each target test code version to generate a backtracking report characterizing the impact of the target test code version on the target evaluation indicator.
[0109] The software testing method provided in one embodiment of this application is compared to... Figure 1The software testing method described also obtains target test cases based on the type of the target evaluation metric, and automatically backtracks the test software code version by analyzing the relationship between the evaluation metric and the software code. This reduces the need to test invalid code versions and improves the efficiency of backtracking the test software. Furthermore, by obtaining target test cases based on the type of the target evaluation metric, and specifically acquiring test cases corresponding to the type of the target evaluation metric, test data is obtained, improving the accuracy of software testing, reducing the energy consumption of invalid tests, and enhancing the user experience.
[0110] Please see Figure 9 , Figure 9 A block diagram of a software testing apparatus according to an embodiment of this application is shown. This software testing apparatus 200 is applied to the aforementioned electronic device. The following will focus on... Figure 9 The process is described in detail below. The software testing apparatus 200 includes: a target evaluation metric acquisition module 210, an initial test code version set acquisition module 220, a target test case acquisition module 230, a filtering module 240, a target test code version determination module 250, and a backtracking report acquisition module 260, wherein:
[0111] The target evaluation index acquisition module 210 is used to acquire target evaluation indicators.
[0112] The initial screening test code version set acquisition module 220 is used to acquire the initial screening test code version set corresponding to the target evaluation indicator according to the preset indicator code relationship. The initial screening test code version set includes at least two test code versions, and the preset indicator code relationship includes the correspondence between the evaluation indicator and the code version.
[0113] The target test case acquisition module 230 is used to acquire target test cases based on the target evaluation indicators.
[0114] The filtering module 240 is used to filter the test code versions included in the initial screening test code version set to obtain the first test code version and the second test code version.
[0115] The target test code version determination module 250 is used to determine the target test code version from the first test code version and the second test code version based on the target test case.
[0116] The backtracking report acquisition module 260 is used to obtain a backtracking report based on the target test cases and the target test code version, wherein the backtracking report is used to characterize the impact of the target test code version on the target evaluation index.
[0117] Furthermore, the at least two test code versions included in the initial screening test code version set are arranged in ascending order based on the version number of each test code version, and the screening module 240 may include: a first screening module or a second screening module, wherein:
[0118] The first screening module is used to determine the first test code version in the initial screening test code version set as the first test code version and the last test code version in the initial screening test code version set as the second test code version if the initial screening test code version set includes two test code versions.
[0119] The second filtering module is used to filter the test code versions included in the initial screening test code version set based on the target test case if the initial screening test code version set includes more than two test code versions, thereby obtaining the first test code version and the second test code version.
[0120] Furthermore, the second filtering module 230 may include: a test data acquisition unit, a first filtering unit, and a second filtering unit, wherein:
[0121] The test data acquisition unit is configured to, if the initial screening test code version set includes more than two test code versions, acquire the first evaluation test data obtained by running the target test case on the first test code version in the initial screening test code version set, acquire the second evaluation test data obtained by running the target test case on the last test code version in the initial screening test code version set, and acquire the third evaluation test data obtained by running the target test case on the middle test code version in the initial screening test code version set.
[0122] The first screening unit is configured to, if the similarity between the third evaluation test data and the first evaluation test data is less than a first similarity threshold, construct a new set of initial screening test code versions based on the test code versions from the first test code version to the intermediate test code version in the initial screening test code version set, and repeat the step of determining the number of test code versions included in the newly constructed set of initial screening test code versions until the newly constructed set of initial screening test code versions includes two test code versions, then determine the first test code version in the newly constructed set of initial screening test code versions as the first test code version, and determine the last test code version in the newly constructed set of initial screening test code versions as the second test code version.
[0123] The second screening unit is configured to, if the similarity between the third evaluation test data and the second evaluation test data is less than the first similarity threshold, construct a new initial screening test code version set based on the test code versions from the middle test code version to the tail test code version in the initial screening test code version set, and repeat the step of determining the number of test code versions included in the newly constructed initial screening test code version set until the newly constructed initial screening test code version set includes two test code versions, then determine the first test code version in the newly constructed initial screening test code version set as the first test code version, and determine the tail test code version in the newly constructed initial screening test code version set as the second test code version.
[0124] Further, the target test code version determination module 250 may include: a fourth evaluation test data acquisition unit, a fifth evaluation test data acquisition unit, and a target test code version determination subunit, wherein:
[0125] The fourth evaluation test data acquisition unit is used to acquire the fourth evaluation test data obtained by running the target test case in the first test code version.
[0126] The fifth evaluation test data acquisition unit is used to acquire the fifth evaluation test data obtained by running the target test case in the second test code version.
[0127] The target test code version determination subunit is used to determine the first test code version as the target test code version if the similarity between the fourth evaluation test data and the fifth evaluation test data is greater than a second similarity threshold; or
[0128] If the similarity between the fourth evaluation test data and the fifth evaluation test data is less than or equal to the second similarity threshold, then the second test code version is determined as the target test code version.
[0129] Further, the initial test code version set acquisition module 220 may include: a commit record data acquisition unit and an initial test code version set acquisition unit, wherein:
[0130] The submission record data acquisition unit is used to acquire the submission record data corresponding to the code version in the preset indicator code relationship.
[0131] The initial test code version set acquisition unit is used to obtain the initial screening test code version set corresponding to the target evaluation indicator based on the preset indicator code relationship and the submission record data.
[0132] Furthermore, the backtracking report acquisition module 260 may include: an impact evaluation indicator version list acquisition unit, a test data acquisition unit, and a backtracking report acquisition unit, wherein:
[0133] The impact evaluation index version list acquisition unit is used to sort the target test code versions in ascending order according to the version number of the target test code version to obtain the impact evaluation index version list.
[0134] The test data acquisition unit is used to obtain test data of the target test code version running the target test cases.
[0135] The retrospective report acquisition unit is used to obtain the retrospective report based on the list of impact assessment indicator versions and the test data.
[0136] Furthermore, the backtracking report acquisition unit may include: a ratio acquisition unit and a backtracking report acquisition subunit, wherein:
[0137] The ratio acquisition unit is used to acquire the ratio of test data of adjacent target test code versions in the impact evaluation index version list.
[0138] A backtracking report acquisition subunit is used to obtain the backtracking report based on the ratio.
[0139] Furthermore, the target test case acquisition module 230 may include: a target test case acquisition submodule, wherein:
[0140] The target test case acquisition submodule is used to obtain the target test cases according to the type of the target evaluation metric.
[0141] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0142] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.
[0143] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0144] Please see Figure 10This document illustrates a structural block diagram of an electronic device according to an embodiment of this application. The electronic device 100 can be a smartphone, tablet computer, e-reader, or other electronic device capable of running applications. The electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications can be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more applications are configured to perform the methods described in the foregoing method embodiments.
[0145] The processor 110 may include one or more processing cores. The processor 110 connects to various parts within the electronic device 100 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and by calling data stored in the memory 120. Optionally, the processor 110 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 110 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 110 and may be implemented separately using a communication chip.
[0146] The memory 120 may include random access memory (RAM) or read-only memory (ROM). The memory 120 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the electronic device 100 during use (such as phonebook data, audio and video data, chat log data, etc.).
[0147] Please see Figure 11This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 300 stores program code that can be invoked by a processor to execute the methods described in the above method embodiments.
[0148] The computer-readable storage medium 300 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 300 has storage space for program code 310 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 310 may be compressed, for example, in a suitable form.
[0149] In summary, the software testing method, apparatus, electronic device, and storage medium provided in this application obtain target evaluation metrics; obtain a set of initial screening test code versions corresponding to the target evaluation metrics according to a preset index code relationship, wherein the set of initial screening test code versions includes at least two test code versions, and the preset index code relationship includes the correspondence between evaluation metrics and code versions; obtain target test cases according to the target evaluation metrics; filter the test code versions included in the set of initial screening test code versions to obtain a first test code version and a second test code version; determine the target test code version from the first test code version and the second test code version based on the target test cases; and obtain a backtracking report based on the target test cases and the target test code version, wherein the backtracking report is used to characterize the impact of the target test code version on the target evaluation metrics, thereby automatically backtracking the software code version through the relationship between evaluation metrics and software code, reducing the testing confirmation of invalid code versions, and improving the efficiency of backtracking software testing.
[0150] Finally, it should be noted that the above 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.
Claims
1. A software testing method, characterized in that, The method includes: Obtain target evaluation indicators; According to the preset indicator code relationship, obtain the set of preliminary screening test code versions corresponding to the target evaluation indicator, wherein the set of preliminary screening test code versions includes at least two test code versions, and the preset indicator code relationship includes the correspondence between the evaluation indicator and the code version; Based on the target evaluation metrics, obtain the target test cases; Based on the binary splitting method, the test code versions included in the initial screening test code version set are filtered to obtain the first test code version and the second test code version. Based on the target test cases, the target test code version is determined from the first test code version and the second test code version; Based on the target test cases and the target test code version, a backtracking report is obtained, wherein the backtracking report is used to characterize the impact of the target test code version on the target evaluation metric.
2. The method according to claim 1, characterized in that, The initial screening test code version set includes at least two test code versions arranged in ascending order based on the version number of each test code version. The step of filtering the test code versions included in the initial screening test code version set to obtain a first test code version and a second test code version includes: If the initial screening test code version set includes two test code versions, then the first test code version in the initial screening test code version set is determined as the first test code version, and the last test code version in the initial screening test code version set is determined as the second test code version; or If the initial screening test code version set includes more than two test code versions, then based on the target test case, the test code versions included in the initial screening test code version set are filtered to obtain the first test code version and the second test code version.
3. The method according to claim 2, characterized in that, If the initial screening test code version set includes more than two test code versions, then based on the target test case, the test code versions included in the initial screening test code version set are filtered to obtain the first test code version and the second test code version, including: If the initial screening test code version set includes more than two test code versions, then the first evaluation test data obtained by running the target test case on the first test code version in the initial screening test code version set, the second evaluation test data obtained by running the target test case on the last test code version in the initial screening test code version set, and the third evaluation test data obtained by running the target test case on the middle test code version in the initial screening test code version set. If the similarity between the third evaluation test data and the first evaluation test data is less than the first similarity threshold, then a new set of initial screening test code versions is constructed based on the test code versions from the first test code version to the intermediate test code version in the initial screening test code version set. The step of determining the number of test code versions included in the newly constructed set of initial screening test code versions is repeated until the newly constructed set of initial screening test code versions includes two test code versions. Then, the first test code version in the newly constructed set of initial screening test code versions is determined as the first test code version, and the last test code version in the newly constructed set of initial screening test code versions is determined as the second test code version. If the similarity between the third evaluation test data and the second evaluation test data is less than the first similarity threshold, a new set of initial screening test code versions is constructed based on the test code versions from the middle test code version to the tail test code version in the initial screening test code version set. The step of determining the number of test code versions included in the newly constructed set of initial screening test code versions is repeated until the newly constructed set of initial screening test code versions includes two test code versions. Then, the first test code version in the newly constructed set of initial screening test code versions is determined as the first test code version, and the tail test code version in the newly constructed set of initial screening test code versions is determined as the second test code version.
4. The method according to claim 1, characterized in that, Determining the target test code version from the first test code version and the second test code version based on the target test case includes: Obtain the fourth evaluation test data obtained by running the target test case in the first test code version; Obtain the fifth evaluation test data obtained by running the target test case in the second test code version; If the similarity between the fourth evaluation test data and the fifth evaluation test data is greater than the second similarity threshold, then the first test code version is determined as the target test code version; or If the similarity between the fourth evaluation test data and the fifth evaluation test data is less than or equal to the second similarity threshold, then the second test code version is determined as the target test code version.
5. The method according to claim 1, characterized in that, The step of obtaining the initial screening test code version set corresponding to the target evaluation index according to the preset index code relationship includes: Obtain the commit record data corresponding to the code version in the preset indicator code relationship; Based on the preset indicator code relationship and the submission record data, obtain the initial screening test code version set corresponding to the target evaluation indicator.
6. The method according to claim 1, characterized in that, The backtracking report obtained based on the target test case and the target test code version includes: Arrange the target test code versions in ascending order according to the version number of the target test code version to obtain the version list of impact evaluation indicators; Obtain test data from running the target test cases on the target test code version; Based on the list of impact assessment indicator versions and the test data, the backtracking report is obtained.
7. The method according to claim 6, characterized in that, The process of obtaining the backtracking report based on the list of impact assessment indicator versions and the test data includes: Obtain the ratio of test data for adjacent target test code versions in the impact evaluation index version list; The backtracking report is obtained based on the ratio.
8. The method according to claim 1, characterized in that, The step of obtaining target test cases based on the target evaluation metrics includes: Based on the type of the target evaluation metric, the target test cases are obtained.
9. A software testing apparatus, characterized in that, The device includes: The target evaluation index acquisition module is used to acquire target evaluation indexes; The initial screening test code version set acquisition module is used to acquire the initial screening test code version set corresponding to the target evaluation indicator according to the preset indicator code relationship. The initial screening test code version set includes at least two test code versions. The preset indicator code relationship includes the correspondence between the evaluation indicator and the code version. The target test case acquisition module is used to acquire target test cases based on the target evaluation metrics. The filtering module is used to filter the test code versions included in the initial screening test code version set based on a binary splitting method to obtain a first test code version and a second test code version. The target test code version determination module is used to determine the target test code version from the first test code version and the second test code version based on the target test case; The backtracking report acquisition module is used to obtain a backtracking report based on the target test case and the target test code version, wherein the backtracking report is used to characterize the impact of the target test code version on the target evaluation metric.
10. An electronic device, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the method as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Black box regression test method
CN107193739A
Regression test method and system
CN110069414A