Multi-objective optimization integrated test sequence generation method and related device
By generating integrated test sequences through a multi-objective optimization method, the problem of failing to effectively consider module defect data in existing technologies is solved. High-defect modules and high-defect dependency modules are integrated first, thereby improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202511683454.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-17
AI Technical Summary
Existing technologies fail to effectively consider module defect data when generating integration test sequences, leading to delayed integration of highly defective modules and impacting testing efficiency and cost.
A multi-objective optimization method is adopted. By obtaining the number of defects and dependencies of software modules, a fitness function is constructed to generate the optimal integration test sequence. Modules with high defects and high dependency are integrated first, and the overall complexity of the test stubs is optimized.
This approach enables efficient discovery of interface defects between modules while minimizing testing costs, prioritizing the integration of modules with high defects and high dependency rates, thereby improving the efficiency and accuracy of integration testing.
Smart Images

Figure CN121542166A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software testing technology, and in particular to a method and apparatus for generating multi-objective optimized integration test sequences. Background Technology
[0002] Software testing can be divided into unit testing, integration testing, and system testing. Integration testing aims to test whether the interfaces and interactions between different software modules are normal, and is an important means of ensuring software reliability. Determining the order of module integration is a crucial topic in integration testing. Traditional integration test sequence generation methods generally only consider the simulation cost of test stubs, using graph theory methods, optimization methods, and reinforcement learning methods to generate test sequences with minimal test stub complexity. However, in complex software systems, different software modules have varying importance. Considering only test cost may lead to the delayed integration of important modules, thus affecting testing efficiency and increasing the time and cost of fault detection and repair. Against this backdrop, graph theory methods and optimization methods that consider module importance have been proposed for determining integration test sequences. Their core idea is to identify important modules based on object relationship graphs and class-level dependency networks that can reflect the software architecture, thus using module importance as a target, and considering both module importance and test cost when determining the test sequence. However, the above methods all measure module importance from the perspective of architecture, and the importance of the structural dimension may not be sufficient to reflect the true importance of a module.
[0003] Software testing aims to discover potential defects in software. Therefore, directly measuring the importance of a module from the perspective of defect occurrence is more practical, especially when module defect data has already been obtained during the unit testing phase. This defect data should be fully utilized to achieve efficient integration testing. However, current test sequence generation techniques do not determine module importance from a defect perspective, thus hindering the achievement of more efficient testing. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies in measuring the importance of modules, which lack consideration of the defects of the modules themselves. This results in highly defective modules not being integrated first, and consequently, defects in the interfaces between modules cannot be efficiently discovered. The invention provides a multi-objective optimization integration test sequence generation method and related apparatus.
[0005] The objective of this invention is achieved through the following technical solution: a method for generating multi-objective optimization ensemble test sequences, comprising the following steps: Obtain the software module; The sequence of high-defect modules is determined based on the number of defects in the software modules; Calculate the high-defect module latency integration rate and the overall complexity of the test stubs in the test sequence, and construct a fitness function for the high-defect module latency integration rate and the overall complexity of the test stubs; the high-defect module latency integration rate is used to measure the degree of deviation between the high-defect module sequence and the test sequence; the overall complexity of the test stubs is determined based on the complexity of interface attribute calls and method calls between modules; A multi-objective optimization method is used to minimize each objective function in the fitness function to generate the optimal ensemble test sequence.
[0006] In one example, the process of minimizing the objective functions in the fitness function using a multi-objective optimization method to generate the final ensemble test sequence further includes: Obtain software module dependencies; A directed module dependency network is established, with modules as nodes and module dependencies as edges. Based on the directed module dependency network, an adjacency matrix and a feature matrix are constructed, and a graph neural network model is used to perform an edge classification task to obtain the defect prediction results of module dependency relationships, thereby obtaining a high defect dependency sequence determined based on the defect probability magnitude. Calculate the high defect dependency delay integration rate of the test sequence, and construct a fitness function for the high defect module delay integration rate, the high defect dependency delay integration rate, and the overall complexity of the test stub; the high defect dependency delay integration rate is used to measure the degree of deviation between the high defect dependency sequence and the dependency sequence.
[0007] In one example, the adjacency matrix is determined based on the topology of the directed module-dependent network, and is represented as follows: ; in, Represents the adjacency matrix; This indicates the dependencies between modules. , , It is a module tag, and .
[0008] In one example, the feature matrix includes structural features and defect features. The structural features are obtained by calculating the node-oriented network structure parameters in the directed module dependency network. The node-oriented network structure parameters include the degree, degree centrality, and betweenness centrality of the nodes. The defect features are determined based on the number of defects in each module in the high-defect module sequence.
[0009] In one example, the feature matrix is represented as: ; in, Represents the characteristic matrix; Representation module Thek Structural features , Representation module Defect characteristics ; Structural feature labels; , It is a module tag, and .
[0010] In one example, the overall complexity of the test pile is expressed as: in, Indicates the overall complexity of the test pile; Represents all test piles that need to be simulated; Representation module Simulation module The complexity of constructing test piles; Representation module Calling Module The number of attributes; Representation module Calling Module The number of methods; , , and Represent and The maximum and minimum values; and yes and The result after normalization; and As weight, and .
[0011] In one example, the process of minimizing the objective functions in the fitness function using a multi-objective optimization method to generate the final ensemble test sequence includes the following sub-steps: Population initialization: Randomly generate multiple test sequences and define the sequence length; Evolutionary Generation Determination: Determine whether the evolutionary generation of the test sequence has reached the maximum evolutionary generation. If it has, stop evolution and output the population; if it has not, jump to the fitness function construction step. Construct a fitness function: Construct a fitness function for the high defect module delay integration rate and the overall complexity of the test stub, or construct a fitness function for the high defect module delay integration rate, the high defect dependency delay integration rate and the overall complexity of the test stub; Fast non-dominated sorting and crowding distance calculation: Perform fast non-dominated sorting on the population according to the fitness function and calculate the crowding distance; Generation of offspring population: Based on the comprehensive evaluation results of fast non-dominated sorting and crowding distance, offspring population is generated through selection, crossover and mutation operations, and the fitness function of offspring population is calculated. Merging parent and offspring populations: The parent and offspring populations are merged to obtain the merged population; Generate a new population: Perform a fast non-dominated sort on the merged population and calculate the crowding distance. Select multiple individuals to form a new population based on the non-dominated level and crowding distance. Then, jump to the generation determination step until the maximum generation is reached. Output the population as the optimal ensemble test sequence.
[0012] It should be further noted that the technical features corresponding to the above examples can be combined or replaced to form new technical solutions.
[0013] The present invention also includes a computer program product comprising a computer program that, when executed by a processor, implements the steps of the multi-objective optimization integration test sequence generation method formed by any or a combination of the above examples.
[0014] The present invention also includes a storage medium storing computer instructions that, when executed, perform the steps of the multi-objective optimization integration test sequence generation method formed by any or more of the above examples.
[0015] The present invention also includes a terminal comprising a memory and a processor, the memory storing computer instructions executable on the processor, wherein the processor, when executing the computer instructions, performs the steps of the multi-objective optimization integration test sequence generation method formed by any or more of the above examples.
[0016] Compared with the prior art, the beneficial effects of the present invention are: 1. In one example, the present invention aims to reduce the delayed integration rate of high-defect modules and the overall complexity of test stubs. It uses a multi-objective optimization algorithm to generate integration test sequences, minimizing test costs (overall complexity of test stubs) while prioritizing the integration of high-defect modules, thereby achieving more efficient integration testing and avoiding the waste of test resources and the extension of test time caused by the delayed integration of high-defect modules.
[0017] 2. In one example, the present invention further introduces the inter-module dependency defect probability as an optimization objective. It not only considers the testing cost, but also the defect situation of software modules and inter-module dependencies. It can prioritize the integration of software modules with high defects and high defect probability dependencies while ensuring that the testing cost is minimized, thereby efficiently discovering defects in the interface and interaction between modules, thus balancing testing efficiency and testing cost. Attached Figure Description
[0018] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. The accompanying drawings are provided to provide a further understanding of the present application and constitute a part of the present application. The same reference numerals are used in these drawings to denote the same or similar parts. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application.
[0019] Figure 1 This is a flowchart of an integrated test sequence method provided as an example of the present invention; Figure 2 A method flowchart is provided as a preferred example of the present invention; Figure 3 This is a flowchart of a multi-objective optimization method provided as an example of the present invention; Detailed Implementation
[0020] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0021] In one example, such as Figure 1 As shown, a multi-objective optimization integration test sequence generation method is applicable to any software system with a modular structure where modules collaborate with each other, such as network domain name service systems, operating systems, database management systems, and distributed systems. The method includes the following steps: S10: Obtain the software module.
[0022] Specifically, static analysis tools are used to scan the software under test, obtain the software modules, and record and organize the software modules under test as follows: m .
[0023] S20: Determine the sequence of high-defect modules based on the number of defects in the software modules; Specifically, based on the unit test results, the number of defects in each software module is obtained, and all modules are sorted in descending order of the number of defects to obtain a sequence of modules with high defects. Its length is m High-defect module sequence Modules that appear earlier in the order list have more defects and should be integrated first during integration testing. Alternatively, a defect count threshold can be set to define a sequence of modules with more defects than the threshold as a high-defect sequence, and then this high-defect sequence should be sorted in descending order.
[0024] S30: Calculate the high-defect module delay integration rate and the overall complexity of the test stubs in the test sequence, and construct a fitness function for the high-defect module delay integration rate and the overall complexity of the test stubs. The high-defect module delay integration rate is used to measure the degree of deviation between the high-defect module sequence and the test sequence; the overall complexity of the test stubs is determined based on the complexity of interface attribute calls and method calls between modules.
[0025] Specifically, the Kendall rank correlation coefficient was used to calculate the high-defect module sequence. With test sequence degree of deviation The test sequence refers to the order in which software modules are integrated into the software system and tested. High-defect module sequence. With test sequence degree of deviation The value range is [-1, 1]. A value of 1 indicates that the two are completely the same, and a value of -1 indicates that the two are opposite.
[0026] Furthermore, the high-defect module latency integration rate is defined. : ; Smaller sizes mean that high-defect modules will be integrated first. This invention simultaneously considers the overall complexity (testing cost) of the test stubs. As the optimization objective for generating test sequences, the fitness function at this time for: .
[0027] S40: Use a multi-objective optimization method to minimize each objective function in the fitness function and generate the final ensemble test sequence.
[0028] Specifically, the test sequence is encoded using real numbers. Encoding is performed where each real number in the sequence represents a software module, based on a defined fitness function. The final ensemble test sequences are generated using classic Pareto multi-objective optimization algorithms such as NSGA-II, and the fitness function is minimized during the test sequence solving process. Each objective function in the equation.
[0029] This invention aims to reduce the delayed integration rate of high-defect modules and the overall complexity of test stubs. It uses a multi-objective optimization algorithm to generate integration test sequences, minimizing test costs while prioritizing the integration of high-defect modules. This avoids the waste of test resources and the extension of test time caused by the delayed integration of high-defect modules, thereby improving the efficiency of integration testing.
[0030] Preferably, integration testing aims to test whether the interactions between modules meet the expected requirements. Therefore, the probability of defects occurring in inter-module dependencies should also be considered. Module dependencies with a high probability of defects should be integrated first. However, current test sequence generation techniques do not determine the importance of module dependencies from the perspective of defects, thus making it difficult to achieve more efficient testing. To overcome this problem, a multi-objective optimization integration test sequence generation method, based on the previous example, constructs a fitness function that introduces module dependencies and further includes the following steps: Obtain software module dependencies; A directed module dependency network is established, with modules as nodes and module dependencies as edges. Based on the directed module dependency network, an adjacency matrix and a feature matrix are constructed, and a graph neural network model is used to perform an edge classification task to obtain the defect prediction results of module dependency relationships, thereby obtaining a high defect dependency sequence determined based on the defect probability magnitude. Calculate the high defect dependency delay integration rate of the test sequence, and construct a fitness function for the high defect module delay integration rate, the high defect dependency delay integration rate, and the overall complexity of the test stub; the high defect dependency delay integration rate is used to measure the degree of deviation between the high defect dependency sequence and the dependency sequence.
[0031] To further improve testing efficiency, the present invention preferably includes the following steps in a multi-objective optimized ensemble test sequence generation method: S1: Obtain software modules and their dependencies.
[0032] Specifically, static analysis tools are used to scan the software under test, obtain its modules and their dependencies, and record the software modules under test as follows: m The number of dependencies between modules is n .
[0033] S2: Establish a directed module dependency network with modules as nodes and inter-module dependencies as edges; This step represents the software architecture by constructing a software module dependency network, denoted as [the network is then described]. , Represents a set of nodes. Let be the set of edges.
[0034] S3: Determine the sequence of high-defect modules based on the number of defects in the software modules.
[0035] Record the number of defects for each software module obtained from unit tests, and sort all modules in descending order of defect count to obtain the sequence of modules with the most defects. Its length is m High-defect module sequence The modules from the Chinese and Vietnamese regions that appear earlier in the integration test have a higher number of defects and should be prioritized for integration.
[0036] S4: Based on the directed module dependency network, construct the adjacency matrix and feature matrix, and use a graph neural network model (such as an unsupervised graph neural network model GNN) to perform an edge classification task to obtain the defect prediction results of the edges, i.e., the defect prediction results of the module dependencies. Then, determine the high-defect dependency sequence based on the defect probability magnitude in the module dependency defect prediction results. Optionally, sort all dependencies in descending order of defect probability to obtain the high-defect dependency sequence. Its length is n High-defect dependency sequences Dependencies that are earlier in the process of integration between China and Vietnam have a higher probability of defects, and their corresponding modules should be integrated first during integration testing.
[0037] S5: Calculate the high defect-dependent delay integration rate of the test sequence and construct a fitness function for the high defect module delay integration rate, the high defect-dependent delay integration rate, and the overall complexity of the test stubs.
[0038] Specifically, the integration order of the modules, i.e., the test sequence, is represented as follows: Test sequence Synchronization determines the integration order of dependencies, i.e., the dependency sequence, denoted as... The sequence of high-defect modules was calculated using Kendall's rank correlation coefficient. With test sequence The degree of deviation and the high defect dependency sequence With dependent sequences degree of deviation . and The values of both are in the range of [-1, 1], where a value of 1 indicates that they are completely identical, and a value of -1 indicates that they are opposites. Based on this, the high-defect module latency integration rate... and high defect-dependent latency integration rate They are represented as follows: ; ; , Smaller size means that modules and dependencies with high defects will be integrated first.
[0039] At this point, the present invention relates to the high-defect module delay integration rate. High defect-dependent delayed integration rate and overall complexity of test piles The fitness function is expressed as: .
[0040] S6: Use a multi-objective optimization method to minimize each objective function in the fitness function and generate the final integration test sequence.
[0041] Specifically, the test sequence is encoded using real numbers. Encoding is performed where each real number in the sequence represents a software module, based on a defined fitness function. The final ensemble test sequences are generated using classic Pareto multi-objective optimization algorithms such as NSGA-II, and the fitness function is minimized during the test sequence solving process. Each objective function in the equation.
[0042] In this example, steps S3 and S4 can be executed simultaneously or in reverse order.
[0043] In one example, the adjacency matrix is determined based on the topology of the directed module-dependent network, and is represented as: ; in, Let the adjacency matrix be . matrix; This indicates the dependencies between modules. Representation module and There is a dependency, and vice versa. .
[0044] In one example, the construction of the feature matrix depends on the GNN model used. The feature matrix of the GNN model used in this invention, such as Graph Autoencoder (GAE) and Variational Graph Autoencoder (VGAE), is a node feature matrix, representing the feature vector of each node, containing two main categories: structural features and defect features. Specifically, it depends on the module-dependent network. G compute nodes Node-oriented network structure parameters such as degree, degree centrality, and betweenness centrality serve as structural features of nodes. Based on the high-defect module sequence The number of defects in each module is used as the defect feature of the node. .
[0045] In one example, based on the acquired structural features and defect characteristics The feature matrix is represented as: ; in, The characteristic matrix is denoted as . matrix; Representation module The k Structural features , Representation module Defect characteristics .
[0046] In one example, the overall complexity of the test stub is expressed as: in, Indicates the overall complexity of the test pile; Represents all test piles that need to be simulated; Representation module Simulation module The complexity of constructing test piles; Representation module Calling Module The number of attributes; Representation module Calling Module The number of methods; , , and Represent and The maximum and minimum values; and yes and The result after normalization; and As weight, and .
[0047] In one example, minimizing the objective functions in the fitness function using a multi-objective optimization method to generate the final ensemble test sequence includes the following sub-steps: (1) Population initialization: Randomly generate multiple test sequences Define the sequence length, which represents the module integration order; in this case, the evolutionary generation is recorded as 0. (2) Generation determination: Determine whether the generation of the test sequence has reached the maximum generation. t max If the target has been reached, stop the evolution and output population; if the target has not been reached, jump to step (3), i.e., the fitness function construction step. (3) Constructing a fitness function: Construct a fitness function for the high defect module delay integration rate and the overall complexity of the test pile, or construct a fitness function for the high defect module delay integration rate, the high defect dependency delay integration rate and the overall complexity of the test pile; (4) Fast non-dominated sorting and calculation of crowding distance: The population is sorted quickly according to the fitness function to identify individuals in different Pareto levels and calculate the crowding distance of individuals in the same non-dominated level to assess their distribution density. (5) Generating offspring population: Based on the comprehensive evaluation results of fast non-dominated sorting and crowding distance, offspring population is generated through selection, crossover and mutation operations, and the fitness function of offspring population is calculated. (6) Merge parent and offspring populations: Merge the parent and offspring populations to obtain the merged population; (7) Generate a new population: Perform fast non-dominated sorting on the merged population and calculate the crowding distance. Select multiple individuals to form a new population based on the non-dominated level (front edge) and crowding distance. At this point, the number of generations is [not specified]. t = t +1; (8) Jump to step (2) to determine whether the maximum number of generations has been reached. t max Then proceed to the next round of evolution until the maximum number of generations is reached, and output the population as the final ensemble test sequence.
[0048] Taking the DNS project as an example, the implementation process of generating integration test sequences using the method of this invention is explained, including the following steps: S1': Obtain the software modules and their dependencies.
[0049] Using static analysis tools such as Understand to scan the DNS source code, we obtained DNS module and dependency data, totaling 61 classes (modules) and 270 dependencies. Among them, the network domain name service system includes modules for protocol resolution and processing, resource record management, cache management, recursive resolution, network communication, and security.
[0050] S2': Establish a directed module dependency network with modules as nodes and inter-module dependencies as edges.
[0051] Based on module and dependency data, a directed class dependency network model is established using network modeling tools such as NetworkX, with classes as nodes and inter-class dependencies as edges. G .
[0052] S3': Determine the sequence of high-defect modules based on the number of defects in the software modules.
[0053] Based on the unit test results, all modules are sorted in descending order of the number of defects. Modules with the same number of defects are randomly sorted to obtain the sequence of modules with high defects. , The length is 61.
[0054] S4': Based on the directed module dependency network, construct the adjacency matrix and feature matrix, and use an unsupervised graph neural network model to perform an edge classification task to obtain the defect prediction results of module dependency relationships. Based on the defect probability magnitude in the defect prediction results of module dependency relationships, determine the high defect dependency sequence.
[0055] Specifically, using NetworkX computing networks G The degree, degree centrality, betweenness centrality, and other node-oriented network structure parameters of each node serve as the structural features of the nodes. Simultaneously, the number of defects in each module is used as the defect characteristic of the node. Based on structural features and defect characteristics Construct the feature matrix F Then, a graph autoencoder (GAE) is used to perform an edge classification task to obtain the defect prediction results of the edges, that is, the defect prediction results of the module dependencies. Based on the defect prediction results, all dependencies are sorted in descending order of defect probability to obtain the high-defect dependency sequence. , The length is 270.
[0056] S5': Construct a fitness function for the high defect module delay integration rate, the high defect dependency delay integration rate, and the overall complexity of the test stubs.
[0057] In high-defect module sequence and high defect dependency sequence Based on this, for any test sequence Calculate the corresponding high-defect module delay integration rate. High defect-dependent delayed integration rate and testing costs and minimize , and The objective is to use the fitness function. fitness .
[0058] S6': The NSGA-II multi-objective optimization method is used to minimize the objective functions in the fitness function to generate the final ensemble test sequence.
[0059] In this example, the population size N pop The maximum number of generations is 50. t max For a value of 500, using real number encoding, the optimization method includes the following sub-steps: (1) Population initialization: 50 test sequences are randomly generated. Each sequence has a length of 61, representing the module integration order, at which point the evolutionary generation is... t Recorded as 0; (2) Determine the number of generations: Determine whether the maximum number of generations has been reached. t max If the target has been reached, stop evolving the population; if the target has not been reached, proceed to step (3). (3) Fitness function calculation: Calculate the fitness function for each test sequence, i.e. , and ; (4) Fast non-dominated sorting and crowding distance calculation: Based on the fitness function obtained in step (3), the population is subjected to fast non-dominated sorting and crowding distance is calculated; (5) Generate offspring population: Generate offspring population with a size of 50 through selection, crossover and mutation operations, and calculate the fitness function of offspring population; (6) Merge parent and offspring populations: Merge the parent and offspring populations to obtain a merged population with a size of 100. (7) Generate a new population: Perform a fast non-dominated sort on the merged population and calculate the crowding distance. Then, select 50 individuals based on the frontier and crowding distance to form a new population. At this point, the number of generations is [not specified]. t = t +1; (8) Determine the number of generations: Proceed to step (2) to determine whether the maximum number of generations has been reached. t max The next round of evolution will proceed until the maximum number of generations (500) is reached. Then, evolution will stop and the population will be output as a confirmed ensemble test sequence.
[0060] This invention aims to reduce the high defective module delay integration rate, the high defect-dependent delay integration rate, and the overall complexity of test stubs. It uses a multi-objective optimization algorithm to generate integration test sequences, which can prioritize the integration of software modules with high defects and high defect probability dependencies while ensuring that the test cost is kept as low as possible. This avoids the waste of test resources and the extension of test time caused by the delayed integration of high defective modules and modules with high defect probability dependencies.
[0061] The present invention also provides a computer program product, comprising a computer program that, when executed by a processor, implements the steps of the multi-objective optimization integration test sequence generation method formed by any or a combination of the above examples. The processor may be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.
[0062] The present invention also provides a storage medium having the same inventive concept as the multi-objective optimization integration test sequence generation method formed by any or more of the above examples, wherein computer instructions are stored thereon, and the computer instructions, when executed, perform the steps of the multi-objective optimization integration test sequence generation method formed by any or more of the above examples.
[0063] Based on this understanding, the technical solution of this embodiment, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0064] This invention also provides a terminal having the same inventive concept as any or multiple examples corresponding to the above-described multi-objective optimization integration test sequence generation method, including a memory and a processor. The memory stores computer instructions executable on the processor, and the processor executes the steps of the above-described multi-objective optimization integration test sequence generation method when executing the computer instructions. The processor may be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement this invention.
[0065] In one example, the terminal, i.e., the electronic device, is represented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one processing unit (processor) mentioned above, at least one storage unit mentioned above, and a bus connecting different system components (including storage units and processing units).
[0066] The storage unit stores program code that can be executed by the processing unit, causing the processing unit to perform the steps described in the "Exemplary Methods" section above, based on various exemplary embodiments of the present invention. For example, the processing unit can execute the aforementioned multi-objective optimization ensemble test sequence generation method.
[0067] The storage unit may include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 3201 and / or a cache storage unit, and may further include a read-only memory (ROM).
[0068] The storage unit may also include a program / utility having a set (at least one) of program modules, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0069] A bus can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus that uses any of the various bus structures.
[0070] The electronic device can also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication can be performed via input / output (I / O) interfaces. Furthermore, the electronic device can communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter. The network adapter communicates with other modules of the electronic device via a bus. It should be understood that other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0071] Through the above description, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to this exemplary embodiment can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method of the exemplary embodiment of this application.
[0072] The above detailed embodiments are a description of the present invention. It should not be considered that the specific embodiments of the present invention are limited to these descriptions. For those skilled in the art, several simple deductions and substitutions can be made without departing from the concept of the present invention, and all of these should be considered to fall within the protection scope of the present invention.
Claims
1. A multi-objective optimization integrated test sequence generation method, characterized by, The method comprises the following steps: obtaining a software module; determining a high-defect module sequence according to the number of defects of the software module; calculating a high-defect module delay integration rate of the test sequence and a test stub overall complexity, and constructing a fitness function about the high-defect module delay integration rate, the test stub overall complexity; the high-defect module delay integration rate is used to measure the deviation degree of the high-defect module sequence and the test sequence; the test stub overall complexity is determined according to the complexity of the inter-module interface attribute call and the method call; minimizing each objective function in the fitness function by using a multi-objective optimization method to generate a final integrated test sequence.
2. The multi-objective optimization integrated test sequence generation method of claim 1, wherein, Before the step of minimizing each objective function in the fitness function by using a multi-objective optimization method to generate a final integrated test sequence, the method further comprises the following steps: obtaining a software module dependency relationship; establishing a directed module dependency network by taking a module as a node and a module dependency relationship as an edge; constructing an adjacency matrix and a feature matrix according to the directed module dependency network, and performing an edge classification task by using a graph neural network model to obtain a defect prediction result of the module dependency relationship, and then obtaining a high-defect dependency sequence determined based on the probability size of defects; calculating a high-defect dependency delay integration rate of the test sequence, and constructing a fitness function about the high-defect module delay integration rate, the high-defect dependency delay integration rate and the test stub overall complexity; the high-defect dependency delay integration rate is used to measure the deviation degree of the high-defect dependency sequence and the dependency sequence.
3. The multi-objective optimization integrated test sequence generation method of claim 2, wherein, The adjacency matrix is determined based on the topological structure of the directed module dependency network, and is expressed as: ; wherein, denotes an adjacency matrix; denotes a dependency relation between modules, , , is a module label, and .
4. The multi-objective optimization integrated test sequence generation method of claim 2, wherein, The feature matrix comprises a structural feature and a defect feature; the structural feature is obtained by calculating a network structure parameter of a node in the directed module dependency network; the network structure parameter of the node comprises a degree of the node, a degree centrality and a betweenness centrality; The defect feature is determined according to the number of defects of each module in the high-defect module sequence.
5. The multi-objective optimization integrated test sequence generation method of claim 4, wherein, The feature matrix is expressed as: ; wherein, represents a feature matrix; represents a module of the first k structural feature , represents a defect feature of the module ; is a structural feature label; , is a module label, and .
6. The multi-objective optimization integrated test sequence generation method of claim 2, wherein, The test stub overall complexity is expressed as: wherein, represents the total complexity of the test stub; represents all test stubs that need to be simulated; represents the module simulating the module constructing the test stub; represents the module calling the module ; represents the module calling the module ; , , and represent the maximum and minimum values of and , respectively; and are the normalized results of and , respectively; and are the weights, and .
7. The multi-objective optimization integrated test sequence generation method of claim 2, wherein, The step of minimizing each objective function in the fitness function by using a multi-objective optimization method to generate a final integrated test sequence comprises the following sub-steps: population initialization: randomly generating a plurality of test sequences, and defining a sequence length; evolution generation judgment: judging whether the evolution generation of the test sequence reaches a maximum evolution generation; if yes, stopping evolution and outputting a population; if not, jumping to the step of constructing a fitness function; constructing a fitness function: constructing a fitness function about the high-defect module delay integration rate and the test stub overall complexity, or constructing a fitness function about the high-defect module delay integration rate, the high-defect dependency delay integration rate and the test stub overall complexity; fast non-dominated sorting and calculating a crowding distance: performing fast non-dominated sorting on the population according to the fitness function, and calculating a crowding distance; generating a child population: generating a child population by selection, crossover and mutation operations according to the comprehensive evaluation results of the fast non-dominated sorting and the crowding distance, and calculating the fitness function of the child population; merging the parent population and the child population to obtain a merged population; Generating new population: fast non-dominated sorting is performed on the merged population and the crowding distance is calculated, multiple individuals are selected according to the non-dominated level and the crowding distance to form a new population, then jumping to the evolution number judgment step until reaching the maximum evolution number, and outputting the population as the final integrated test sequence.
8. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the multi-objective optimization integrated test sequence generation method of any one of claims 1-7.
9. A storage medium having stored thereon computer instructions, characterized in that, The computer program, when executed by a processor, implements the steps of the multi-objective optimization integrated test sequence generation method of any one of claims 1-7.
10. A terminal comprising a memory and a processor, said memory having stored thereon computer instructions executable on said processor, characterized in that, The computer program, when executed by a processor, implements the steps of the multi-objective optimization integrated test sequence generation method of any one of claims 1-7.