Application software testing method, device and electronic equipment

By separately testing and weighting the M functional modules in the application software, the problem in the existing technology that the test coverage cannot accurately reflect the effectiveness of a single functional module is solved, and the accuracy of the test and coverage is improved.

CN112256553BActive Publication Date: 2024-10-29BAIDU (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910660422.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-22
Publication Date
2024-10-29
Estimated Expiration
2039-07-22

AI Technical Summary

Technical Problem

The coverage rate of application software testing in the existing technology is generally based on the entire code, which cannot accurately reflect the testing effectiveness of a single functional module, resulting in low testing accuracy.

Method used

By testing M functional modules in the application software under test based on N test cases respectively, the target coverage is calculated based on the weight and coverage of the functional modules, and the test results are determined.

Benefits of technology

It realizes the accuracy and effectiveness evaluation of single functional module testing of application software, and improves the accuracy of test results and the accuracy of coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112256553B_ABST
    Figure CN112256553B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and provides an application software testing method, device and electronic device to solve the problem of low test accuracy. The method comprises: testing the application software to be tested based on N first test cases, determining the coverage rates corresponding to M functional modules in the application software to be tested, wherein N and M are both integers greater than 1; obtaining the target coverage rate of the application software to be tested according to the first weights and coverage rates corresponding to the M functional modules; and determining the test results of the application software to be tested based on the target coverage rate. The target coverage rate is determined by using the coverage rates corresponding to the M functional modules in the application software to be tested and the first weights, that is, the effectiveness of the test of the individual functional modules and the weight of each functional module are taken into consideration, so that the obtained target coverage rate can accurately reflect the effectiveness of the test of a single functional module in the application software to be tested, making the target coverage rate more accurate, thereby making the test result more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an application software testing method, device, electronic equipment and computer-readable storage medium. Background Art

[0002] With the continuous development of computer technology, various application software emerge in an endless stream, and the speed of application software version iteration is also getting faster and faster, which has brought great convenience to users' work and life. In order to ensure the quality of the new version and avoid the impact of the new functional modules added to the new version on the original functional modules, it is necessary to test the new version before the new version (iteration version) is launched, for example, regression testing. Among them, the coverage of the test is an important indicator to measure the effectiveness of the test. If the coverage meets the requirements, the test is considered to have passed, and the new version can be launched later. Take the network disk (an online storage service, that is, the disk space divided for users, providing users with file storage, access, backup, sharing and other file management functions for free or for a fee) as an example. In the process of regression testing its iterative version, 60% coverage can be used as a benchmark. If it is greater than 60%, it is confirmed that this test has passed, and the iterative version of the network disk will be launched later.

[0003] However, the current test coverage is generally expressed as the coverage of the entire code of the new version by the executed code obtained after testing the entire new version through test cases. That is, the coverage is calculated based on the overall code and the executed code obtained after the test. This cannot accurately reflect the effectiveness of the test of a single functional module in the application software, that is, it is impossible to obtain accurate coverage, which can easily lead to low test accuracy. Summary of the invention

[0004] The embodiments of the present invention provide an application software testing method, device, electronic device and computer-readable storage medium to solve the problem of low testing accuracy in the prior art.

[0005] In a first aspect, an embodiment of the present invention provides an application software testing method, the method comprising:

[0006] Testing the application software to be tested based on N first test cases to determine the coverage rates corresponding to M functional modules in the application software to be tested, wherein N and M are both integers greater than 1;

[0007] Obtaining a target coverage rate of the application software to be tested according to the first weights and coverage rates respectively corresponding to the M functional modules;

[0008] A test result of the application software to be tested is determined based on the target coverage.

[0009] Optionally, the M functional modules include a first functional module and a second functional module;

[0010] Before testing the application software to be tested based on the N first test cases, the method includes:

[0011] Determining a first weight of the first functional module according to a first parameter of the first functional module, where the first parameter is a preset parameter;

[0012] A first weight of the second functional module is determined according to a second parameter of the second functional module, where the second parameter includes a basic parameter and an influencing parameter.

[0013] Optionally, determining the first weight of the second functional module according to the second parameter of the second functional module includes:

[0014] Determining a basic weight of the second functional module according to the basic parameter of the second functional module;

[0015] Based on the influence parameter of the second functional module, the basic weight of the second functional module is adjusted to obtain the first weight of the second functional module.

[0016] Optionally, the first parameter includes a first preset function importance, the basic parameter includes at least one of a second preset function importance, historical usage frequency and historical vulnerability volume, and the influencing parameter includes at least one of the number of code lines associated with the first functional module, the number of functions associated with the first functional module and the code defect rate of the first functional module.

[0017] Optionally, after determining the first weight of the second functional module according to the second parameter of the second functional module and before testing the application software to be tested based on the N first test cases, the method further includes:

[0018] Obtain test case sets corresponding to the M functional modules respectively, wherein the test case sets include at least one test case;

[0019] According to the first weights respectively corresponding to the M functional modules, test case screening is performed on the test case sets respectively corresponding to the M functional modules to obtain the N first test cases.

[0020] Optionally, obtaining a target coverage rate according to the first weights and coverage rates respectively corresponding to the M functional modules includes:

[0021] Performing weighted sum processing on the first weights and coverage rates respectively corresponding to the M functional modules to obtain a first target value;

[0022] Summing the first weights corresponding to the M functional modules respectively to obtain a second target value;

[0023] The target coverage is obtained according to the first target value and the second target value, and the target coverage is proportional to the first target value and inversely proportional to the second target value.

[0024] In a second aspect, an embodiment of the present invention further provides an application software testing device, comprising:

[0025] A module coverage determination module, used to test the application software to be tested based on N first test cases, and determine the coverage rates corresponding to M functional modules in the application software to be tested, wherein N and M are both integers greater than 1;

[0026] A target coverage determination module, used to obtain the target coverage of the application software to be tested according to the first weights and coverages respectively corresponding to the M functional modules;

[0027] A test result determination module is used to determine the test result of the application software to be tested based on the target coverage.

[0028] Optionally, the M functional modules include a first functional module and a second functional module;

[0029] The device further comprises:

[0030] A first function weight determination module, used to determine a first weight of the first function module according to a first parameter of the first function module, where the first parameter is a preset parameter;

[0031] The second function weight determination module is used to determine the first weight of the second function module according to the second parameter of the second function module, where the second parameter includes a basic parameter and an influencing parameter.

[0032] Optionally, the second function weight determination module includes:

[0033] A basic weight determination module, used to determine a basic weight of the second functional module according to a basic parameter of the second functional module;

[0034] The weight adjustment module is used to adjust the basic weight of the second functional module based on the influence parameter of the second functional module to obtain the first weight of the second functional module.

[0035] Optionally, the first parameter includes a first preset function importance, the basic parameter includes at least one of a second preset function importance, historical usage frequency and historical vulnerability volume, and the influencing parameter includes at least one of the number of code lines associated with the first functional module, the number of functions associated with the first functional module and the code defect rate of the first functional module.

[0036] Optionally, the device further includes:

[0037] A test case set acquisition module, used to acquire test case sets corresponding to the M functional modules respectively, wherein the test case sets include at least one test case;

[0038] The test case screening module is used to screen the test case sets corresponding to the M functional modules respectively according to the first weights corresponding to the M functional modules respectively, so as to obtain the N first test cases.

[0039] Optionally, the target coverage determination module includes:

[0040] A first target value acquisition module, used for performing weighted sum processing on the first weights and coverage rates respectively corresponding to the M functional modules to obtain a first target value;

[0041] A second target value acquisition module, used for summing the first weights corresponding to the M functional modules respectively to obtain a second target value;

[0042] A target coverage acquisition module is used to obtain the target coverage according to the first target value and the second target value, wherein the target coverage is proportional to the first target value and inversely proportional to the second target value.

[0043] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the application software testing method as described above when executing the computer program.

[0044] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the application software testing method as described above are implemented.

[0045] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the application software testing method provided in each embodiment of the present application.

[0046] In the application software testing method of the embodiment of the present application, first, the application software to be tested is tested based on N first test cases to determine the coverage rates corresponding to the M functional modules in the application software to be tested. Then, the target coverage rate is obtained according to the first weights and coverage rates corresponding to the M functional modules. The test result of the application software to be tested is then determined based on the target coverage rate. Since in the process of determining the target coverage rate, the coverage rate is no longer calculated using the overall code of the application software and the executed code obtained after the test (i.e., the overall coverage rate of all functional modules of the application software), but the coverage rates corresponding to the M functional modules in the application software to be tested and the first weights corresponding to the M functional modules are used to determine the target coverage rate, that is, the effectiveness of the test of the individual functional modules and the weight of each functional module are taken into account, so that the obtained target coverage rate can accurately reflect the effectiveness of the test of a single functional module in the application software to be tested, so that the target coverage rate is more accurate, and the test results are determined based on the target coverage rate, so that the test results are more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0048] Figure 1 This is one of the flow charts of the application software testing method provided by the embodiment of the present invention;

