A testing method, system, device and product for new functions of a software system
By constructing a new directed dependency graph and optimizing the path, the problem of insufficient coverage in new function testing of software systems is solved, efficient and accurate test coverage is achieved, and testing costs and workload are reduced.
Patent Information
- Application Number
- CN202410903037.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-07-08
AI Technical Summary
After the software system is updated and iterated, it is difficult to fully cover the impact of new functions on existing functions, resulting in low testing efficiency and inaccurate results.
By constructing a new directed dependency graph, select new function nodes, entry nodes and key nodes, conduct in-depth traversal and optimize the path, and form a test path to ensure accurate extraction and test coverage of the impact scope of the new function.
It improves testing efficiency and accuracy, reduces unnecessary testing and duplication of work, reduces testing costs, and ensures comprehensiveness and accuracy of test coverage.
Smart Images

Figure CN118445213B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a method, system, equipment and product for testing new functions of a software system. Background Art
[0002] With the continuous development and improvement of software systems, the speed of software system updates and iterations is getting faster and faster, and the addition and update of new functions have become the norm. At this time, after the software system is updated and iterated, it is necessary to test the software system before going online to ensure the reliability and accuracy of the software system. When testing the updated and iterated software system, the corresponding test cases are mainly written for the updated and iterated content of the software system. After the test, the test results obtained by the software after executing the test case can be manually checked to determine whether the software system has passed the test. For example, the Chinese invention patent with application publication number CN117591401A discloses an automated testing system, method, equipment and storage medium, and the system includes: a detection module, a test module and a test script library, the detection module is connected to the test module, and the test module is connected to the test script library. The detection module is used to send a test instruction to the test module when a new function of the product to be tested is detected, and the test instruction includes the product information of the product to be tested. The test module is used to obtain multiple test scripts from the test script library according to the product information in response to the test instruction, run multiple test scripts, and test all functions of the product to be tested.
[0003] However, due to the huge and complex functions of software systems, how to effectively extract the impact of new functions on existing functions has become a key issue in the testing process. Traditional testing methods generally rely on the experience of testers to write test cases, which often makes it difficult to fully cover all functions and business processes, resulting in low testing efficiency and inaccurate results. Summary of the invention
[0004] The present invention aims to solve the problem that it is difficult to comprehensively and efficiently test new functions of a software system. To this end, the present invention provides a testing method, system, device and product for new functions of a software system, which constructs a new directed dependency graph based on the original directed dependency graph of the software system and the new function, and selects nodes, traverses paths and selects paths based on the new directed dependency graph, and finally obtains a test path that comprehensively covers all functions and business processes involved in the new function, realizes accurate extraction of the impact range of the new function, improves test efficiency and accuracy, and is particularly suitable for continuous integration testing of new functions of software systems.
[0005] The present invention provides a method for testing new functions of a software system, and the technical solution adopted is as follows:
[0006] Obtain the original directed dependency graph and new functions of the software system;
[0007] Constructing a new directed dependency graph according to the original directed dependency graph and the new function;
[0008] Selecting new function nodes, entry nodes and key nodes from the nodes of the new directed dependency graph;
[0009] According to the new directed dependency graph, perform a deep traversal from the entry node to find all paths that pass through the key node to reach the new function node; among all the paths corresponding to each key node, select the path with the shortest length as the key path;
[0010] Determine whether the edges in the out-degree direction of the new function node are fully covered by the critical path. If fully covered, use the critical path as a test path; if not fully covered, take the new function node as a starting point, add the uncovered edges and nodes connected to the edges to the critical path to form a test path;
[0011] The test path is tested to complete the test of the new function of the software system.
[0012] Furthermore, the new functions include newly added functional modules and updated original functional modules of the software system.
[0013] Furthermore, the original directed dependency graph and the new directed dependency graph both include nodes, edges, out-degree and in-degree, the nodes represent functional modules of the software system, the edges represent business associations and data flows between the functional modules, the out-degree of a node represents the number of edges from the node to other nodes, and the in-degree of a node represents the number of edges from other nodes to the node.
[0014] Furthermore, the new function node is a node corresponding to a new function of the software system;
[0015] The entry node is a user entry node closest to the new function node, or the new function node which is a user entry node;
[0016] The key node is a node directly connected to the new function node.
[0017] Furthermore, before performing a deep traversal from the entry node:
[0018] Select one or more of isolated nodes and irrelevant nodes from the nodes of the new directed dependency graph;
[0019] Deleting the isolated node from the new directed dependency graph, wherein the isolated node is a node that is not connected to other nodes,
[0020] The irrelevant node and the edge connected to the irrelevant node are deleted from the new directed dependency graph, wherein the irrelevant node is a node with an out-degree or an in-degree of 1 and is not directly connected to the new function node.
[0021] Furthermore, in the process of performing a deep traversal from the entry node to find all paths that pass through the key node to reach the new function node, when a loop is encountered, the loop is jumped out after one cycle.
[0022] Furthermore, when the key node corresponds to multiple key paths, only the key path with the largest sum of out-degree and in-degree is retained.
[0023] The present invention also provides a testing system for new functions of a software system, which adopts the following technical solution: comprising a model generation module, a path generation module and a testing module connected in sequence,
[0024] The model generation module is used to obtain the original directed dependency graph and the new function of the software system; and construct a new directed dependency graph according to the original directed dependency graph and the new function;
[0025] The path generation module is used to select new function nodes, entry nodes and key nodes from the nodes of the new directed dependency graph; according to the new directed dependency graph, perform a deep traversal from the entry node to find all paths that pass through the key nodes to reach the new function nodes; among all the paths corresponding to each key node, select the path with the shortest length as the key path; determine whether the edges in the out-degree direction of the new function node are fully covered by the key path, if fully covered, use the key path as a test path; if not fully covered, take the new function node as the starting point, add the uncovered edges and the nodes connected to the edges to the key path to form a test path;
[0026] The test module is used to test the test path and complete the test of the new function of the software system.
[0027] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned method for testing a new function of a software system when executing the computer program.
[0028] The present invention also provides a computer program product, including a computer program, which implements the above-mentioned method for testing a new function of a software system when executed by a processor.
[0029] The above one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects:
[0030] 1. The present invention tests new functions of a software system by adding new nodes and edges to the original directed dependency graph of the software system, and the process is simple. The present invention can adapt to changes in the software system and realize continuous integration testing of new functions by dynamically updating the directed dependency graph.
[0031] 2. The present invention constructs a new directed dependency graph based on the functional modules of the software system and the business associations and data flows between the functional modules, and selects new functional nodes, entry nodes and key nodes on this basis. By accurately selecting key nodes, etc., it achieves accurate extraction of the impact scope of new functions, thereby ensuring the comprehensiveness and accuracy of test coverage.
[0032] 3. Based on new function nodes, entry nodes and key nodes, the present invention deeply traverses the new directed dependency graph, optimizes the path, forms a test path, avoids unnecessary testing and duplication of work, and thus reduces the testing cost.
[0033] 4. The present invention selects isolated nodes and irrelevant nodes that have no actual impact on testing new functions, deletes them from the new directed dependency graph, optimizes the new directed dependency graph, and helps to improve the efficiency of deep traversal.
[0034] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 It is a flow chart of the method provided by the present invention.
[0037] Figure 2 It is the original directed dependency graph of the software system provided by the present invention.
[0038] Figure 3 It is a new directed dependency graph of the software system provided by the present invention.
[0039] Figure 4 It is the optimized new directed dependency graph provided by the present invention.
[0040] Figure 5 It is a structural block diagram of the system provided by the present invention.
[0041] Reference numerals:
[0042] 1. Model generation module; 2. Path generation module; 3. Test module. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. The following embodiments are used to illustrate the present invention, but cannot be used to limit the scope of the present invention.
[0044] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0045] Combine the following Figure 1-Figure 5 The present invention is further described in detail, and a testing method, system, device and product for a new function of a software system of the present invention are described:
[0046] In this embodiment, Figure 1 As shown, a method for testing new functions of a software system is provided, comprising the following steps:
[0047] Step 1: Get the original directed dependency graph and new functions of the software system.
[0048] The new functions include newly added function modules and updated original function modules of the software system. The number of the new functions can be one or more.
[0049] A directed dependency graph includes nodes, edges, out-degree and in-degree. The nodes represent the functional modules of the software system, the edges represent the business associations and data flows between the functional modules, the out-degree of a node represents the number of edges from the node to other nodes, and the in-degree of a node represents the number of edges from other nodes to the node. The construction process of a directed dependency graph is as follows: determine the nodes of the directed dependency graph according to the functional modules of the software system, establish edge relationships according to the business associations and data flows between the functional modules, and then calculate the out-degree and in-degree of each node to construct a directed dependency graph.
[0050] Step 2: Construct a new directed dependency graph based on the original directed dependency graph and the new function. The specific process is: add the nodes corresponding to the new function to the original directed dependency graph, establish edges based on the business association and data flow between the new function and the original functional module, and recalculate the out-degree and in-degree of the node.
[0051] The directed dependency graph is a functional model of the software system. The new function is added to the original directed dependency graph as an independent new node. The new node represents the newly added functional module of the software system and the updated original functional module. The present invention uses the nodes of the directed dependency graph to define the functional modules of the software system; uses the directionality of the edges to define the business associations and data flows to clarify the dependency relationship and interaction logic between the new function and the original function. This helps to understand how the new function works and its position and role in the entire software system.
[0052] Step 3: Select new function nodes, entry nodes and key nodes from the nodes of the new directed dependency graph.
[0053] The new function node is a node corresponding to the new function of the software system, that is, a newly added function module and an updated original function module of the software system.
[0054] The entry node is a user entry node closest to the new function node, or the new function node which is a user entry node itself.
[0055] The key node is a node directly connected to the new function node.
[0056] When the new function node is a user entry node, the new function node will be selected as the entry node. That is, when the node corresponding to the new function of the software system is a user entry node, it will be determined as a new function node and an entry node at the same time.
[0057] Step 4: Optimize the new directed dependency graph, specifically, select one or more of isolated nodes and irrelevant nodes from the nodes of the new directed dependency graph. Isolated nodes and irrelevant nodes have no actual impact on testing new functions, and thus can be deleted from the new directed dependency graph.
[0058] The isolated node is a node that is not connected to other nodes; the isolated node is deleted from the new directed dependency graph.
[0059] The irrelevant node is a node whose out-degree or in-degree is 1 and is not directly connected to the new function node; the irrelevant node and the edge connected to the irrelevant node are deleted from the new directed dependency graph.
[0060] Step 5: According to the optimized new directed dependency graph, perform a deep traversal from the entry node to find all paths that pass through the key nodes to reach the new function node. When a loop is encountered, jump out of the loop after looping once, that is, loop the loop only once.
[0061] For a certain key node, if there is only one path covering it, this path is taken as the key path.
[0062] When there are multiple paths covering the same critical node, the path with the shortest length is selected from all the paths corresponding to the critical node as the critical path, and the remaining paths are recorded as non-critical paths, which can be deleted.
[0063] When a certain key node corresponds to multiple key paths, that is, there are multiple shortest paths with the same length, the sum of the out-degree and in-degree of all nodes of each key path is calculated respectively, and only the key path with the largest sum of out-degree and in-degree is retained, and the other key paths are deleted.
[0064] Finally, each of the key nodes corresponds to a key path. In step 5, generally multiple key paths are obtained.
[0065] Step 6: Determine whether the edges in the outgoing direction of the new function node are fully covered by the critical path. If fully covered, the critical path is used as a test path; if not fully covered, the edges that are not covered and the nodes connected to the edges are added to the critical path with the new function node as the starting point to form a test path. This step can ensure the coverage of all key nodes and the compatibility of related functions.
[0066] Step 7: Test the test path to complete the test of the new function of the software system.
[0067] When testing the test path, the test path is tested in order from large to small according to the sum of the out-degree and in-degree of the test path, so as to ensure that the functional nodes with important functions or more interactions are tested first.
[0068] The new directed dependency graph constructed in step 2 of this embodiment can be used as the original directed dependency graph when a new function is added to the software system again. During the continuous integration test of the new function of the software system, there is no need to construct the original directed dependency graph. Therefore, the present invention is particularly suitable for the continuous integration test of the new function of the software system.
[0069] The following is a description of the process of this method in conjunction with a specific software system:
[0070] Step 1: Obtain the original directed dependency graph and new functions of the software system. The software system has 13 original functional modules and 1 new functional module. The original directed dependency graph is as follows Figure 2 As shown, there are 13 nodes in the figure, named P1, P2, P3, ..., P13, corresponding to the 13 original functional modules of the software system.
[0071] The relationship between the functional modules is represented by an array of nodes: [P1, P2], [P2, P3], [P2, P4], [P2, P7], [P2, P13], [P3, P7], [P3, P8], [P4, P5], [P4, P6], [P6, P12], [P7, P9], [P7, P10], [P8, P2], [P11, P10], [P13, P10]. Each array indicates that there is an association relationship between two nodes, and the direction is from the previous node to the next node. For example: [P1, P2] means that there is an association relationship between P1 and P2, and data flows from P1 to P2.
[0072] Figure 2 The arrows in the figure are edges, indicating the business association and data flow between the functional modules. The numbers in brackets next to the nodes indicate the out-degree and in-degree of the node. For example: P2 (4, 2) means that the out-degree of P2 is 4 and the in-degree is 2.
[0073] Step 2: Construct a new directed dependency graph based on the original directed dependency graph and the new function, such as Figure 3 shown. Figure 3 A node named Pnew is added to the graph, corresponding to a new functional module of the software system. Correspondingly, the relationship between the added functional modules is represented by an array of nodes: [P12, Pnew], [P5, Pnew], [Pnew, P10]. Edges are also added to the original directed dependency graph, and the out-degree and in-degree of some nodes are adjusted.
[0074] Step 3: Select new function nodes, entry nodes and key nodes: the new function node is Pnew; the entry node is P2; the key nodes are P5, P10 and P12.
[0075] Step 4: Optimize the new directed dependency graph.
[0076] from Figure 3 It can be seen that there are no isolated nodes.
[0077] The in-degree of P9 is 1, and it is not directly connected to Pnew; the out-degree of P11 is 1, and it is not directly connected to Pnew. Therefore, P9 and P11 are unrelated nodes.
[0078] Delete P9 and P11, as well as the edges connecting P9 and P11, from the new directed dependency graph to obtain an optimized new directed dependency graph, as shown in Figure 4 shown.
[0079] Step 5: Based on the optimized new directed dependency graph, starting from P2 and targeting Pnew, perform a deep traversal to obtain all paths that pass through P5, P10, or P12:
[0080] Path1: P2->P4->P5->Pnew;
[0081] Path 2: P2->P3->P8->P2->P4->P5->Pnew. There is a loop here, and the loop only needs to be covered once.
[0082] Path3:P2->P3->P7->P10->Pnew;
[0083] Path 4: P2->P3->P8->P2->P3->P7->P10->Pnew. There is a loop here, and the loop only needs to be covered once.
[0084] Path5: P2->P13->P10->Pnew;
[0085] Path 6: P2->P3->P8->P2->P13->P10->Pnew. There is a loop here, and the loop only needs to be covered once.
[0086] Path7: P2->P7->P10->Pnew;
[0087] Path 8: P2->P3->P8->P2->P7->P10->Pnew. There is a loop here, and the loop only needs to be covered once.
[0088] From the above 8 paths, select the shortest path that passes through P5:
[0089] Path1: P2->P4->P5->Pnew, as the critical path.
[0090] Select the shortest path that passes through P10:
[0091] Path5: P2->P13->P10->Pnew, as the key path;
[0092] Path7: P2->P7->P10->Pnew, as the critical path.
[0093] Path5 and Path7 have the shortest path lengths and are the same. P10 corresponds to two critical paths and needs to be optimized. Compare the out-degree and in-degree of the nodes on Path5 and Path7, and select the one with the larger sum of out-degree and in-degree.
[0094] ΣDegree(Path5)=4+2+1+1+1+3+1+2=15;ΣDegree(Path7)=4+2+2+2+1+3+1+2=17, so Path5 is optimized and only Path7 is retained.
[0095] Among the above 8 paths, P12 has no corresponding critical path.
[0096] The final critical path is:
[0097] Path1: P2->P4->P5->Pnew;
[0098] Path7: P2->P7->P10->Pnew.
[0099] Step 6: After coverage judgment, the edge of Pnew->P12 is not covered by the above two critical paths. Add Pnew->P12 to the above two critical paths to obtain the test path:
[0100] Path1:P2->P4->P5->Pnew->P12;
[0101] Path7: P2->P7->P10->Pnew->P12.
[0102] Step 7: Test the test path.
[0103] Calculate the sum of the out-degree and in-degree of the nodes on the test path:
[0104] ΣDegree(Path1)=4+2+2+1+1+1+1+2+0+2=16;
[0105] ΣDegree(Path7)=4+2+2+2+1+3+1+2+0+2=18.
[0106] During the test execution, Path 7 is executed first, and then Path 1 is executed, which can ensure the compatibility coverage of the new function integrated into the entire software system. After executing the two test paths, the test of the new function of the software system is completed.
[0107] In this embodiment, Figure 5 As shown, a testing system for new functions of a software system is also provided, and the technical solution adopted is as follows: it includes a model generation module 1, a path generation module 2 and a test module 3 connected in sequence.
[0108] The model generation module 1 is used to obtain the original directed dependency graph and new functions of the software system; and construct a new directed dependency graph according to the original directed dependency graph and the new functions.
[0109] The path generation module 2 is used to select new function nodes, entry nodes and key nodes from the nodes of the new directed dependency graph; optimize the new directed dependency graph; according to the optimized new directed dependency graph, perform a deep traversal from the entry node to find all paths that pass through the key nodes to reach the new function nodes; among all the paths corresponding to each key node, select the path with the shortest length as the key path; determine whether the edges in the outgoing direction of the new function node are fully covered by the key path, and if so, use the key path as a test path; if not, take the new function node as the starting point, add the uncovered edges and the nodes connected to the edges to the key path to form a test path.
[0110] The test module 3 is used to test the test path and complete the test of the new function of the software system.
[0111] The working process of this system is:
[0112] The model generation module 1 obtains the original directed dependency graph and new functions of the software system; constructs a new directed dependency graph based on the original directed dependency graph and the new functions. The specific process is: add the nodes corresponding to the new functions to the original directed dependency graph, establish edges based on the business associations and data flows between the new functions and the original functional modules, and recalculate the out-degree and in-degree of the nodes. The nodes represent the functional modules of the software system, the edges represent the business associations and data flows between the functional modules, the out-degree of the node represents the number of edges from the node to other nodes, and the in-degree of the node represents the number of edges from other nodes to the node. The model generation module 1 sends the new directed dependency graph to the path generation module 2.
[0113] The path generation module 2 selects a new function node, an entry node and a key node from the nodes of the new directed dependency graph. The new function node is a node corresponding to the new function of the software system. The entry node is a user entry node closest to the new function node, or the new function node itself is a user entry node. The key node is a node directly connected to the new function node.
[0114] The path generation module 2 then optimizes the new directed dependency graph to obtain the optimized new directed dependency graph, and the specific process is: select isolated nodes and irrelevant nodes from the nodes of the new directed dependency graph. The isolated node is a node that is not connected to other nodes; the isolated node is deleted from the new directed dependency graph. The irrelevant node is a node with an out-degree or in-degree of 1 and is not directly connected to the new function node; the irrelevant node and the edge connected to the irrelevant node are deleted from the new directed dependency graph.
[0115] The path generation module 2 then performs a deep traversal from the entry node according to the optimized new directed dependency graph to find all paths that pass through the key node to reach the new function node. When a loop is encountered, it jumps out of the loop after looping once, that is, it loops only once. From all the paths corresponding to each key node, the path with the shortest length is selected as the key path. When a key node corresponds to multiple key paths, that is, there are multiple shortest paths with the same length, the sum of the out-degree and in-degree of all nodes of each key path is calculated respectively, and only the key path with the largest sum of out-degree and in-degree is retained.
[0116] The path generation module 2 then determines whether the edges in the out-degree direction of the new function node are fully covered by the critical path. If fully covered, the critical path is used as a test path; if not fully covered, the edges that are not covered and the nodes connected to the edges are added to the critical path with the new function node as the starting point to form a test path. All the test paths are sent to the test module 3.
[0117] The test module 3 tests the test paths in order from large to small according to the sum of the out-degree and in-degree of the test paths, and completes the test of the new functions of the software system.
[0118] This embodiment also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned method for testing a new function of a software system when executing the computer program.
[0119] This embodiment also provides a computer program product, including a computer program, which implements the above-mentioned testing method for a new function of a software system when executed by a processor.
[0120] The present invention is particularly suitable for scenarios of continuous integration testing of new functions of software systems, and the improvement in the effect is significant. Traditional testing methods often find it difficult to fully cover all functions and business processes, resulting in low testing efficiency and inaccurate results. The present invention achieves accurate extraction of the impact range of new functions by constructing a new software function model (directed dependency graph) and optimizing and filtering key nodes based on the model. It can not only reduce the testing workload and improve the testing efficiency, but also ensure the comprehensiveness and accuracy of the test coverage, thereby effectively avoiding the problems of test omissions and false positives.
[0121] The value of the present invention in software continuous integration testing is reflected in many aspects. On the one hand, it improves the quality of the software. By accurately extracting the impact range of new functions, test plans and use cases can be formulated more specifically to ensure that new functions will not introduce new defects or problems when integrated into the software system. This helps to improve the overall stability and reliability of the software system and reduce errors and failures that users may encounter during use. On the other hand, the cost of testing is reduced. Since the present invention can accurately identify key nodes and optimize test paths, unnecessary testing and duplication of work are avoided, thereby reducing the cost of testing. In addition, by reducing test omissions and false positives, the cost and time required for later defect repair are also reduced.
[0122] The present invention is also adaptable and flexible. As software systems continue to develop and improve, the addition and update of new functions become the norm. The present invention can adapt to changes in software systems and achieve continuous integration testing of new functions by dynamically updating software function models. This helps ensure quality assurance during the continuous evolution and upgrade of software systems.
[0123] In summary, the present invention plays an important role in software continuous integration testing, and has many values, such as improving software quality, reducing testing costs, and improving adaptability and flexibility. In the process of software system development and maintenance, the present invention can significantly improve the efficiency and accuracy of testing work, and provide strong support for the quality assurance of software systems.
[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for testing new functions of a software system, characterized in that: include Obtain the original directed dependency graph and new functions of the software system; Constructing a new directed dependency graph according to the original directed dependency graph and the new function; The original directed dependency graph and the new directed dependency graph both include nodes, edges, out-degrees and in-degrees, wherein the nodes represent the functional modules of the software system, the edges represent the business associations and data flows between the functional modules, the out-degree of a node represents the number of edges from the node to other nodes, and the in-degree of a node represents the number of edges from other nodes to the node; Selecting new function nodes, entry nodes and key nodes from the nodes of the new directed dependency graph; The new function node is a node corresponding to the new function of the software system; The entry node is a user entry node closest to the new function node, or the new function node which is a user entry node; The key node is a node directly connected to the new function node; According to the new directed dependency graph, perform a deep traversal from the entry node to find all paths that pass through the key node to reach the new function node; among all the paths corresponding to each key node, select the path with the shortest length as the key path; When the key node corresponds to multiple key paths, only the key path with the largest sum of out-degree and in-degree is retained; Determine whether the edges in the out-degree direction of the new function node are fully covered by the critical path. If fully covered, use the critical path as a test path; if not fully covered, take the new function node as a starting point, add the uncovered edges and nodes connected to the edges to the critical path to form a test path; The test path is tested to complete the test of the new function of the software system.
2. A method for testing new functions of a software system as claimed in claim 1, characterized in that: The new functions include newly added function modules and updated original function modules of the software system.
3. A method for testing new functions of a software system as claimed in claim 1, characterized in that: Before deep traversal from the entry node: Select one or more of isolated nodes and irrelevant nodes from the nodes of the new directed dependency graph; Deleting the isolated node from the new directed dependency graph, wherein the isolated node is a node that is not connected to other nodes, The irrelevant node and the edge connected to the irrelevant node are deleted from the new directed dependency graph, wherein the irrelevant node is a node with an out-degree or an in-degree of 1 and is not directly connected to the new function node.
4. A method for testing new functions of a software system as claimed in claim 1, characterized in that: In the process of performing a deep traversal from the entry node to find all paths that pass through the key node to reach the new function node, when a loop is encountered, the loop is jumped out after one cycle.
5. A testing system for new functions of a software system, characterized in that: A method for testing a new function of a software system as claimed in any one of claims 1 to 4, comprising a model generation module, a path generation module and a test module connected in sequence, The model generation module is used to obtain the original directed dependency graph and new functions of the software system; construct a new directed dependency graph according to the original directed dependency graph and the new functions; the original directed dependency graph and the new directed dependency graph both include nodes, edges, out-degree and in-degree, the nodes represent the functional modules of the software system, the edges represent the business associations and data flows between the functional modules, the out-degree of a node represents the number of edges from the node to other nodes, and the in-degree of a node represents the number of edges from other nodes to the node; The path generation module is used to select new function nodes, entry nodes and key nodes from the nodes of the new directed dependency graph; the new function nodes are nodes corresponding to the new functions of the software system; The entry node is the user entry node closest to the new function node, or the new function node which is itself a user entry node; the key node is a node directly connected to the new function node; According to the new directed dependency graph, perform a deep traversal from the entry node to find all paths that pass through the key node to reach the new function node; among all the paths corresponding to each key node, select the path with the shortest length as the key path; when the key node corresponds to multiple key paths, only retain the key path with the largest sum of out-degree and in-degree; determine whether the edges in the out-degree direction of the new function node are fully covered by the key path, and if so, use the key path as a test path; if not, take the new function node as the starting point, add the uncovered edges and the nodes connected to the edges to the key path to form a test path; The test module is used to test the test path and complete the test of the new function of the software system.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, a method for testing a new function of a software system according to any one of claims 1 to 4 is implemented.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, a method for testing a new function of a software system according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Automatic testing system, method and equipment and storage medium
CN117591401A
Modification influence analysis based regression test case updating method of part software
CN102831060A
Test case generation method based on optimized depth-first algorithm
CN111897739A
Software testing method and system, computer equipment and storage medium
CN116185869A
Function point test method and device, electronic equipment and storage medium
CN117609059A
