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

By obtaining historical call information and using association rule mining algorithms to analyze the association between functions and methods, the problems of insufficient coverage and omissions in traditional software testing methods are solved, more efficient test coverage is achieved, and it is ensured that the programs and methods associated with the modification points are tested.

CN120705053APending Publication Date: 2025-09-26INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510850345.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Traditional software testing methods are inefficient, have insufficient coverage, and are prone to missing test verification of program functions associated with modification points.

Method used

By obtaining historical call information, the association rule mining algorithm is used to analyze the association relationship between functions and methods, the target frequent item set is determined, and test cases are executed based on the association relationship to achieve coverage testing of the associated programs and methods of the modification points.

Benefits of technology

It improves the coverage and efficiency of software testing, ensures that the programs and methods associated with the modification points are also covered by the test, avoids test omissions, and improves the comprehensiveness and accuracy of the test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705053A_ABST
    Figure CN120705053A_ABST
Patent Text Reader

Abstract

The invention provides a software testing method, device and equipment, a medium and a program product, relates to the technical field of software development, and can be applied to the field of financial science and technology. The method comprises the following steps: acquiring historical call information of at least one test case for at least one program and at least one function or method of each program in the at least one program; performing association analysis on at least one function or method of each program based on the historical call information, and determining at least two functions or at least two methods with a first target association relationship and a program and a test case with a second target association relationship; in response to modification of a first function or a first method of the first target program, determining a first function of a second target program associated with the first function or a second method of the second target program associated with the first method based on the first target association relationship, determining a target test case associated with the first target program based on the second target association relationship; and executing the target test case to test the first function and the second function or test the first method and the second method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development technology, and can be specifically applied to software development and testing in the field of financial technology. More specifically, it relates to a software testing method, device, equipment, medium and program product. Background Art

[0002] During the software development process, testing is a crucial step in ensuring software quality and stability. However, as software systems continue to grow in complexity and scale, traditional testing methods face challenges such as inefficiency, insufficient coverage, and wasted resources. A common pain point in current software testing is that while testing the primary functionality of the program where the code modification occurs may miss other related functionality, leading to missed tests. Summary of the Invention

[0003] In view of the above problems, the present application provides a software testing method, apparatus, device, medium and program product for improving test coverage and test efficiency.

[0004] According to a first aspect of the present application, a software testing method is provided, the method comprising: obtaining historical call information of at least one test case for at least one program and at least one function or method of each program in the at least one program; performing association analysis on at least one function or method of each program based on the historical call information, and determining at least two functions or at least two methods having a first target association relationship and a program and test case having a second target association relationship; in response to a first function or a first method of a first target program being modified, determining a second function of a second target program associated with the first function or a second method of the second target program associated with the first method based on the first target association relationship, and determining a target test case associated with the first target program based on the second target association relationship; and executing the target test case to test the first function and the second function or the first method and the second method.

[0005] According to an embodiment of the present application, an association analysis is performed on at least one function or method of each program based on historical call information to determine at least two functions or at least two methods having a first target association relationship, including: using an association rule mining algorithm to process the historical call information to obtain a target frequent item set, the target frequent item set including at least one frequent item and support items corresponding to each frequent item, each frequent item including at least two functions or at least two methods, and the support items representing the number of test cases supported by the corresponding frequent item; determining the corresponding support of each frequent item based on the support items corresponding to each frequent item; determining at least one frequent item corresponding to a support greater than or equal to a support threshold as a target frequent item, the target frequent item including at least two functions having the first target association relationship.

[0006] According to an embodiment of the present application, an association analysis is performed on at least one function or method of each program based on historical call information to determine programs and test cases with a second target association relationship, including: establishing an association relationship between at least two functions or at least two methods in the target frequent items and the corresponding test cases to obtain programs and test cases with the second target association relationship.