[0049] Figure 2 It is one of the principle diagrams of the application software testing method provided by the embodiment of the present invention;

[0050] Figure 3 It is one of the schematic diagrams of the electronic device provided by the embodiment of the present invention;

[0051] Figure 4 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] Reference Figure 1In one embodiment, an application software testing method is provided, which can be applied to an electronic device, including:

[0054] Step 101: Testing the application software to be tested based on N first test cases to determine the coverage rates corresponding to M functional modules in the application software to be tested.

[0055] Wherein, N and M are both integers greater than 1. Execute the test case to test, collect the program execution trace information, and determine the executed code in the code of the application software to be tested during the test process. Since the code of the application software to be tested includes the sum of the codes of the functional modules that constitute the application software to be tested, for example, the application software to be tested may include M functional modules, then the code of the application software to be tested includes the sum of the codes of the M functional modules. The N first test cases are test cases corresponding to the M functional modules. In this way, after executing the test, the coverage rate corresponding to each functional module can be determined. For a functional module, its coverage rate can be the ratio of the number of executed code lines of the functional module to the number of code lines of the functional module, or it can be the ratio of the number of executed functions of the functional module to the number of functions of the functional module. In one example, the coverage rate of the functional module can be determined by the plugging method, which is convenient for the statistics of the coverage rate, and the coverage rate can be calculated by the plugging method without changing the original code. In one example, the above test can be a regression test, which means that after modifying the old code, retesting to confirm that the modification does not introduce new errors or cause errors in other codes to ensure the quality of the application software.

