A software regression testing method and device based on finite state machine model
By building dependency graphs on finite state machine models and using improved genetic algorithms, the problem of insufficient automation and accuracy of regression tests in the prior art is solved, and efficient and automated software regression testing is achieved.
Patent Information
- Application Number
- CN202410598277.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-05-15
AI Technical Summary
When existing model-based regression testing technology performs change-impact domain analysis at the software model level, it is limited by the software model language, resulting in inaccurate and complete analysis, and most of them are manually executed, so efficiency and quality are difficult to guarantee, and there is a lack of unified testing. Sexual discrimination basis.
Using a regression testing method based on the finite state machine model, we use the EFSM model dependency graph to identify and classify the migration dependencies, and use the improved genetic algorithm to generate target test sequences and test data to realize automated regression testing.
It improves the automation degree and quality of regression testing, reduces the number of tests and overhead, and the generated test data is of high quality and efficiency is better than traditional methods, realizing the automated regression testing process with full test business coverage.
Smart Images

Figure CN118170691B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software engineering, and in particular to a software regression testing method and device based on a finite state machine model. Background Art
[0002] Regression testing is a critical activity in software engineering. It is an important technical link to ensure that software defects are modified correctly and the final state of the software is reliable and stable. Regression testing occurs after the software is changed. Common change activities include modification of software defects and adjustment of software requirements.
[0003] Software regression testing generally adopts two strategies: one is to execute all the test case sets used in the first test, and the other is to perform test impact domain analysis based on the modified parts of the software, and select or redesign new test case sets for testing. At present, with the continuous increase in the scale of application software code, the second strategy has gradually become the mainstream. Testing impact domain analysis based on software modification is a rich technical field. From the form of analysis objects, it can be divided into impact domain analysis for code changes and impact domain analysis for model changes. The application scenarios of these two technologies are different. Impact domain analysis for model changes is mainly used in model-based software engineering projects, and model-based software engineering is a rapidly developing direction.
[0004] In the model-based software engineering process, developers first establish a software requirement model, then generate a software design model through the model refinement process, and then the algorithm or tool automatically generates the software source code corresponding to the model. In this process, software testing activities are also carried out based on the model. Testers will build a test model based on the requirement model established by the developer, and then the algorithm or tool will automatically generate the corresponding test cases to complete the testing activities. In the model-based software engineering process, software changes usually occur at two levels: software source code and software model. The regression testing strategy must first determine the level of software changes, and then perform impact domain analysis on the changes at the corresponding level (source code or software model), and then select test cases (in the first test case set) or regenerate test cases.
[0005] Among the current regression testing technologies based on change impact domain analysis, model-based regression testing is the background technical field of the patent of this invention.
[0006] The Chinese patent "A model-based software regression testing method" provides a model-based software regression testing method, which generates a first test case set based on an old model before the change, and generates a second test case set based on a new model after the change; a mapping relationship between each model element in the old model and each test case in the first test case set is established based on the old model, and a mapping relationship between each model element in the new model and each test case in the second test case set is established based on the new model; a model change analysis is performed on the old model and the new model, the model elements affected by the model change are identified, and the affected model elements are classified; the targets that need to be covered by the regression test are determined from the affected model elements according to the coverage criteria; based on the mapping relationship between the model elements and the test cases, the regression test cases covering specific targets are selected as the final regression test case set in combination with the targets that need to be covered by the regression test; and the model-based software regression test is completed based on the final regression test case set.
[0007] The Chinese patent "A method and system for analyzing the impact domain of software regression testing" provides a method and system for analyzing the impact domain of software regression testing. The impact domain analysis method first constructs a directed weighted graph model to obtain all functional items under the test round, and uses the functional items in combination with the ternary closure theory to establish a directed weighted graph model. Then, the association probability of the functional items is calculated. According to the dependency correlation between the functional items, the directed weighted graph model is used to calculate the direct relationship between the functional items, and the weight of the degree of association between the functional items is obtained. Next, the functional item recommendation coefficient is calculated, the clustering coefficient and the neighborhood overlap are calculated, and then the functional item recommendation coefficient is calculated. Finally, a regression test case is generated. According to the size of the functional item recommendation coefficient, a software regression test case is generated.
[0008] At present, in model-based regression testing technology, the change impact domain is usually analyzed at the software model level. This analysis method is limited by the software model language, and the results are often not accurate and complete. In addition, most of this analysis is performed manually, and the efficiency and quality are difficult to guarantee. In addition, in the current model-based regression testing strategy, the generation of test sequences and test data is mostly based on a certain coverage criterion at the software model level. Due to the different languages of software models, the coverage criteria are also different, and there is a lack of unified test adequacy judgment basis. In addition, the current regression testing is mainly based on manual analysis and generation of test sequences, and the efficiency and quality of existing automation solutions need to be improved. Summary of the invention
[0009] Based on this, the embodiments of the present application provide a software regression testing method and device based on a finite state machine model, which solves the problem of automation of regression testing and improves the testing efficiency and quality of regression testing.
[0010] In a first aspect, a software regression testing method based on a finite state machine model is provided, the method comprising:
[0011] S1, construct the EFSM model dependency graph, identify the dependencies of the EFSM model when changes and migrations occur, and classify the identified dependencies;
[0012] S2, processing the identified classification results based on the improved genetic algorithm to determine the target test sequence corresponding to the EFSM model dependency graph;
[0013] S3, generating test data through a genetic algorithm according to the target test sequence, and implementing software regression testing based on the generated test data.
[0014] Optionally, S1, constructing an EFSM model dependency graph, and determining the dependency relationships of the EFSM model when a change migration occurs, and classifying the identified dependency relationships, including:
[0015] S11, identifying state transition data by comparing the original EFSM model and the changed EFSM model;
[0016] S12, constructing a model dependency graph for the original EFSM model and the changed EFSM model respectively based on the identified state transition data;
[0017] S13, traversing all model dependency graphs of the original EFSM model and the changed EFSM model, and classifying the identified dependency relationships.
[0018] Optionally, S2 processes the identified classification results based on an improved genetic algorithm, including:
[0019] Convert the identified classification results into regression test tasks, and determine the test tasks corresponding to each dependency based on the identified classification results;
[0020] According to the test obligations, specific coverage criteria are formulated; wherein the coverage criteria define the key points that the test needs to cover; wherein the key points include at least the migration that needs to be triggered, the state that needs to be verified, and the input / output combination that needs to be covered.
[0021] Optionally, the improved genetic algorithm specifically includes:
[0022] Design the algorithm’s initial population structure;
[0023] Designing individual encodings for representing test sequences;
[0024] Design selection operators to select excellent individuals from the population, design crossover operators to generate new individuals, and design mutation operators to increase the diversity of the population;
[0025] Design a mechanism to adaptively adjust crossover and mutation probabilities based on population status;
[0026] A fitness function is designed to evaluate the quality of test sequences, and a genetic algorithm is used to generate test sequences.
[0027] In the design of a mechanism to adaptively adjust the crossover and mutation probabilities according to the population status, the adaptive crossover and mutation probabilities specifically include:
[0028]
[0029] Among them, k is the initial probability of crossover or mutation, t is the current evolutionary generation, T is the upper limit of the evolutionary generation, fit is the fitness value of the current individual, and fit avg with fit max are the average and maximum values of the current population fitness respectively.
[0030] Optionally, S3, generating test data by a genetic algorithm according to the target test sequence, and implementing software regression testing based on the generated test data, includes:
[0031] S31, filtering out data related to the current regression test from the historical test data, and determining the sequence portion that cannot be covered by the historical data by analyzing the target test sequence.
[0032] S32, initialize a population containing multiple individuals, and use the FSCS-ATR algorithm to generate the remaining individuals;
[0033] S33, calculating the fitness value for each individual in the population to evaluate the coverage and effectiveness of the test data generated by the individual for the target test sequence; at the same time, using the individual information sharing strategy, optimizing each test sequence, and stopping the iteration of the sub-population when the optimization reaches the preset stop condition;
[0034] S34, according to the fitness value of the individual, use operations such as selection, crossover and mutation to generate new individuals;
[0035] S35, repeatedly iterate S33-S34 until the algorithm termination condition is met or the maximum number of iterations is reached.
[0036] In a second aspect, a software regression testing device based on a finite state machine model is provided, the device comprising:
[0037] The classification module is used to construct the EFSM model dependency graph, identify the dependency relationships of the EFSM model when changes and migrations occur, and classify the identified dependencies;
[0038] A determination module is used to process the identified classification results based on an improved genetic algorithm to determine a target test sequence corresponding to the EFSM model dependency graph;
[0039] The test module is used to generate test data through a genetic algorithm according to the target test sequence, and implement software regression testing based on the generated test data.
[0040] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the software regression testing method based on a finite state machine model as described in any one of the first aspects above is implemented.
[0041] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the software regression testing method based on a finite state machine model described in any one of the first aspects is implemented.
[0042] In a fifth aspect, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the software regression testing method based on a finite state machine model as described in any one of the first aspects above.
[0043] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0044] (1) The algorithm can automatically obtain the dependency relationships affected by changes from the model dependency graph, which first solves the uncertainty caused by manual analysis and improves the efficiency of analysis. At the same time, experiments show that the automated process can achieve the same level of accuracy as manual analysis.
[0045] (2) Compared with other more mature algorithms, the test sequence generation method based on genetic algorithm with full test business coverage as the criterion can reduce the total length of test sequences and the number of test sequences by an average of about 7% and 50%, respectively. This shows that this algorithm can effectively reduce the number of tests and reduce the test overhead compared with existing research on the basis of meeting the regression test coverage conditions.
[0046] (3) The new algorithm that combines the genetic algorithm and the greedy algorithm performs well in test data generation. First, the initial population construction method designed can make full use of historical test data, and the fusion of random tests also greatly increases the diversity of the initial population. Secondly, the improvement in the algorithm structure significantly improves the execution efficiency of the multi-population genetic algorithm. The experimental results show that the overall efficiency of the improved genetic algorithm in this application is better than that of the simple genetic algorithm and the multi-population genetic algorithm. Finally, the new algorithm solves the problem of high-quality automatic generation of test data.
[0047] (4) The regression testing framework based on the extended finite state machine proposed in the present invention implements a fully automated regression testing process in principle, and provides an instantiable and implementable solution to the regression testing problem of real engineering projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0049] Figure 1 A schematic diagram of a framework of a software regression testing method based on a finite state machine model provided in an embodiment of the present application;
[0050] Figure 2 A flowchart for testing the designed test cases provided in the embodiments of the present application;
[0051] Figure 3 A schematic diagram of the overall framework of the genetic algorithm provided in the embodiment of the present application;
[0052] Figure 4 A flow chart of a method for supplementing an initial population provided in an embodiment of the present application;
[0053] Figure 5 A greedy algorithm flow chart provided for an embodiment of the present application;
[0054] Figure 6 A flow chart of a multi-population genetic algorithm improved according to an embodiment of the present application;
[0055] Figure 7 An improved initial population generation flow chart for an improved embodiment of the present application;
[0056] Figure 8 A block diagram of a software regression testing device based on a finite state machine model provided in an embodiment of the present application;
[0057] Fig. 9 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] In the description of the present invention, the terms "comprises", "has" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may also include other steps or units that are not explicitly listed but are inherent to these processes, methods, products or apparatuses, or steps or units added based on further optimization schemes conceived by the present invention.
[0060] At present, in model-based regression testing technology, the change impact domain is usually analyzed at the software model level. This analysis method is limited by the software model language, and the results are often not accurate and complete. In addition, most of this analysis is performed manually, and the efficiency and quality are difficult to guarantee. In addition, in the current model-based regression testing strategy, the generation of test sequences and test data is mostly based on a certain coverage criterion at the software model level. Due to the different languages of software models, the coverage criteria are also different, and there is a lack of unified test adequacy judgment basis. In addition, the current regression testing is mainly based on manual analysis and generation of test sequences, and the efficiency and quality of existing automation solutions need to be improved.
[0061] The purpose of the present invention is to solve the problem of regression test automation. To this end, a new model-based regression test framework (method) is proposed. The framework first introduces the concept of model dependency graph, and establishes the software change impact analysis on the abstract model dependency graph, rather than simply analyzing based on the software model, thereby achieving a more accurate and comprehensive software change impact domain analysis, and at the same time automating this analysis process through the designed algorithm. In addition, the concept of test obligation is introduced into the framework, and the concept of full test obligation coverage is proposed to characterize the adequacy of regression testing. Based on this concept, a new method for automatically generating test sequences in the EFSM model based on genetic algorithms and a method for automatically generating test data that integrates genetic algorithms and greedy algorithms are designed. The regression test framework based on the EFSM model can realize the automation of the entire regression test process from the root.
[0062] Please refer to Figure 1 , which shows a flowchart of a software regression testing method based on a finite state machine model provided in an embodiment of the present application. Figure 2 The flowchart of designing test cases for testing in S3 is shown. The method may include the following steps:
[0063] S1 identifies the feature set, constructs the EFSM model dependency graph, determines the dependency relationships of the EFSM model when changes and migrations occur, and classifies the identified dependencies.
[0064] In the embodiment of the present application, Model Dependency Graph (MDG for short) is an important concept, which is used to represent the dependency relationship between various elements in a software model.
[0065] The model dependency graph of the extended finite state machine (EFSM) is a directed graph. The model dependency graph of the extended finite state machine (EFSM) is a graphical tool for representing the dependencies between components in the EFSM. In the EFSM, states and transitions between states together constitute the entire model, and the model dependency graph further shows the dependencies between these states and transitions.
[0066] Specifically, the nodes in the model dependency graph usually represent the states in the EFSM, while the edges represent the transition or conversion relationship between states. These edges may also contain events that trigger state transitions or conditions that satisfy transitions. In addition, compared with traditional finite state machines (FSMs), EFSMs also add variables, operations, and preconditions for state transitions, which may also be reflected in the model dependency graph.
[0067] Dependencies affected by changes refer to the software control dependencies or data dependencies that are affected after changes to the software model or software source code occur. These affected dependencies are the focus of regression testing. According to current research, any software change may affect dependencies that are usually divided into 12 types, which are further divided into 8 types of directly affected dependencies and 4 types of indirectly affected dependencies. Table 1 gives a dependency table:
[0068] Table 1 Dependency table
[0069] This step specifically includes:
[0070] S11, identifying state transition data by comparing the original EFSM model and the changed EFSM model.
[0071] Specifically, model change analysis: identifies migrations that have changed on the EFSM model, transforming the original EFSM0 model into the modified EFSM1.
[0072] S12, constructing model dependency graphs for the original EFSM model and the changed EFSM model respectively based on the identified state transition data.
[0073] Specifically, construct a model dependency graph: construct the original EFSM model dependency graph G0 = (t0, e0) and the changed EFSM model dependency graph G1 = (t1, e1). This step is implemented by Algorithm 1-3:
[0074]
[0075]
[0076]
[0077] S13, traversing all model dependency graphs of the original EFSM model and the changed EFSM model, and classifying the identified dependency relationships.
[0078] In this step, the dependencies affected by the change are identified. Using Algorithm 4, while traversing the model dependency graphs G0 and G1, the dependencies affected by the change are identified and classified.
[0079]
[0080] S2 determines the test conditions, and processes the identified classification results based on the improved genetic algorithm to determine the target test sequence corresponding to the EFSM model dependency graph.
[0081] In this step, a test sequence generation method based on genetic algorithm with regression test obligation as coverage criterion is specifically implemented. First, the following concepts are included:
[0082] Concept 1: Regression Testing Obligations (REO) refers to a series of conditions or requirements that must be met during software regression testing to ensure that the modified version of the software maintains the stability and quality of the expected functions. These obligations usually involve identifying code areas that may be affected by software changes and determining which test cases need to be executed to verify that these changes do not introduce new errors or problems.
[0083] Concept 2: The test sequence of EFSM refers to an ordered set of migrations on the EFSM model, denoted as .
[0084] Concept 3: Test obligation coverage relationship: given a test sequence With test obligation o, if the test sequence If the description of the meaning of the symbol o of the test obligation in the test obligation rules table is met, it is called Covers testing obligations o.
[0085] Concept 4: Full test obligation coverage: given a set of test sequences With test obligation collection ,in , They are respectively the test sequence and test obligation defined on the termination EFSM model.
[0086] Regression test task rule table: Convert the dependencies affected by the change into regression test tasks. The conversion rules are shown in Table 2:
[0087] Table 2 Conversion rules table
[0088] like Figure 3 The overall framework diagram of the genetic algorithm is given. The improved genetic algorithm specifically includes:
[0089] 1. Design of initial population
[0090] The test obligation gives the test scope of the regression test and is also the goal of regression test sequence generation. According to the correspondence between the change impact dependency and the basic change, it can be seen that the generation of new dependencies does not all come from the newly added migration. Therefore, the test sequence set designed for the EFSM model before modification has a great chance of containing test sequences that cover the test obligations. These sequences can provide the algorithm with key information for test sequence generation. In order to reduce the cost of test sequence design and provide the necessary initial information for the genetic algorithm, all test sequences before the model modification are used as part of the initial population. As for the new dependencies coming from the newly added migration, the original test sequence set obviously cannot cover them. Therefore, it is necessary to supplement the original test sequence set with sequences containing the newly added migration as the initial population of the genetic algorithm. The method for supplementing the initial population is designed as follows: Figure 4 As shown: For each new migration in the base change new , randomly generate the initial state of the EFSM model to t new The fragment of t (called the preamble sequence), and new The fragments leading to the termination state of the model (called post-sequences) are combined to obtain a complete complementary sequence.
[0091] 2. Individual coding strategy design
[0092] The goal of this method is to generate a set of test sequences that meet the test obligation coverage. At the same time, in order to reduce the overhead of regression testing, it is necessary to generate the shortest possible test sequence. Therefore, the encoding method of the individual needs to meet the condition that the test sequence length is variable. The genes of individuals under the symbol encoding method are taken from a predefined set of symbols, such as {a, b, c, d, e}. The length of individuals generated based on symbol encoding is flexible and variable, which can meet the above conditions. Therefore, the designed symbol encoding method is as follows:
[0093] (1) The symbol set is all the migration numbers in the EFSM model, expressed as integers;
[0094] (2) An individual in a population is a sequence of genes. Each gene is a symbol in a symbol set that represents a migration. An individual represents a complete test sequence.
[0095] The symbol encoding method can flexibly express the complete test sequence, but the crossover and mutation operations are relatively complex. Therefore, in this genetic algorithm, corresponding crossover and mutation operators are designed according to the characteristics of the symbol encoding method.
[0096] 3. Design of selection operator
[0097] The selection operator is based on the fitness value. In each generation of population evolution, individuals with high fitness values are retained and individuals with low fitness values are eliminated to complete the survival of the fittest in the population, prompting the algorithm to conduct in-depth search to accumulate effective information. Common selection operators include sorting selection, roulette method, tournament method, etc.
[0098] The roulette wheel selection method is an individual selection strategy used in genetic algorithms. It determines the probability of an individual being selected based on the proportion of the individual's fitness value in the population. The basic principle is to divide a disk according to the fitness value of the individual. The higher the fitness, the greater the proportion of individuals, thereby increasing the probability of being selected. Suppose the fitness value of an individual i is f i , the population size is M, then the probability of this individual being selected is for:
[0099]
[0100] The tournament selection method is different from the roulette method. It does not sort all the fitness values in the population as the basis for selection, but uses the relative value of fitness as a reference, so it can avoid premature convergence to a certain extent. This method selects a certain number of individuals (less than the number of individuals in the population) from the population, and then selects the individuals with the best fitness from the selected individuals and puts them into the offspring population. The above selection process is repeated until the number of individuals in the offspring population is the same as the setting. The common tournament selection strategy sets the number of selected individuals to 2, and each selection is a pairwise comparison to produce the better one.
[0101] 4. Design of crossover operator
[0102] This application has two basic requirements for test sequences generated based on genetic algorithms: (1) the length of the test sequence is variable; (2) the test sequence is valid. The former is met through the design of individual symbol encoding. Since the crossover and mutation operators in the genetic operator will greatly change the composition of the sequence and may produce invalid test sequences, it is necessary to try to ensure the validity of the new sequence when designing the operator.
[0103] The crossover operator considering sequence validity is designed as follows:
[0104] Step 1: For two individuals in the population, use one of them as the mother of the crossover operation;
[0105] Step 2: Randomly select a crossover point on the mother and record the source state s of the gene (i.e. migration) at that point source ;
[0106] Step 3: Traverse the migration on another individual and find all the source states as s source The genes are put into the candidate set;
[0107] Step 4: If the candidate set is not empty, randomly select one of the genes as the crossover point and exchange the sequences after the crossover points of the two individuals; if the candidate set is empty, reselect the crossover point.
[0108] 5. Design of mutation operator
[0109] Single-point mutation is a commonly used mutation operator. The traditional single-point mutation method directly selects replacement genes from all genes without considering the validity of the test sequence. Therefore, constraints on sequence validity are added to the mutation operator design. In addition, after applying the improved single-point mutation method on different EFSM model instances, it was found that when there is only one migration connecting any two states in a migration sequence, single-point mutation will not produce new individuals. In order to solve the above problems of single-point mutation, a fragment mutation method is added.
[0110] The single-point mutation operator considering sequence validity is designed as follows:
[0111] Step 1: For an individual, randomly select a mutation point and record the source state and target state of the gene (i.e. migration) at that point ;
[0112] Step 2: Traverse all transitions in the EFSM model and compare the source state, target state and Consistent migrations are put into the candidate set;
[0113] Step 3: If the candidate set is not empty, randomly select one of the migrations to replace the migration at the mutation point; if the candidate set is empty, reselect the mutation point.
[0114] The fragment mutation operator considering sequence validity is designed as follows:
[0115] Step 1: For an individual, randomly select a mutation point and record the source state s of the gene (i.e. migration) at that point source ;
[0116] Step 2: Traverse all transitions in the EFSM model and set the source state to ssource The migration is put into the candidate set;
[0117] Step 3: If the candidate set is not empty, randomly select one of the migrations, generate a sequence fragment from the migration to the terminal state, and use this fragment to replace the sequence fragment after the mutation point.
[0118] 6. Adaptive crossover and mutation probability design
[0119] In genetic operations, crossover and mutation operations can increase the diversity of the population; at the same time, crossover and mutation operations may destroy better individuals and reduce the optimization effect. Studies have shown that introducing adaptive probability in genetic algorithms can effectively improve the optimization efficiency of the algorithm and accelerate the convergence of the algorithm.
[0120] In order to achieve a relative balance between convergence speed and genetic orientation, adaptive crossover and mutation probabilities are designed in the genetic algorithm of this application. The adaptive probability comprehensively considers the algorithm evolution algebra and individual fitness values, hoping to obtain a higher probability in the early stage of evolution to enhance the breadth search capability of the algorithm, and a smaller probability in the later stage of evolution to avoid destroying the current population structure and affecting the convergence of the algorithm; for individuals with fitness higher than the overall level, a smaller crossover and mutation probability can be assigned to retain their excellent traits. On the contrary, for individuals with low fitness, a higher probability can be assigned to encourage them to evolve to a better state. The adaptive crossover and mutation probability is designed as follows:
[0121]
[0122] Among them, k is the initial probability of crossover or mutation, t is the current evolutionary generation, T is the upper limit of the evolutionary generation, fit is the fitness value of the current individual, and fit avg with fit max are the average and maximum values of the current population fitness respectively.
[0123] 7. Design of fitness function
[0124] The fitness function is used to evaluate the degree of satisfaction of individuals with the target solution. Individuals with higher satisfaction with the target solution will obtain better fitness values. The fitness function is used to evaluate the quality of individuals on the one hand, and to guide the evolutionary direction of the genetic algorithm on the other hand. Therefore, in order to achieve the optimization goal of the algorithm, it is very important to design a reasonable fitness function.
[0125] The goal of the genetic algorithm of this application is to generate a set of test sequences that cover all test obligations as short as possible. Therefore, the design of the fitness function needs to consider: (1) the ability to evaluate the coverage of the test obligations, and (2) the ability to evaluate the length of the test sequence. To this end, two fitness function design criteria are proposed for the genetic algorithm of this application, namely, the test obligation coverage diversity criterion and the test sequence length criterion.
[0126] (1) Testing obligations cover diversity criteria
[0127] The test objectives of regression test sequences are: first, to test that the modified parts of the software are consistent with the expected goals; second, to test that the unchanged parts of the software are not negatively affected. In order to achieve the above objectives of regression testing, the modified software model is fully and comprehensively tested. In the prior art, the method for generating regression test obligations proposed by Ural et al. outputs a set of test obligations that the test sequence generated by the genetic algorithm needs to cover.
[0128] In order to achieve full coverage of test obligations, there are two possible ways to construct individuals in the population. One is to make a single individual in the population cover as many test obligations as possible, and the other is to make the population have individuals that cover as many different test obligations as possible. Early work in this study showed that using the former as the evaluation criterion and designing the fitness function according to the percentage of test obligations covered by a single individual, the generated test sequence is difficult to meet the test sequence generation goal of this study. Specifically, (1) the genetic algorithm tends to generate a unique test sequence that covers the most test obligations, and the length of the test sequence is uncontrollable; (2) the population is prone to converge prematurely, resulting in a population with insufficient coverage and a large number of repeated individuals. Some studies have pointed out that based on the diversity method, this application adopts the second full coverage construction method and introduces test obligation coverage diversity as the design criterion of the fitness function.
[0129] The measurement methods of test case set diversity can be divided into three types: diversity of distance between test cases, diversity of structure between test cases, and diversity based on information coverage of the tested program. Since the test coverage target is all test tasks, its diversity measurement is simple. Therefore, the diversity of test task coverage is designed with reference to the diversity of distance between test cases. Common distance measurement methods include: Euclidean distance, Manhattan distance, Hamming distance, Levenshtein distance, Jaccard distance, etc.
[0130] Euclidean distance and Manhattan distance represent the distance between two points in a certain coordinate system, which are typical distances between numerical use cases. The test task set, as a set composed of a series of symbols, is not suitable for this type of distance measurement.
[0131] Hamming distance, edit distance and Jaccard distance are typical string distance metrics, which can be easily converted into distance metrics between sequences. Among them, Hamming distance represents the number of different characters in corresponding positions of two strings of equal length, but the test obligation coverage of different individuals is not necessarily equal, so it is not applicable; edit distance represents the minimum number of edits required to convert one string into another, which is more suitable for distance measurement between ordered sequences, and the order of test obligations covered by individuals has no decisive influence on the degree of coverage, so it should be expressed in the form of a set. For this reason, Jaccard distance is selected as a measure of test obligation coverage diversity.
[0132] The Jaccard distance represents the proportion of different elements in two sets in the entire set. The Jaccard distance calculation formula between set S1 and set S2 is as follows:
[0133]
[0134] For individual t in the genetic algorithm population M i The set of test obligations covered c i , calculate the Jaccard distance between itself and the test obligation set covered by other individuals, and take the average of all calculated distances as the individual t i The diversity measure is:
[0135]
[0136] (2) Test sequence length criteria
[0137] This application requires that the test sequence be generated as short as possible under the premise of meeting the test obligation coverage. Therefore, in the design of the fitness function, when the test obligation coverage diversity is the same, the shorter the test sequence, the greater the fitness value. i , the sum of the lengths of the individuals in the population and the length of the individual t i Length (denoted as |t i |) is larger, the better the individual is. The ratio is
[0138]
[0139] In order to avoid the failure of the test obligation coverage diversity measurement due to the length ratio being too large, the individual length measurement value is obtained after normalization, that is:
[0140]
[0141] (3) Fitness function
[0142] The fitness function comprehensively considers the test task coverage diversity criteria and the test sequence length criteria. Individuals with greater fitness perform better. The fitness function designed by this algorithm is the weighted sum of the test task coverage diversity metric and the test sequence length metric, expressed as follows:
[0143]
[0144] Among them, the weight value ,In the current work, k1=0.7, k1=0.3 are taken.
[0145] like Figure 5 A greedy algorithm flow chart provided in an embodiment of the present application is given. Specifically, the greedy algorithm fusion design includes:
[0146] Under the above genetic algorithm process, the test obligation coverage percentage of 100% is used as the termination condition of the algorithm. Obviously, the test sequence set generated by this method can meet the full test obligation coverage. However, since the operation of the genetic operator on the population in the genetic algorithm does not involve the increase or decrease of the population size, the number of test sequences finally generated will be the same as the initial population. In the framework of this application, this number is the sum of the number of initial test sequence sets and the number of supplementary sequences of the EFSM model before modification. For a complete and non-redundant test sequence set, the number of sequences is usually not the same as the initial population. On the one hand, not all sequences in the original test sequence set contribute to the test obligation coverage, and there may be redundancy from the perspective of the test obligation; on the other hand, the original test sequence must not ensure coverage of all changes to be affected, for example, it is impossible to contain information related to the new migration of the model. Therefore, there may be a subset of the genetic algorithm output sequence set that meets the full coverage of the test obligation while having fewer sequences.
[0147] In order to simplify the output of the test sequence and obtain fewer test task full coverage sequences, the greedy algorithm is integrated into the genetic algorithm process. The optimization strategy of the greedy algorithm is: give priority to test sequences that cover more test tasks; when the test task coverage is the same, give priority to test sequences with shorter lengths.
[0148] S3 analyzes the test coverage items, generates test data through a genetic algorithm according to the target test sequence, and implements software regression testing based on the generated test data.
[0149] The following concepts are specifically involved in this step:
[0150] Concept 1: Individual sharing strategy: In a multi-population genetic algorithm, each generation of evolution not only determines whether the individual in the population is the best in the current population, but also continues to determine whether it is the solution to other population problems.
[0151] Concept 2: Sequence similarity is a numerical value that reflects the degree of similarity between two sequences. When comparing sequences, the concepts of "homology" and "similarity" are often used, but they have different meanings. Two sequences are homologous, which means that they have a common ancestor. This is a qualitative description, without any degree of difference. Sequences are either homologous or not. Similarity, on the other hand, has a degree of difference and can be a specific numerical value, such as the degree of similarity between two sequences reaching 30% or 60%. Generally speaking, two sequences with high similarity tend to have a homologous relationship, but there may be exceptions, that is, two sequences have a high degree of similarity, but they may not be homologous sequences. This similarity may be caused by random factors, which is called "convergence" in evolution.
[0152] Concept 3: Fixed Candidate Set Algorithm (FSCS-ART): First randomly generate a test data, generate k candidate test data, calculate the distance between each executed test data and the candidate test data, and select the candidate test data with the largest distance as the test data for the next execution.
[0153] Improved parallel multi-population genetic algorithm framework design
[0154] Most of the research on test data generation based on EFSM uses multiple population genetic algorithms to optimize an objective function at the same time, that is, only test data covering a set of test sequences can be generated each time. This method of test data generation is inefficient. The algorithm of this study has made improvements in this regard, using each sub-population to optimize an objective function, and the interaction between populations integrates individual sharing strategies and individual migration. This parallel method can improve the efficiency of algorithm execution to a certain extent. The method flow of this application is as follows Figure 6 As shown, it mainly includes the following five steps:
[0155] Step 1: Select some test data that can be used for regression from historical data, and use the test sequences that cannot be covered by historical data as the target of genetic algorithm optimization.
[0156] Step 2: Initialize the initial population of the algorithm. The design of the initial population is the first goal of this application. This application uses historical test data as part of the initial population and combines it with the FSCS-ATR algorithm to supplement the generation of the remaining initial population.
[0157] Step 3: In each generation of evolution, the fitness value of each individual in the population is calculated to judge the quality of the individual, and an individual information sharing strategy is adopted. When a sub-problem is optimized, the iteration of the sub-population is stopped.
[0158] Step 4: Perform genetic operations such as selection, crossover, and mutation on individuals according to their fitness to enable the algorithm to search in the solution space and generate a new offspring population.
[0159] Step5: Repeatedly iterate Step3-Step4 until the algorithm termination condition is met or the maximum number of iterations is reached.
[0160] Improved population interaction design
[0161] When designing existing multi-population genetic algorithms, the interaction between populations includes: sub-population migration, sub-population information sharing, etc. The sub-population migration strategy refers to the optimization of populations by selecting the best individuals between adjacent populations to replace the worst individuals in adjacent sub-populations. This method is also a common strategy used by multi-population genetic algorithm population interaction. The multi-population genetic algorithm designed in this application uses multiple populations to optimize multiple objective functions simultaneously.
[0162] The use of population migration can prevent the algorithm from converging too early and falling into local optimality, and improve the diversity of the population. The strategy of multi-population information sharing can improve the execution efficiency of the algorithm. This application selects a population interaction method that combines sub-population information sharing and migration.
[0163] Subpopulation migration uses the method of randomly replacing the worst individual in the adjacent population. Individual information sharing occurs after the fitness value is calculated within each subpopulation. First, it is necessary to determine whether there is a feasible solution in the subpopulation corresponding to each subproblem. On this basis, it is determined whether there is a feasible solution in other populations. The essence of this method is evolution within the subpopulation. Each iteration between subpopulations records the test sequences executed by all subpopulation individuals and compares them with all target sequences. For the target test sequence, it can be regarded as multiple populations optimizing a certain goal at the same time to some extent.
[0164] This application implements this method through the following three steps:
[0165] Step 1: Calculate the fitness values of all individuals in the population and record the sequence executed by each individual.
[0166] Step 2: For each sub-problem to be optimized (test sequence), check whether there is an individual that satisfies the sub-problem in the executed test sequence. If so, record the individual and stop optimizing the corresponding sub-problem. At the same time, delete the sub-population corresponding to the problem.
[0167] Step 3: Determine whether the migration interval is reached. If the migration interval is reached, randomly replace the worst individual in the adjacent population according to the migration rate.
[0168] Improved initial population design
[0169] When genetic algorithms are applied to optimization problems, the first problem is to generate the initial population. Usually, the initial population is generated by random methods, but this application studies the generation of regression test data. Before the regression test, test data already exists. If the existing test data can be fully utilized, test data covering the target test sequence can be generated faster and more accurately. This application selects existing test data with high similarity between the coverage sequence and the target test sequence as part of the initial population. In addition, completely selecting similar test data will result in poor diversity of the initial population, causing the initial population distribution to be concentrated in the same interval, causing the algorithm to fall into a local optimum prematurely. In order to ensure the diversity of the initial population, this application combines adaptive random testing (ART) to supplement the generation of the rest of the initial population. ART means that the test data should be more evenly distributed within the entire input domain space. Among the existing ART algorithms, the fixed candidate set algorithm (Fixed SizedCandidate Set ART, FSCS-ART) is the most widely used. Next, this application uses the fixed candidate set algorithm to supplement the rest of the initial population. The generation process of the initial population is as follows Figure 7 As shown:
[0170] Step 1: For the test sequence to be covered, take a threshold C and calculate a sequence p of test data execution j With the sequence p to be covered i The similarity between them satisfies: When , the sequence covered by this test data is considered to be a similar sequence. Then the test data is used as part of the initial population.
[0171] Step 2: First, randomly select a test data from the initial population generated in the previous step, generate k candidate test data, and calculate the distance between the selected test data and the candidate test data. Select the candidate test data with the largest distance and include it in the initial population. Repeat Step 2 until the size of the initial population is met.
[0172] Multi-population genetic manipulation design
[0173] In genetic algorithms, it is particularly important to choose the appropriate encoding method and genetic operator. In multi-population genetic algorithms, the evolution of each sub-population is consistent with traditional genetic algorithms.
[0174] Common individual coding methods include real number coding, binary coding, permutation coding, symbol coding, DNA coding, etc. Considering that most of the individual genes in the test data generation problem are numbers, real number coding is selected here.
[0175] The selection, crossover, and compilation methods determine the direction of algorithm evolution. Through previous literature research, the tournament method is designed as the selection operator, and the crossover mutation method adopts the multi-point crossover single-point mutation method.
[0176] Adaptive genetics, mutation probability design
[0177] In genetic operations, crossover and mutation operations can increase the diversity of the population; at the same time, crossover and mutation operations may destroy better individuals and reduce the optimization effect. Studies have shown that introducing adaptive probability in genetic algorithms can effectively improve the optimization efficiency of the algorithm and accelerate the convergence of the algorithm.
[0178] In order to achieve a relative balance between convergence speed and genetic orientation, adaptive crossover and mutation probabilities are designed in the genetic algorithm of this application. The adaptive probability comprehensively considers the algorithm evolution algebra and individual fitness values, and expects to obtain a higher probability in the early stage of evolution to enhance the breadth search capability of the algorithm, and a smaller probability in the later stage of evolution to avoid destroying the current population structure and affecting the convergence of the algorithm; for individuals with higher fitness than the whole, a smaller crossover and mutation probability is given to them to retain excellent traits; for individuals with low fitness, a higher probability is given to them to promote their evolution to a better state.
[0179] The adaptive crossover mutation probability is designed as follows:
[0180]
[0181] Among them, k is the initial probability of crossover or mutation, t is the current evolutionary generation, T is the upper limit of the evolutionary generation, fit is the fitness value of the current individual, and fit avg with fit max are the average and maximum values of the current population fitness respectively.
[0182] Fitness function design
[0183] The fitness function is used to evaluate the degree to which an individual satisfies the target solution. The higher the degree of satisfaction of the individual with the target solution, the better the fitness value will be. In traditional methods, layer proximity and branch distance are usually used as commonly used fitness evaluation indicators in the study of automatic test data generation.
[0184] The fitness function is used here to measure the test data s i The closeness between the test sequence obtained as input and the target test sequence is used to Indicates. This application uses sequence similarity to evaluate layer proximity, and the branch distance is constructed using a branch function. The specific calculation formula is as follows:
[0185]
[0186] in The representation layer proximity is expressed by sequence similarity, and the specific calculation formula is as follows:
[0187]
[0188] Represents the branch distance, and the calculation formula is as follows:
[0189]
[0190] d is the distance from the true (false) branch to the false (true) branch of the first branch node where the actual execution sequence is different from the target sequence, which is constructed using the branch function.
[0191] From the above, it can be seen that, in summary, the present invention is innovative in the following aspects:
[0192] A complete automated regression testing framework has been implemented. Starting from the change of the software model, the model dependency graph is automatically established and the dependency analysis of the change impact is automatically implemented, as well as the generation of test sequences and test data. This is a general invention result that includes multiple innovations;
[0193] A method for analyzing the dependency relationships of changes on the model dependency graph is proposed, and an automated analysis process is realized through algorithm design.
[0194] The idea of taking the dependencies affected by the change as regression test obligations is proposed, and a new coverage criterion, namely, full test obligation coverage, is defined;
[0195] Based on the criterion of full test obligation coverage, a genetic algorithm was improved and implemented to realize the automatic generation method of test sequences on the EFSM model;
[0196] A new method combining genetic algorithm and greedy algorithm was improved and implemented, and a method for automatically generating test data on the EFSM model was realized.
[0197] like Figure 8 As shown, the embodiment of the present application also provides a block diagram of a software regression testing device based on a finite state machine model. The device may include:
[0198] The classification module is used to construct the EFSM model dependency graph, identify the dependency relationships of the EFSM model when changes and migrations occur, and classify the identified dependencies;
[0199] A determination module is used to process the identified classification results based on an improved genetic algorithm to determine a target test sequence corresponding to the EFSM model dependency graph;
[0200] The test module is used to generate test data through a genetic algorithm according to the target test sequence, and implement software regression testing based on the generated test data.
[0201] For the specific definition of the software regression testing device based on the finite state machine model, please refer to the definition of the software regression testing method based on the finite state machine model in the above text, which will not be repeated here. Each module in the above-mentioned software regression testing device based on the finite state machine model can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0202] In one embodiment, an electronic device is provided. The electronic device may be a computer, and its internal structure diagram may be as follows: Fig. 9 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the device is used to provide computing and control capabilities. The memory of the device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for software regression test data based on a finite state machine model. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a software regression test method based on a finite state machine model is implemented.
[0203] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0204] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which involves all or part of the processes in the above-mentioned embodiment method.
[0205] In one embodiment, a computer program product is also provided, including a computer program / instruction, which involves all or part of the process in the above embodiment method.
[0206] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in M forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SyMchliMk) DRAM (SLDRAM), memory bus (RaMbus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0207] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0208] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. A software regression testing method based on finite state machine model, It is characterized in that The method comprises: S1, construct the EFSM model dependency graph, identify the dependencies of the EFSM model when changes and migrations occur, and classify the identified dependencies; S2, processing the identified classification results based on the improved genetic algorithm to determine the target test sequence corresponding to the EFSM model dependency graph; S3, generating test data by a genetic algorithm according to the target test sequence, and implementing software regression testing based on the generated test data; S1, construct the EFSM model dependency graph, identify the dependencies of the EFSM model when changes and migrations occur, and classify the identified dependencies, including: S11, identifying state transition data by comparing the original EFSM model and the changed EFSM model; S12, constructing a model dependency graph for the original EFSM model and the changed EFSM model respectively based on the identified state transition data; S13, traversing all model dependency graphs of the original EFSM model and the changed EFSM model, and classifying the identified dependency relationships; In S2, the identified classification results are processed based on the improved genetic algorithm, including: Convert the identified classification results into regression test tasks, and determine the test tasks corresponding to each dependency based on the identified classification results; According to the test obligations, specific coverage criteria are formulated; wherein the coverage criteria define the key points that the test needs to cover; wherein the key points at least include the migration that needs to be triggered, the state that needs to be verified, and the input / output combination that needs to be covered; The improved genetic algorithm specifically includes: Design the initial population structure of the algorithm; Designing individual encodings for representing test sequences; Design selection operators to select excellent individuals from the population, design crossover operators to generate new individuals, and design mutation operators to increase the diversity of the population; Design a mechanism to adaptively adjust crossover and mutation probabilities based on population status; Design a fitness function for evaluating the quality of test sequences and apply a genetic algorithm to generate test sequences; In the design of a mechanism to adaptively adjust the crossover and mutation probabilities according to the population status, the adaptive crossover and mutation probabilities specifically include: , in, k is the initial probability of crossover or mutation, t is the current evolutionary generation, T is the upper limit of evolutionary generations, fit is the fitness value of the current individual, fit avg and fit max are the average and maximum values of the current population fitness respectively; S3, generating test data by a genetic algorithm according to the target test sequence, and implementing software regression testing based on the generated test data, including: S31, filtering out data related to the current regression test from the historical test data, and determining the sequence portion that cannot be covered by the historical data by analyzing the target test sequence; S32, initialize a population containing multiple individuals, and use the FSCS-ATR algorithm to generate the remaining individuals; S33, calculating the fitness value for each individual in the population to evaluate the coverage and effectiveness of the test data generated by the individual for the target test sequence; at the same time, using the individual information sharing strategy, optimizing each test sequence, and stopping the iteration of the sub-population when the optimization reaches the preset stop condition; S34, according to the fitness value of the individual, use operations such as selection, crossover and mutation to generate new individuals; S35, repeatedly iterate S33-S34 until the algorithm termination condition is met or the maximum number of iterations is reached.
2. A software regression testing device based on a finite state machine model, It is characterized in that The device comprises: The classification module is used to construct the EFSM model dependency graph, identify the dependency relationships of the EFSM model when changes and migrations occur, and classify the identified dependencies; A determination module is used to process the identified classification results based on an improved genetic algorithm to determine a target test sequence corresponding to the EFSM model dependency graph; A testing module, used to generate test data through a genetic algorithm according to the target test sequence, and implement software regression testing based on the generated test data; The classification module constructs the EFSM model dependency graph and identifies the dependencies of the EFSM model when changes and migrations occur. It classifies the identified dependencies, including: By comparing the original EFSM model with the modified EFSM model, the state transition data is identified; Based on the identified state transition data, model dependency graphs are constructed for the original EFSM model and the changed EFSM model respectively; Traverse all model dependency graphs of the original EFSM model and the changed EFSM model, and classify the identified dependencies; The identified classification results are processed based on the improved genetic algorithm in the determination module, including: Convert the identified classification results into regression test tasks, and determine the test tasks corresponding to each dependency based on the identified classification results; According to the test obligations, specific coverage criteria are formulated; wherein the coverage criteria define the key points that the test needs to cover; wherein the key points at least include the migration that needs to be triggered, the state that needs to be verified, and the input / output combination that needs to be covered; The improved genetic algorithm specifically includes: Design the initial population structure of the algorithm; Designing individual encodings for representing test sequences; Design selection operators to select excellent individuals from the population, design crossover operators to generate new individuals, and design mutation operators to increase the diversity of the population; Design a mechanism to adaptively adjust crossover and mutation probabilities based on population status; Design a fitness function for evaluating the quality of test sequences and apply a genetic algorithm to generate test sequences; In the design of a mechanism to adaptively adjust the crossover and mutation probabilities according to the population status, the adaptive crossover and mutation probabilities specifically include: , in, k is the initial probability of crossover or mutation, t is the current evolutionary generation, T is the upper limit of evolutionary generations, fit is the fitness value of the current individual, fit avg and fit max are the average and maximum values of the current population fitness respectively; The test module generates test data through a genetic algorithm according to the target test sequence, and implements software regression testing based on the generated test data, including: Filter out data related to the current regression test from historical test data, and determine the sequence parts that cannot be covered by historical data by analyzing the target test sequence; Initialize a population containing multiple individuals and use the FSCS-ATR algorithm to generate the remaining individuals; The fitness value is calculated for each individual in the population to evaluate the coverage and effectiveness of the test data generated by it for the target test sequence. At the same time, an individual information sharing strategy is adopted to optimize each test sequence. When the optimization reaches the preset stop condition, the iterative sub-population is stopped. According to the fitness value of the individual, operations such as selection, crossover and mutation are used to generate new individuals; Iterate repeatedly until the algorithm termination condition is met or the maximum number of iterations is reached.
3. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the method according to claim 1 are implemented.
4. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the steps of the method according to claim 1 are implemented.
5. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to claim 1 are implemented.
Citation Information
Patent Citations
An extended finite state machine test data generation method based on variable partition
CN109542783A
Test case generation method and platform based on extended finite-state machine model
CN113157562A
REST interface test case generation method based on dependency model
CN115098389A
EFSM test sequence generation method based on deep learning and ant colony algorithm
CN116955151A
System and method for equivalence class analysis-based automated requirements-based test case generation
EP3588304A1