[0007] According to an embodiment of the present application, an association rule mining algorithm is used to process historical call information to obtain at least one target frequent item set, including: using an association rule mining algorithm to process historical call information to obtain a first frequent item set, the first frequent item set including at least two first frequent items and first support items corresponding to each first frequent item, each first frequent item including a function or a method, and the first support item indicating the number of test cases supported by the corresponding first frequent item; generating a second frequent item set based on the first frequent item set, the second frequent item set including at least one second frequent item and second support items corresponding to each second frequent item, each second frequent item including a function or a method, and the first support item indicating the number of test cases supported by the corresponding first frequent item; generating a second frequent item set based on the first frequent item set, the second frequent item set including at least one second frequent item and second support items corresponding to each second frequent item, The frequent item set includes two functions or two methods, the second support item represents the number of test cases supported by the corresponding second frequent item, and the second support item is greater than or equal to the support threshold; and so on, the nth frequent item set is generated, the nth frequent item set includes at least one nth frequent item and the nth support item corresponding to each nth frequent item, each nth frequent item includes n functions or n methods, the nth support item represents the number of test cases supported by the corresponding nth frequent item, and the nth support item is greater than or equal to the support threshold; n is the number of all functions or the number of all methods; at least one target frequent item set is determined from the second frequent item set to the nth frequent item set.

[0008] According to an embodiment of the present application, the historical call information is processed using an association rule mining algorithm, and further includes: processing the historical call information in a table format.

[0009] According to an embodiment of the present application, the method further includes: obtaining sample data, the sample data including historical coverage test data; and determining a support threshold based on the historical coverage test data.

[0010] According to an embodiment of the present application, the method further includes: storing and visually displaying to developers at least two functions or at least two methods having a first target association relationship and programs and test cases having a second target association relationship.

[0011] According to a second aspect of the present application, a software testing device is provided, comprising: an acquisition module for acquiring historical call information of at least one test case for at least one program and at least one function or method of each program in the at least one program; an association analysis module for performing association analysis on at least one function or method of each program based on the historical call information, and determining at least two functions or at least two methods having a first target association relationship and a program and test case having a second target association relationship; a response module for determining, in response to a modification of a first function or a first method of a first target program, a second function of a second target program associated with the first function or a second method of the second target program associated with the first method based on the first target association relationship, and determining a target test case associated with the first target program based on the second target association relationship; and a determination module for executing the target test case to test the first and second functions or the first and second methods.

[0012] The third aspect of the present application provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0013] The fourth aspect of the present application further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the computer program or instructions are executed by a processor.

[0014] The fifth aspect of the present application further provides a computer program product, comprising a computer program or instructions, which implement the steps of the above method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The above contents and other objects, features and advantages of the present application will become more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings, in which:

[0016] Figure 1 Schematically illustrates an application scenario diagram of the software testing method, apparatus, device, medium, and program product according to an embodiment of the present application;

[0017] Figure 2 The following schematically shows a flowchart of a software testing method according to an embodiment of the present application;

[0018] Figure 3 Schematically shows a flowchart of correlation analysis in software testing according to an embodiment of the present application

[0019] Figure 4 A structural block diagram of a software testing device according to an embodiment of the present application is schematically shown; and

[0020] Figure 5 A block diagram of an electronic device suitable for implementing a software testing method according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0021] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present application.

[0022] The terms used herein are only for describing specific embodiments and are not intended to limit this application. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0023] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0024] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0025] In the technical solution of this application, the user information involved (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0026] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided in the embodiments of the present application all provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.

[0027] Current software systems involve numerous programs. During the implementation of this application, it was discovered that relationships may exist between multiple programs, functions, and methods. For example, function A in program P1 may call function B in program P1, which in turn may call function C in program P2. In one example, during software testing, if function A in program P1 is modified, the test case covering function A can be used. However, because the modification to function A in program P1 affects function C in program P2 (direct or indirect calling relationship), or because data is shared, it is easy to miss test coverage for related programs.