[0056] Step 102: Obtain target coverage of the application software to be tested according to the first weights and coverages respectively corresponding to the M functional modules.

[0057] After obtaining the coverage rates corresponding to the M functional modules, the target coverage rate of the application software to be tested can be obtained according to the coverage rates corresponding to the M functional modules and the first weights. The larger the first weight, the greater the influence of the corresponding functional module, and the greater the impact of its coverage rate on the target coverage rate of the application software to be tested. The target coverage rate of the application software to be tested not only considers the coverage rates corresponding to the M functional modules, but also considers the first weights corresponding to the M functional modules, which can ensure the accuracy of the target coverage rate.

[0058] Step 103: Determine the test result of the application software to be tested based on the target coverage.

[0059] After obtaining the target coverage of the application software to be tested, it can be used to determine the test result of the application software to be tested, that is, to determine whether the application software to be tested has passed the test. The test result includes test pass or test fail. If the test result is test pass, the application software to be tested can be subsequently put online. If the test result is test fail, a test fail prompt can be displayed to remind the tester that the test failed, so that the tester can perform subsequent operations as soon as possible according to the prompt.

[0060] In the application software testing method of the embodiment of the present application, first, the application software to be tested is tested based on N first test cases to determine the coverage rates corresponding to the M functional modules in the application software to be tested. Then, the target coverage rate is obtained according to the first weights and coverage rates corresponding to the M functional modules. The test result of the application software to be tested is then determined based on the target coverage rate. Since in the process of determining the target coverage rate, the coverage rate is no longer calculated using the overall code of the application software and the executed code obtained after the test (i.e., the overall coverage rate of all functional modules of the application software), but the coverage rates corresponding to the M functional modules in the application software to be tested and the first weights corresponding to the M functional modules are used to determine the target coverage rate, that is, the effectiveness of the test of the individual functional modules and the weight of each functional module are taken into account, so that the target coverage rate obtained can accurately reflect the effectiveness of the test of a single functional module in the application software to be tested, so that the target coverage rate is more accurate, and the test results are determined based on the target coverage rate, so that the test results are more accurate.

[0061] In one embodiment, the M functional modules include a first functional module and a second functional module.

[0062] Before testing the application software to be tested based on N first test cases, it includes: determining a first weight of the first functional module according to a first parameter of the first functional module, the first parameter being a preset parameter; determining a first weight of the second functional module according to a second parameter of the second functional module, the second parameter including a basic parameter and an influencing parameter.

[0063] The number of the first functional modules can be at least one, that is, there can be multiple, and the number of the second functional modules can also be at least one, that is, there can be multiple. Since the application software to be tested can be understood as a new version of the application software relative to the original version, the first functional module can be understood as a functional module newly added to the application software to be tested relative to the original version, and the second functional module can be understood as at least part of the functional modules in the application software to be tested that are the same as the original version of the application software, for example, all the functional modules in the application software to be tested that are the same as the original version of the application software.

[0064] In this embodiment, since the first functional module is a newly added functional module, its first weight can be determined based on the preset parameters of the first functional module, that is, the preset parameters of the first functional module can be pre-set according to the importance of the first functional module, and the preset parameters can be used in the process of determining the first weight. In addition, the first weight of the second functional module is determined based on the basic parameters and influencing parameters of the second functional module, that is, in the process of determining the first weight of the second functional module, its basic parameters are considered and the influencing parameters are also considered to ensure the accuracy of the second functional module.

[0065] In one embodiment, determining the first weight of the second functional module according to the second parameter of the second functional module includes: determining the basic weight of the second functional module according to the basic parameter of the second functional module; and adjusting the basic weight of the second functional module based on the influence parameter of the second functional module to obtain the first weight of the second functional module.

[0066] That is, in the process of determining the first weight of the second functional module, the basic weight of the second functional module is first determined using the basic parameters, and then the basic weight is adjusted with the influencing parameters to ensure the accuracy of the first weight of the second functional module, thereby ensuring the accuracy of the target coverage and improving the test accuracy.

[0067] In one embodiment, the first parameter includes a first preset function importance, the basic parameter includes a second preset function importance, at least one of historical usage frequency and historical vulnerability volume, and the influencing parameter includes at least one of the number of code lines associated with the first functional module, the number of functions associated with the first functional module and the code defect rate of the first functional module.

[0068] The first preset function importance is the function importance pre-set for the first function module. For example, after the first function module is completed, the importance level of the first function module can be divided according to the importance of the first function module. Different importance levels correspond to different function importances. If the importance level of the first function module is determined, the function importance can be determined. The higher the importance level, the greater the function importance, indicating that the first function module is more important. The second preset function importance is the function importance pre-set for the second function module. For example, after the second function module is completed, the importance level of the second function module can be divided according to the importance of the second function module. Different importance levels correspond to different function importances. If the importance level of the second function module is determined, the function importance can be determined. The higher the importance level, the greater the function importance, indicating that the second function module is more important.

[0069] Since the second functional module is an existing functional module of the original version of the application and has been used online, the historical usage frequency can be counted as a parameter to measure the first weight of the second functional module. In addition, the second functional module will inevitably have vulnerabilities (bugs) during historical use, and the number of historical vulnerabilities can also be counted as a parameter to measure the first weight of the second functional module.

[0070] In the process of determining the first weight of the second functional module, in addition to using the above basic parameters, the influence parameters are also used. Among them, the number of lines of code associated with the first functional module, that is, the number of lines of code in the code of the second functional module that are associated with the code of the first functional module. For example, between different functions, if the code of one function calls the code of another functional module, it means that the one functional module will affect the other functional module. The number of functions associated with the first functional module, that is, the number of functions associated with the code of the second functional module and the function (also known as method) of the first functional module. For example, between different functions, if the code of one function calls the function of another functional module, it means that the one functional module will affect the other functional module. The code defect rate of the first functional module refers to the code defect rate (i.e., bug rate) calculated after the code of the first functional module is written. Since the first functional module and the second functional module belong to the same application software to be tested, the stability of the code of the first functional module has an impact on the second functional module. The stability of the code of the first functional module can be measured by the code defect rate. The larger the code defect rate, the more unstable it is. Thus, the code defect rate of the first functional module can be used as an influencing parameter for adjusting the first weight of the second functional module, which can ensure that the stability of the first functional module is considered in the calculation process of the first weight of the second functional module, thereby improving the accuracy of the first weight of the second functional module. In an example, the code defect rate of the first functional module can be the thousand-line bug rate of the first functional module.