[0028] In view of this, the embodiments of the present application provide a software testing method, apparatus, device, medium and program product, the method comprising: obtaining historical call information of at least one test case for at least one program and at least one function or method of each program in at least one program. Based on the historical call information, an association analysis is performed on at least one function or method of each program to determine at least two functions or at least two methods having a first target association relationship and a program and test case having a second target association relationship. In response to the first function or the first method of the first target program being modified, the second function of the second target program associated with the first function or the second method of the second target program associated with the first method is determined based on the first target association relationship, and the target test case associated with the first target program is determined based on the second target association relationship. The target test case is executed to test the first function and the second function or the first method and the second method. This will be described below in conjunction with the embodiments.

[0029] Figure 1 The application scenario diagram of the software testing method, apparatus, equipment, medium and program product according to the embodiments of the present application is schematically shown.

[0030] like Figure 1As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or optical fiber cables.

[0031] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to develop and test software. The first terminal device 101, the second terminal device 102, and the third terminal device 10 can interact with the server 105 via the network 104 to receive or send messages, etc. Various software development tools, software testing tools, and communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, financial consumption applications, etc. (for example only).

[0032] The first terminal device 101 , the second terminal device 102 , and the third terminal device 103 may be various electronic devices having display screens and supporting software development and testing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0033] Server 105 can be a server that provides various services, such as a background management server (for example only) that supports messages sent by users using first terminal device 101, second terminal device 102, and third terminal device 103. The background management server can perform correlation analysis on programs, functions, and methods involved in software development and testing performed by users using first terminal device 101, second terminal device 102, and third terminal device 103. When a user modifies a code point, the background management server can send the programs, functions, methods, and test cases associated with that code point to first terminal device 101, second terminal device 102, and third terminal device 103 for the user to monitor and determine whether the newly added or modified part affects strongly related programs, codes, and methods, so as to facilitate coverage testing.

[0034] It should be noted that the software testing method provided in the embodiments of the present disclosure can generally be executed by the server 105. Accordingly, the software testing apparatus provided in the embodiments of the present disclosure can generally be set in the server 105. The software testing method provided in the embodiments of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the software testing apparatus provided in the embodiments of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0035] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the embodiment is merely illustrative. Any number of terminal devices, networks, and servers may be provided as required.

[0036] It should be noted that the software testing method and device of the embodiments of the present application can be applied to the field of financial technology. With the explosive growth of related business volume in the field of financial technology, in order to meet the business needs of users, powerful background function code is needed to support it. At this time, code testing and development are particularly critical. For example, in order to be able to mine target users from a large number of users to make recommendations for corresponding financial products, etc., it is necessary to analyze a large amount of data, so that forms, tables, and lists are widely used, and the corresponding form components, table components, and list components The corresponding code development is particularly important. In order to reduce the development cost of developers and improve the accuracy and development efficiency of code testing, the software testing method and device provided by the embodiments of the present application can be adopted to better meet the needs of financial business.

[0037] It should be noted that the software testing method and device of the embodiments of the present application can be used in scenarios such as software development and testing in the financial field, and can also be used in any field other than the financial field, such as e-commerce, logistics, etc. The application field of the software testing method and device of the present application is not limited.

[0038] The following will be based on Figure 1 The scene described by Figure 2~Figure 3 The software testing method according to the embodiment of the present application is described in detail.

[0039] Figure 2 The flowchart of the software testing method according to the embodiment of the present application is schematically shown.

[0040] like Figure 2 As shown, the software testing method of this embodiment may include operations S210 to S230.

[0041] In operation S210 , historical call information of at least one test case for at least one program and at least one function or method of each program in the at least one program is obtained.

[0042] In operation S220 , association analysis is performed on at least one function or method of each program based on the historical call information to determine at least two functions or at least two methods having a first target association relationship and programs and test cases having a second target association relationship.

[0043] In operation S230, in response to the first function or the first method of the first target program being modified, a second function of the second target program associated with the first function or a second method of the second target program associated with the first method is determined based on the first target association relationship, and a target test case associated with the first target program is determined based on the second target association relationship.

[0044] In operation S240 , the target test case is executed to test the first function and the second function or to test the first method and the second method.

[0045] According to embodiments of the present application, historical call information may be data generated by calls between programs, functions, methods, etc. during software development, testing, and application within a historical time period. This data may not intuitively reflect the call relationships between programs, functions, methods, etc., and requires correlation analysis to obtain. The call relationships can be direct call relationships, indirect call relationships, or data sharing relationships between different programs, functions, and methods.

[0046] According to an embodiment of the present application, the calling relationship may be a call or data sharing between different functions or methods in the same program, or a call or data sharing between functions or methods in different programs.

[0047] According to an embodiment of the present application, this calling relationship can be obtained based on whether the test case has run into the corresponding program, function or method.

[0048] When executing the test case in the test environment, the entry point of the tested program will be called. If function A of program P1 is called, function C of program P2 will be called next. The test data generated by this execution process will be recorded. When storing, the test case and the corresponding test data will be stored.

[0049] According to an embodiment of the present application, the first target association relationship can be understood as the relationship between the called programs, functions or methods, and the second target association relationship can be understood as the association relationship between the test case of the program, function or method with the first target association relationship and the program, function or method with the first target association relationship after determining the first target association relationship.

[0050] Through the software testing method of the embodiment of the present application, by performing association analysis on the functions or methods in the program running the test case, the functions or methods with a first association relationship are determined, and a second association relationship between the program and the test case is established. In this way, when the code point is modified, the corresponding test case can be quickly obtained based on the second association relationship for coverage testing. Not only can the functions or methods associated with the modified program be covered, avoiding test omissions, but the corresponding test cases can also be quickly obtained for testing, thereby improving testing efficiency.

[0051] Figure 3 The flowchart of the correlation analysis in software testing according to the embodiment of the present application is schematically shown.

[0052] like Figure 3 As shown, in some embodiments of the present application, performing association analysis on at least one function or method of each program based on historical call information, and determining at least two functions or at least two methods having a first target association relationship may include operations S310 to S330.

[0053] In operation S310, an association rule mining algorithm is used to process the historical call information to obtain a target frequent item set. The target frequent item set includes at least one frequent item and the corresponding support items of each frequent item. Each frequent item includes at least two functions or at least two methods. The support items represent the number of test cases supported by the corresponding frequent item.

[0054] In operation S320, the corresponding support degrees of the frequent items are determined based on the corresponding supporting items.

[0055] In operation S330 , at least one frequent item corresponding to a support greater than or equal to a support threshold is determined as a target frequent item. The target frequent item includes at least two functions having a first target association relationship.

[0056] According to an embodiment of the present application, a frequent item set can be understood as a set of programs, functions or methods corresponding to a test case, that is, a program, function or method is a frequent item. For example, when running test case one, function A of program P1 is executed (which can be represented by P1.A, and other types of descriptions can also be represented in the same format). The support of a frequent item is the probability of a frequent item appearing in all things. For example, when running test case one to test case ten, the number of test cases executed to P1.A, that is, the support item, is 6, then the support of P1.A is 6 / 10=0.6. The support threshold can be a minimum support, and a frequent item with a support greater than the support threshold is determined as a target frequent item.

[0057] According to an embodiment of the present application, since the software testing method of this embodiment is aimed at test coverage of programs, functions or methods with an associated relationship, each frequent item includes at least two functions or at least two methods, for example (P1.A, P1.B), which means that after the entry of the tested program is called, function A of program P1 is called, and the next step is to call function B of program P1.

[0058] The software testing method of the embodiments of the present disclosure uses an association rule mining algorithm to identify functions or methods with associated relationships. This method can discover potential call relationships or data dependencies between functions or methods, even if these relationships are not explicitly reflected in the code. This can further improve test coverage and enhance the comprehensiveness of software testing.

[0059] In an embodiment of the present application, performing association analysis on at least one function or method of each program based on historical call information to determine programs and test cases having a second target association relationship may include:

[0060] An association relationship between at least two functions or at least two methods in the target frequent items and corresponding test cases is established to obtain a program and a test case having a second target association relationship.