[0071] In one embodiment, after determining the first weight of the second functional module according to the second parameter of the second functional module, before testing the application software to be tested based on the N first test cases, it also includes: obtaining test case sets corresponding to the M functional modules, the test case sets including at least one test case; according to the first weights corresponding to the M functional modules, the test case sets corresponding to the M functional modules are screened to obtain N first test cases.

[0072] The larger the first weight is, the greater the influence of the functional module in the application software to be tested is. Since testing is an important means to detect the quality of the software to be tested, the test cases of each functional module can be screened according to the first weight. In this way, the test cases used in the testing process can be more targeted, thereby ensuring that there are corresponding more targeted test cases for each functional module in the testing process, which can not only improve the test efficiency, but also improve the test accuracy. For example, the larger the first weight is, the larger the number of test cases screened for the functional module is, and the more attention is paid to the test of the functional module.

[0073] In one embodiment, a target coverage rate is obtained according to the first weights and coverage rates corresponding to the M functional modules, including: performing weighted summation processing on the first weights and coverage rates corresponding to the M functional modules to obtain a first target value; summing the first weights corresponding to the M functional modules to obtain a second target value; and obtaining a target coverage rate according to the first target value and the second target value, the target coverage rate being directly proportional to the first target value and inversely proportional to the second target value.

[0074] That is, in the process of determining the target coverage rate, it is not only related to the first target value obtained by weighted summation of the first weights and coverage rates corresponding to the M functional modules, but also related to the second target value obtained by summing the first weights corresponding to the M functional modules, thereby ensuring the accuracy of the target coverage rate.

[0075] The process of the above application software testing method is described in detail below with a specific embodiment.

[0076] like Figure 2 As shown, first, the module level of the application software to be tested is divided according to the functional importance of the application software to be tested. For example, the functional module level can include P0, P1, P2 and P3 with decreasing levels, and the levels of P3, P2, P1 and P0 increase one by one, and their corresponding functional importance also increases one by one, so that the functional importance of the second functional module of the application software to be tested can be determined in advance according to the functional importance of the application software to be tested, that is, the second preset functional importance. In this embodiment, the basic weight of the second functional module is determined by the second preset functional importance, the historical frequency of use and the historical vulnerability amount.

[0077] Then, the basic weight is adjusted using the number of lines of code associated with the first functional module, the number of functions associated with the first functional module, and the code defect rate of the first functional module to obtain the first weight of the second function. The greater the number of lines of code associated with the first functional module, the greater the adjustment of the basic weight, and the greater the upward adjustment. The greater the number of functions associated with the first functional module, the greater the adjustment of the basic weight, and the greater the upward adjustment. The greater the code defect rate of the first functional module, the greater the adjustment of the basic weight, and the greater the upward adjustment.

[0078] Secondly, the functional importance of the first functional module of the application software to be tested is determined in advance according to the functional importance of the application software to be tested, that is, the first preset functional importance. The basic weight of the first functional module is determined by the first preset functional importance.

[0079] Furthermore, the application software to be tested is tested based on the N first test cases to determine the coverage rates corresponding to the M functional modules in the application software to be tested, that is, the code coverage rate is obtained by performing coverage statistics on the modules.

[0080] The target coverage is obtained by using the first weights and coverages corresponding to the M functional modules. The specific formula is as follows:

[0081]

[0082] in, is the target coverage, w i is the first weight of the i-th functional module, x i is the coverage of the i-th functional module.