[0061] According to an embodiment of the present application, an identifier may be added to a program, function or method and a test case to establish an association relationship between the two, for example, by storing them in a key-value pair format.

[0062] Through the software testing method of the embodiment of the present application, based on the association analysis results between functions or methods, an association relationship between functions or methods and test cases is further established, so that test cases can be quickly and accurately obtained based on the association relationship for testing during modification, thereby improving the accuracy of the test.

[0063] In some embodiments of the present application, using an association rule mining algorithm to process historical call information to obtain at least one target frequent itemset may include:

[0064] An association rule mining algorithm is used to process historical call information to obtain a first frequent item set. The first frequent item set includes at least two first frequent items and first supporting items corresponding to each first frequent item. Each first frequent item includes a function or a method. The first supporting item represents the number of test cases supported by the corresponding first frequent item.

[0065] A second frequent itemset is generated based on the first frequent itemset, where the second frequent itemset includes at least one second frequent item and second support items corresponding to each second frequent item, each second frequent item includes two functions or two methods, the second support items represent the number of test cases supported by the corresponding second frequent item, and the second support items are greater than or equal to a support threshold.

[0066] Similarly, the nth frequent item set is generated. The nth frequent item set includes at least one nth frequent item and the nth support item corresponding to each nth frequent item. Each nth frequent item includes n functions or n methods. The nth support item represents the number of test cases supported by the corresponding nth frequent item. The nth support item is greater than or equal to the support threshold; n is the number of all functions or the number of all methods.

[0067] At least one target frequent itemset is determined from the second frequent itemset to the nth frequent itemset.

[0068] The following describes the above process by taking the test case as an example to see whether it runs on the corresponding program function.

[0069] For example, if case 1 tests P1.A, the record is 1, and so on. Assume there are 10 test cases and methods contained in four assemblies, that is, the value of n is 4, and the recorded running data is shown in Table 1 below.

[0070] Table 1

[0071]

[0072] First, the first frequent itemset L1 containing one support item is determined, and the results are shown in Table 2.

[0073] Table 2

[0074]

[0075] Next, the data in the first frequent item set L1 are concatenated in pairs to generate the second frequent item set L2 with two supporting items. The results are shown in Table 3.

[0076] Table 3

[0077]

[0078] Assume that the support threshold is set to 0.2, the support item of (P1.B, P3.D) is 1, and the corresponding support is 0.1, and the support item of (P2.C, P3.D) is 0, and the corresponding support is 0, both of which are less than 0.2. Calculating the support of the three support items can exclude these two items.

[0079] Next, the third frequent itemset L3 containing three support items is determined, and the results are shown in Table 4.

[0080] Table 4

[0081]

[0082] Finally, the fourth frequent itemset L4 containing four support items is determined, and the results are shown in Table 5.

[0083] Table 5

[0084]

[0085] Since the minimum support is set to 0.2, the functions of the programs contained in the frequent items with support above 0.2 are strongly associated. For example, the frequent items "P1.A, P1.B, P2.C" have a strong association.

[0086] Through the software testing method of the embodiment of the present application, the target frequent set is determined by constructing frequent sets step by step, which can improve the comprehensiveness and accuracy of the target frequent set determination, thereby improving the comprehensiveness and accuracy of the test coverage.

[0087] In an embodiment of the present application, the historical call information is processed using an association rule mining algorithm, and further includes: processing the historical call information in a table format.

[0088] For example, the table may be a two-dimensional table.

[0089] By using the software testing method of the embodiment of the present application, analyzing program calls in a format such as a table can help to more clearly understand the calling relationship, frequency and potential problems between functions or methods.

[0090] In some embodiments of the present application, the software testing method may further include:

[0091] Obtain sample data, which includes historical coverage test data.

[0092] The support threshold is determined based on historical coverage test data.

[0093] It should be understood that the historical coverage test data may include test data with high test coverage and accurate testing during the historical software testing process.

[0094] Through the software testing method of the present invention, the preset association support threshold can be obtained by studying and sorting a large amount of sample data in advance. This allows for rapid and accurate identification of possible associated programs from a large number of systems, thereby narrowing the scope of target associated programs to be screened.

[0095] In some embodiments of the present application, the software testing method may further include:

[0096] At least two functions or at least two methods having a first target association relationship and a program and a test case having a second target association relationship are stored and visually displayed to a developer.

[0097] For example, if a developer modifies function B of program P1 during the software development process, the visual interface can display a prompt message indicating that it affects function A of program P1 and function C of program P2. In this way, the developer can pay attention in real time and determine whether the newly added or modified parts contain strongly associated programs, functions or methods without having to obtain such strong associations from other channels.

[0098] The software testing method of this embodiment visualizes the association analysis results, which allows developers to more intuitively determine whether their newly added or modified parts affect the content of frequent itemsets with strong associations, thereby improving programming and testing efficiency.

[0099] Based on the above software testing method, this application also provides a software testing device. Figure 4 The device is described in detail.

[0100] Figure 4 The structural block diagram of the software testing device according to an embodiment of the present application is schematically shown.

[0101] like Figure 4 As shown, the software testing device 400 of this embodiment includes an acquisition module 410 , a correlation analysis module 420 , a response module 430 and a determination module 440 .

[0102] The acquisition module 410 is used to obtain historical call information of at least one test case for at least one program and at least one function or method of each program in the at least one program. In one embodiment, the acquisition module 410 can be used to perform the operation S210 described above, which will not be repeated here.

[0103] Association analysis module 420 is configured to perform association analysis on at least one function or method of each program based on historical call information, and to identify at least two functions or at least two methods having a first target association relationship, and programs and test cases having a second target association relationship. In one embodiment, association analysis module 420 may be configured to perform operation S220 described above, and will not be further described herein.

[0104] Response module 430 is configured to, in response to the modification of the first function or the first method of the first target program, determine, based on the first target association relationship, a second function of the second target program associated with the first function, or a second method of the second target program associated with the first method, and determine, based on the second target association relationship, a target test case associated with the first target program. In one embodiment, response module 430 may be configured to perform operation S230 described above, which will not be further described herein.

[0105] Determination module 440 is configured to execute a target test case to test the first function and the second function, or to test the first method and the second method. In one embodiment, determination module 440 may be configured to execute operation S240 described above, which will not be further described herein.

[0106] According to an embodiment of the present application, the association analysis module 420 performs an association analysis on at least one function or method of each program based on historical call information to determine at least two functions or at least two methods having a first target association relationship, including: using an association rule mining algorithm to process the historical call information to obtain a target frequent item set, the target frequent item set includes at least one frequent item and support items corresponding to each frequent item, each frequent item includes at least two functions or at least two methods, and the support items represent the number of test cases supported by the corresponding frequent item; determining the corresponding support of each frequent item based on the support items corresponding to each frequent item; determining at least one frequent item corresponding to a support greater than or equal to a support threshold as a target frequent item, the target frequent item includes at least two functions having a first target association relationship.

[0107] According to an embodiment of the present application, the association analysis module 420 performs an association analysis on at least one function or method of each program based on historical call information to determine programs and test cases having a second target association relationship, including: establishing an association relationship between at least two functions or at least two methods in the target frequent items and the corresponding test cases to obtain programs and test cases having a second target association relationship.