[0083] In one example, in the process of determining the first weight of the second functional module according to the second preset function importance, the historical frequency of use and the historical vulnerability amount, the basic weight of the second functional module is determined, and the basic weight is adjusted according to the number of code lines associated with the first functional module, the number of functions associated with the first functional module and the code defect rate of the first functional module, and each parameter has a different degree of influence on the first weight of the second functional module, so that each parameter corresponds to its own parameter weight. The larger the parameter weight, the greater the degree of influence of the parameter on the first weight of the second functional module. Each parameter weight can be preset. The sum of the parameter weights corresponding to the above-mentioned second preset function importance, historical frequency of use, historical vulnerability amount, number of code lines associated with the first functional module, number of functions associated with the first functional module and code defect rate of the first functional module is 1. For example, the parameter weight of the second preset function importance can be 20%, the parameter weight of the historical frequency of use can be 15%, the parameter weight of the historical vulnerability amount can be 25%, the parameter weight of the number of code lines associated with the first functional module can be 10%, the parameter weight of the number of functions associated with the first functional module can be 10%, and the parameter weight of the code defect rate of the first functional module can be 30%. The basic weight of the second functional module can be determined based on the importance of the second preset function, the historical frequency of use, the historical vulnerability amount, the parameter weight of the second preset function importance, the parameter weight of the historical frequency of use, and the parameter weight of the historical vulnerability amount. Specifically, the importance of the second preset function can be updated based on the parameter weight of the second preset function importance (for example, the parameter weight of the second preset function importance can be multiplied by the second preset function importance to achieve the update), the historical frequency of use can be updated based on the parameter weight of the historical frequency of use (for example, the parameter weight of the historical frequency of use can be multiplied by the historical frequency of use to achieve the update), and the historical vulnerability amount can be updated based on the parameter weight of the historical vulnerability amount (for example, the parameter weight of the historical vulnerability amount can be multiplied by the historical vulnerability amount to achieve the update), and the basic weight of the second functional module can be determined using the updated second preset function importance, the updated historical frequency of use, and the updated historical vulnerability amount.

[0084] Then, the basic weight can be adjusted according to the number of code lines associated with the first functional module, the number of functions associated with the first functional module, the code defect rate of the first functional module, the parameter weight of the number of code lines associated with the first functional module, the parameter weight of the number of functions associated with the first functional module, and the parameter weight of the code defect rate of the first functional module to determine the first weight of the second functional module. Specifically, the number of code lines associated with the first functional module may be updated based on the parameter weight of the number of code lines associated with the first functional module (for example, the update may be achieved by multiplying the parameter weight of the number of code lines associated with the first functional module by the number of code lines associated with the first functional module), the number of functions associated with the first functional module may be updated based on the parameter weight of the number of functions associated with the first functional module (for example, the update may be achieved by multiplying the parameter weight of the number of functions associated with the first functional module by the number of functions associated with the first functional module), and the code defect rate of the first functional module may be updated based on the parameter weight of the code defect rate of the first functional module (for example, the update may be achieved by multiplying the parameter weight of the code defect rate of the first functional module by the code defect rate of the first functional module), and the basic weight may be adjusted using the updated number of code lines associated with the first functional module, the updated number of functions associated with the first functional module, and the updated code defect rate of the first functional module to determine the first weight of the second functional module.

[0085] In one example, for parameters of the second preset importance, the parameter weights can be updated based on their corresponding parameter weights. For example, the level weights corresponding to the function levels P0, P1, P2 and P3 are 40%, 30%, 20% and 10%, respectively. After determining the parameter weight of the second preset importance of the second function module, the parameter weight of the second preset importance of the second function module can be updated according to the level weight of the function level of the second function module. For example, the level weight of the function level of the second function module can be multiplied by the parameter weight of the second preset importance to achieve the update. In the subsequent process of determining the basic weight, the parameter weight of the second preset importance is calculated according to the updated parameter weight.

[0086] The target coverage obtained through the above process is more targeted and accurate. The regression process can also divide the regression manpower investment ratio of each module according to the weight. For example, for important functions, the historical stability (determined by the historical vulnerability volume, the lower the historical vulnerability volume, the more stable) is low, and the impact of the new code is large, the regression manpower investment ratio can be increased. If the original function is not affected by the new code, the regression manpower investment can be reduced. Optimize the regression process to save regression time or increase regression benefits.

[0087] As the iteration frequency of Internet products increases and the iteration time becomes shorter, the regression effect of testing products becomes particularly important. By using the weighted calculation target coverage provided by the present invention, the accuracy of the results and the pertinence of the functions are better guaranteed than the original full coverage. Improving the accuracy of the target coverage and optimizing the regression process with this target coverage result can largely guarantee the completeness of the test when the product is launched, and achieve a good guarantee for the stability and experience of online products.