[0108] According to an embodiment of the present application, the association analysis module 420 uses an association rule mining algorithm to process historical call information to obtain at least one target frequent item set, including: using an association rule mining algorithm to process historical call information to obtain a first frequent item set, the first frequent item set includes at least two first frequent items and first support items corresponding to each first frequent item, each first frequent item includes a function or a method, and the first support item represents the number of test cases supported by the corresponding first frequent item; generating a second frequent item set based on the first frequent item set, the second frequent item set includes at least one second frequent item and second support items corresponding to each second frequent item, each first frequent item includes a function or a method, and the first support item represents the number of test cases supported by the corresponding first frequent item; generating a second frequent item set based on the first frequent item set, the second frequent item set includes at least one second frequent item and second support items corresponding to each second frequent item, The second frequent item includes two functions or two methods, the second support item represents the number of test cases supported by the corresponding second frequent item, and the second support item is greater than or equal to the support threshold; and so on, the nth frequent item set is generated, the nth frequent item set includes at least one nth frequent item and the nth support item corresponding to each nth frequent item, each nth frequent item includes n functions or n methods, the nth support item represents the number of test cases supported by the corresponding nth frequent item, and the nth support item is greater than or equal to the support threshold; n is the number of all functions or the number of all methods; at least one target frequent item set is determined from the second frequent item set to the nth frequent item set.

[0109] According to an embodiment of the present application, the association analysis module 420 processes the historical call information using an association rule mining algorithm, and further includes: processing the historical call information in a table format.

[0110] According to an embodiment of the present application, the apparatus further includes: a threshold determination module 450 for obtaining sample data, the sample data including historical coverage test data; and determining a support threshold based on the historical coverage test data.

[0111] According to an embodiment of the present application, the apparatus further includes: a display module 460 for storing and visually displaying to developers at least two functions or at least two methods having a first target association relationship and programs and test cases having a second target association relationship.

[0112] According to embodiments of the present application, any multiple modules among acquisition module 410, association analysis module 420, response module 430, and determination module 440 may be combined into a single module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in a single module. According to embodiments of the present application, at least one of acquisition module 410, association analysis module 420, response module 430, and determination module 440 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or may be implemented in hardware or firmware through any other reasonable means of circuit integration or packaging, or may be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of these. Alternatively, at least one of the acquisition module 410 , the association analysis module 420 , the response module 430 and the determination module 440 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.

[0113] Figure 5 A block diagram of an electronic device suitable for implementing a software testing method according to an embodiment of the present application is schematically shown.

[0114] like Figure 5As shown, an electronic device 500 according to an embodiment of the present application includes a processor 501, which can perform various appropriate actions and processes based on a program stored in a read-only memory (ROM) 502 or a program loaded from a storage unit 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present application.

[0115] Various programs and data required for the operation of the electronic device 500 are stored in the RAM 503. The processor 501, ROM 502, and RAM 503 are connected to each other via a bus 504. The processor 501 performs various operations of the method flow according to the embodiment of the present application by executing the programs in the ROM 502 and / or RAM 503. It should be noted that the programs may also be stored in one or more memories other than the ROM 502 and the RAM 503. The processor 501 may also perform various operations of the method flow according to the embodiment of the present application by executing the programs stored in the one or more memories.

[0116] According to an embodiment of the present application, electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to bus 504. Electronic device 500 may also include one or more of the following components connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 508 including a hard disk; and a communication section 509 including a network interface card such as a LAN card or modem. Communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. Removable media 511, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 510 as needed, so that computer programs read from the removable media can be installed into storage section 508 as needed.

[0117] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of this application is implemented.

[0118] According to an embodiment of the present application, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as, but not limited to, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present application, a computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.

[0119] Embodiments of the present application also include a computer program product comprising a computer program containing program code for executing the method shown in the flowchart. When the computer program product is executed in a computer system, the program code is used to cause the computer system to implement the method provided in the embodiments of the present application.

[0120] The computer program executes the above functions defined in the system / device of the embodiment of the present application when the computer program is executed by the processor 501. According to the embodiment of the present application, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0121] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 509, and / or installed from a removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0122] In such an embodiment, the computer program can be downloaded and installed from the network via the communication section 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above-mentioned functions defined in the system of the embodiment of the present application are performed. According to the embodiment of the present application, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.

[0123] According to an embodiment of the present application, the program code for executing the computer program provided by the embodiment of the present application can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).

[0124] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0125] Those skilled in the art will appreciate that the features described in the various embodiments of this application may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in this application. In particular, the features described in the various embodiments of this application may be combined and / or coupled in various ways without departing from the spirit and teachings of this application. All such combinations and / or couplings fall within the scope of this application.