[0088] like Figure 3 As shown, the present invention also provides an application software testing device 300 according to an embodiment, which can be applied to electronic equipment, and the device includes:

[0089] The module coverage determination module 301 is used to test the application software to be tested based on N first test cases to determine the coverage rates corresponding to M functional modules in the application software to be tested, wherein N and M are both integers greater than 1;

[0090] A target coverage determination module 302 is used to obtain a target coverage of the application software to be tested according to the first weights and coverages respectively corresponding to the M functional modules;

[0091] The test result determination module 303 is used to determine the test result of the application software to be tested based on the target coverage.

[0092] In one embodiment, the M functional modules include a first functional module and a second functional module;

[0093] The device further comprises:

[0094] A first function weight determination module, used to determine a first weight of the first function module according to a first parameter of the first function module, where the first parameter is a preset parameter;

[0095] The second function weight determination module is used to determine the first weight of the second function module according to the second parameter of the second function module, where the second parameter includes a basic parameter and an influencing parameter.

[0096] In one embodiment, the second function weight determination module includes:

[0097] A basic weight determination module, used to determine a basic weight of the second functional module according to a basic parameter of the second functional module;

[0098] The weight adjustment module is used to adjust the basic weight of the second functional module based on the influence parameter of the second functional module to obtain the first weight of the second functional module.

[0099] In one embodiment, the first parameter includes a first preset function importance, the basic parameter includes a second preset function importance, at least one of historical usage frequency and historical vulnerability volume, and the influencing parameter includes at least one of the number of code lines associated with the first functional module, the number of functions associated with the first functional module and the code defect rate of the first functional module.

[0100] In one embodiment, the apparatus further comprises:

[0101] A test case set acquisition module is used to acquire test case sets corresponding to the M functional modules, wherein the test case set includes at least one test case;

[0102] The test case screening module is used to screen the test case sets corresponding to the M functional modules respectively according to the first weights corresponding to the M functional modules respectively, so as to obtain N first test cases.

[0103] In one embodiment, the target coverage determination module includes:

[0104] A first target value acquisition module, used for performing weighted sum processing on the first weights and coverage rates respectively corresponding to the M functional modules to obtain a first target value;

[0105] A second target value acquisition module, used for summing the first weights corresponding to the M functional modules respectively to obtain a second target value;

[0106] The target coverage acquisition module is used to obtain the target coverage according to the first target value and the second target value. The target coverage is proportional to the first target value and inversely proportional to the second target value.

[0107] The technical features in the electronic device provided in the embodiment of the present invention correspond to the technical features in the above-mentioned application software testing method. The various processes of the above-mentioned application software testing method are implemented by the electronic device and the same effect can be obtained. To avoid repetition, they will not be described here.

[0108] like Figure 4 As shown, an embodiment of the present invention further provides an electronic device 400, including a processor 401 and a memory 402, wherein the memory 402 stores a computer program that can be executed on the processor 401, and when the computer program is executed by the processor 401, the various processes in the above-mentioned application software testing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0109] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned application software testing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0110] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the application software testing method provided by each embodiment of the present application.

[0111] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or electronic device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or electronic device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or electronic device including the element.

[0112] In the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0113] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for an electronic device (which can be a mobile phone, a computer, an electronic device, an air conditioner, or a network device, etc.) to execute the methods of various embodiments of the present invention.

[0114] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0115] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A method for testing application software, the method comprising: Testing the application software to be tested based on N first test cases to determine the coverage rates corresponding to M functional modules in the application software to be tested, wherein N and M are both integers greater than 1; Obtaining a target coverage rate of the application software to be tested according to the first weights and coverage rates respectively corresponding to the M functional modules; Determining a test result of the application software to be tested based on the target coverage; The step of obtaining the target coverage rate according to the first weights and coverage rates respectively corresponding to the M functional modules includes: Performing weighted sum processing on the first weights and coverage rates respectively corresponding to the M functional modules to obtain a first target value; Summing the first weights corresponding to the M functional modules respectively to obtain a second target value; According to the first target value and the second target value, the target coverage rate is obtained, wherein the target coverage rate is proportional to the first target value and inversely proportional to the second target value; The specific public representation of obtaining the target coverage rate by using the first weights and coverage rates respectively corresponding to the M functional modules is as follows: in, is the target coverage, w i is the first weight of the i-th functional module, x i is the coverage of the i-th functional module; Wherein, the M functional modules include a first functional module and a second functional module; Before testing the application software to be tested based on the N first test cases, the method includes: Determining a first weight of the first functional module according to a first parameter of the first functional module, where the first parameter is a preset parameter; A first weight of the second functional module is determined according to a second parameter of the second functional module, where the second parameter includes a basic parameter and an influencing parameter.

2. The method according to claim 1, wherein: The determining the first weight of the second functional module according to the second parameter of the second functional module includes: Determining a basic weight of the second functional module according to the basic parameter of the second functional module; Based on the influence parameter of the second functional module, the basic weight of the second functional module is adjusted to obtain the first weight of the second functional module.

3. The method according to claim 1 or 2, wherein: The first parameter includes a first preset function importance, the basic parameter includes at least one of a second preset function importance, a historical usage frequency, and a historical vulnerability amount, and the influencing parameter includes at least one of the number of code lines associated with the first functional module, the number of functions associated with the first functional module, and the code defect rate of the first functional module.

4. The method according to claim 1, wherein: After determining the first weight of the second functional module according to the second parameter of the second functional module and before testing the application software to be tested based on the N first test cases, the method further includes: Obtain test case sets corresponding to the M functional modules respectively, wherein the test case sets include at least one test case; According to the first weights respectively corresponding to the M functional modules, test case screening is performed on the test case sets respectively corresponding to the M functional modules to obtain the N first test cases.

5. An application software testing device, the device comprising: A module coverage determination module, used to test the application software to be tested based on N first test cases, and determine the coverage rates corresponding to M functional modules in the application software to be tested, wherein N and M are both integers greater than 1; A target coverage determination module, used to obtain the target coverage of the application software to be tested according to the first weights and coverages respectively corresponding to the M functional modules; A test result determination module, used to determine the test result of the application software to be tested based on the target coverage; The target coverage determination module comprises: A first target value acquisition module, used for performing weighted sum processing on the first weights and coverage rates respectively corresponding to the M functional modules to obtain a first target value; A second target value acquisition module, used for summing the first weights corresponding to the M functional modules respectively to obtain a second target value; a target coverage acquisition module, configured to obtain the target coverage according to the first target value and the second target value, wherein the target coverage is proportional to the first target value and inversely proportional to the second target value; The specific public representation of obtaining the target coverage rate by using the first weights and coverage rates respectively corresponding to the M functional modules is as follows: in, is the target coverage, w i is the first weight of the i-th functional module, x i is the coverage of the i-th functional module; Wherein, the M functional modules include a first functional module and a second functional module; The device further comprises: A first function weight determination module, used to determine a first weight of the first function module according to a first parameter of the first function module, where the first parameter is a preset parameter; The second function weight determination module is used to determine the first weight of the second function module according to the second parameter of the second function module, where the second parameter includes a basic parameter and an influencing parameter.

6. The device according to claim 5, wherein: The second function weight determination module includes: A basic weight determination module, used to determine a basic weight of the second functional module according to a basic parameter of the second functional module; The weight adjustment module is used to adjust the basic weight of the second functional module based on the influence parameter of the second functional module to obtain the first weight of the second functional module.

7. The device according to claim 5 or 6, wherein: The first parameter includes a first preset function importance, the basic parameter includes at least one of a second preset function importance, a historical usage frequency, and a historical vulnerability amount, and the influencing parameter includes at least one of the number of code lines associated with the first functional module, the number of functions associated with the first functional module, and the code defect rate of the first functional module.

8. The device according to claim 5, wherein: The device further comprises: A test case set acquisition module, used to acquire test case sets corresponding to the M functional modules respectively, wherein the test case sets include at least one test case; The test case screening module is used to screen the test case sets corresponding to the M functional modules respectively according to the first weights corresponding to the M functional modules respectively, so as to obtain the N first test cases.

9. An electronic device, comprising: A memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in the application software testing method according to any one of claims 1 to 4 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps in the application software testing method according to any one of claims 1 to 4.

11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the application software testing method according to any one of claims 1 to 4.