Claims

1. A software testing method, characterized in that: The method comprises: Obtaining historical call information of at least one test case for at least one program and at least one function or method of each program in the at least one program; Performing association analysis on at least one function or method of each program based on the historical call information to determine at least two functions or at least two methods having a first target association relationship and programs and test cases having a second target association relationship; In response to a first function or a first method of a first target program being modified, determining a second function of a second target program associated with the first function or a second method of the second target program associated with the first method based on the first target association relationship, and determining a target test case associated with the first target program based on the second target association relationship; and The target test case is executed to test the first function and the second function or to test the first method and the second method.

2. The method according to claim 1, characterized in that The performing association analysis on at least one function or method of each program based on the historical call information to determine at least two functions or at least two methods having a first target association relationship includes: Using an association rule mining algorithm to process the historical call information to obtain a target frequent item set, the target frequent item set including at least one frequent item and support items corresponding to each frequent item, each frequent item including at least two functions or at least two methods, and the support items representing the number of test cases supported by the corresponding frequent item; Determine the corresponding support degree based on the corresponding support items of each frequent item; At least one frequent item corresponding to a support greater than or equal to a support threshold is determined as a target frequent item, where the target frequent item includes at least two functions having a first target association relationship.

3. The method according to claim 2, characterized in that The performing association analysis on at least one function or method of each program based on the historical call information to determine a program and a test case having a second target association relationship includes: An association relationship between at least two functions or at least two methods in the target frequent items and corresponding test cases is established to obtain a program and a test case having a second target association relationship.

4. The method according to claim 2 or 3, characterized in that The process of processing the historical call information using an association rule mining algorithm to obtain at least one target frequent item set includes: Processing the historical call information using an association rule mining algorithm to obtain a first frequent item set, where the first frequent item set includes at least two first frequent items and first supporting items corresponding to each first frequent item, each first frequent item includes a function or a method, and the first supporting items represent the number of test cases supported by the corresponding first frequent item; generating a second frequent item set based on the first frequent item set, wherein the second frequent item set includes at least one second frequent item and second support items corresponding to each second frequent item, each second frequent item includes two functions or two methods, the second support items represent the number of test cases supported by the corresponding second frequent item, and the second support items are greater than or equal to the support threshold; Similarly, an nth frequent item set is generated, wherein the nth frequent item set includes at least one nth frequent item and an nth support item corresponding to each nth frequent item, each of the nth frequent items includes n functions or n methods, the nth support item represents the number of test cases supported by the corresponding nth frequent item, and the nth support item is greater than or equal to the support threshold; n is the number of all functions or the number of all methods; The at least one target frequent itemset is determined from the second frequent itemset to the nth frequent itemset.

5. The method according to claim 2 or 3, characterized in that The processing of the historical call information by using an association rule mining algorithm further includes: The historical call information is processed in a table format.

6. The method according to claim 2 or 3, characterized in that The method further comprises: Obtaining sample data, wherein the sample data includes historical coverage test data; The support threshold is determined based on the historical coverage test data.

7. The method according to claim 1, characterized in that The method further comprises: At least two functions or at least two methods having a first target association relationship and a program and a test case having a second target association relationship are stored and visually displayed to a developer.

8. A software testing device, characterized in that: The device comprises: an acquisition module, configured to acquire historical call information of at least one test case for at least one program and at least one function or method of each program in the at least one program; an association analysis module, configured to perform association analysis on at least one function or method of each program based on the historical call information, and determine at least two functions or at least two methods having a first target association relationship and programs and test cases having a second target association relationship; a response module, configured to, in response to a first function or a first method of a first target program being modified, determine, based on the first target association relationship, a second function of a second target program associated with the first function or a second method of the second target program associated with the first method, and determine, based on the second target association relationship, a target test case associated with the first target program; and A determination module is configured to execute the target test case to test the first function and the second function or to test the first method and the second method.

9. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.

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

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