CN111934948B - EFSM executable test sequence generation method based on Monte Carlo tree search - Google Patents

EFSM executable test sequence generation method based on Monte Carlo tree search Download PDF

Info

Publication number
CN111934948B
CN111934948B CN202010698489.XA CN202010698489A CN111934948B CN 111934948 B CN111934948 B CN 111934948B CN 202010698489 A CN202010698489 A CN 202010698489A CN 111934948 B CN111934948 B CN 111934948B
Authority
CN
China
Prior art keywords
node
tree
monte carlo
efsm
search
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010698489.XA
Other languages
Chinese (zh)
Other versions
CN111934948A (en
Inventor
舒挺
黄业超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Sci Tech University ZSTU
Original Assignee
Zhejiang Sci Tech University ZSTU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Sci Tech University ZSTU filed Critical Zhejiang Sci Tech University ZSTU
Priority to CN202010698489.XA priority Critical patent/CN111934948B/en
Publication of CN111934948A publication Critical patent/CN111934948A/en
Application granted granted Critical
Publication of CN111934948B publication Critical patent/CN111934948B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses an EFSM executable test sequence generation method based on Monte Carlo tree search, which converts the executable test generation problem of an EFSM model into a Markov decision process of a path in a TEA tree, and heuristically guides the extension direction of the TEA tree to search a target sequence by means of the powerful mass state space search capability of an MCTS algorithm, so that the test generation efficiency is greatly improved, and the state explosion is finally avoided; therefore, the invention can effectively reduce the expansion nodes of the executable analysis tree and accelerate the generation of the executable test sequence.

Description

EFSM executable test sequence generation method based on Monte Carlo tree search
Technical Field
The invention belongs to the technical field of protocol consistency test sequence generation, and particularly relates to an EFSM executable test sequence generation method based on Monte Carlo tree search.
Background
The increasing sophistication of communication networks has made it increasingly difficult to develop and test communication protocols. Subtle errors in the communication protocol software can also cause anomalies in the entire communication network, causing immeasurable losses. In order to improve the quality of the communication protocol software, an exhaustive network protocol consistency test becomes an effective way. The network protocol consistency test is used as an important branch of the protocol test and mainly aims at detecting the consistency degree of the protocol implementation and the protocol specification; a consistency test method (Model-Based Testing, MBT) Based on a formal Model is widely appreciated because it helps to improve the quality and degree of automation of the test. Among numerous protocol formal modeling technologies, an Extended Finite State Machine (EFSM) is one of mainstream test modeling technologies because its expression form is intuitive and has the characteristic of characterizing system control flow and data flow.
The protocol consistency test based on the EFSM model mainly excites corresponding output by a series of inputs to a tested system, and obtains a test conclusion by observing whether the system output is consistent with a protocol specification, wherein a sequence formed by input/output pairs is called a consistency test sequence. Because the EFSM model expands variables and predicate conditions on the basis of the FSM model of the state machine, the execution of some transitions has dependency relationship with each other; if the test generation method of the FSM model of the finite state machine is directly applied to generate the test sequence of the EFSM model, it may cause an unexecutable problem of the generated test sequence. Therefore, how to automatically generate an executable consistency test sequence of the EFSM model becomes a technical challenge.
For the performability problem of test sequences, researchers have conducted many explorations, among which genetic algorithm-based search techniques become a major venture, which convert EFSM test sequence generation into An optimization problem, search for solutions using genetic algorithms, most typically Kalaji's proposed method of Kalaji "Kalaji, a.s., r.m. hierarchy, and s.swift, An integrated search-based approach for automatic testing from Extended Fine State Machine (EFSM) models, information and Software Technology,2011.53(12): p.1297-8 ], which first uses An algorithm to generate candidate test sequences that satisfy coverage requirements, but these test sequences are not necessarily executable, and then uses GA to generate test data that can trigger candidate test sequence executables; however, such methods have difficulties in initial population selection and population length setting, and the performability of the generated test sequence still requires additional steps for further validation and determination. Some researchers also propose to generate test sequences based on constraint solving and symbolic execution technologies, but such methods have certain constraint conditions on the tested model and have no universality.
Compared with the method, the transition executable analysis Technology (TEA) is more universal, and the target test sequence is generated mainly through the extended search of the transition executable analysis tree, however, for the actual protocol, the huge reachable state space of the EFSM corresponds to the massive potential extended search space of the executable analysis tree, and finally the state explosion problem is generated.
Disclosure of Invention
In view of the above, the present invention provides an EFSM executable test sequence generation method based on monte carlo tree search, which can effectively reduce the number of extension nodes of an executable analysis tree and accelerate the generation of executable test sequences.
An EFSM executable test sequence generation method based on Monte Carlo tree search specifically comprises the following steps: and establishing a TEA (TEA Tree) corresponding to the EFSM (extensible firmware framework) by applying a Monte Carlo Tree Search algorithm (MCTS), finding a path meeting a test coverage condition (covering all test target transitions), wherein the path is an executable test sequence, and the input and the output of the path and each transition on the path form a complete test case.
Further, the specific implementation manner of the monte carlo tree search algorithm is as follows: firstly, establishing a TEA tree corresponding to EFSM, wherein each node in the TEA tree corresponds to a state and comprises a corresponding state name and a variable of the whole EFSM; searching is carried out from a given initial state, namely a root node, when a certain node has a plurality of output transitions, the next node is searched through the output transition with the maximum corresponding UCT value by calculating the UCT (upper Confidence BoundDoppler to Tree) value of each output transition, whether the path which passes through each transition contains all the test target transitions or not needs to be checked, if yes, the searching is finished, the output path is used as an executable test sequence, and otherwise, the searching is continued.
Further, the calculation expression of the UCT value is as follows:
Figure BDA0002592149740000031
wherein: n is the current node, N 'is the parent node of N, UCT (N) is the UCT value of the transition between nodes N and N', Q (N) is the accumulated reward value of the current node N, V (N) is the visited times of the current node N, V (N ') is the visited times of the parent node N', and eta is a given weight coefficient.
Further, the calculation expression of the cumulative prize value q (n) is as follows:
Figure BDA0002592149740000032
Figure BDA0002592149740000033
wherein: delta (N)i) For the terminal node N in the simulation phase of the ith Monte Carlo tree searching process of the current node NiIs awardedThe value of budget is the upper limit of searching overhead of Monte Carlo tree search, N is the number of test target transitions covered on the path from the current node N to the root node in the TEA tree, | TS | is the number of test target transitions required to be covered, | Niω | is the root node to the terminal node N in the ith Monte Carlo Tree search of the current node NiMax is the maximum exploration depth set for the monte carlo tree search.
Further, the search overhead upper limit budget is determined by the following relational expression;
Figure BDA0002592149740000034
wherein: and | TS | is the number of the test target transitions required to be covered, Max is the maximum exploration depth set by the Monte Carlo tree search, | N.path | is the path depth from the current node N to the root node, and μ is a given overhead parameter used for controlling the scaling of the budget.
Further, in the process of continuing the search, if a path covering all the test target transitions from the root node is not found yet when the set maximum exploration depth Max is exceeded, the monte carlo tree search algorithm searches again from the root node or increases the maximum exploration depth Max or increases the overhead parameter μ.
Further, the invention converts the EFSM executable test sequence generation problem into a Markov decision process based on TEA tree search, and solves the problem by applying a Monte Carlo tree search algorithm.
Furthermore, the invention establishes a fusion mechanism of the TEA tree and the Monte Carlo tree search algorithm, and predicts the extension rationality of the nodes in the TEA tree by using the Monte Carlo tree search algorithm, namely, when the TEA tree extends the nodes, an TEA sub-tree established in a Monte Carlo tree search mode is established, and a more reasonable extension direction is selected by using the state space information of the TEA sub-tree.
The invention relates to an EFSM consistency test sequence automatic generation Method (MTEA) based on a Monte Carlo tree search algorithm, which converts an executable test generation problem of an EFSM model into a Markov decision process of a path in a TEA tree.
In the MTEA of the present invention, the test sequence is generated starting from a given initial state configuration, i.e., the root node of the TEA tree, and according to a specific EFSM model, there may be multiple executable output transitions to be expanded for the nodes in the TEA tree, so that it becomes a decision problem how to select from the multiple executable output transitions according to the current state of the tree node. The method estimates the potential of each potential extended search direction by using a random sampling technology based on a Monte Carlo tree search algorithm, if the estimation is correct in likelihood, the extended direction of the TEA tree always tends to a target node, and finally, the optimal target test sequence is found by searching the tree nodes with the least number.
Drawings
Fig. 1 is an EFSM model diagram of the NetworkMonitor protocol.
FIG. 2 is a diagram of a TEA tree search based on the MTEA algorithm to generate test sequences.
FIG. 3(a) is a schematic diagram of the regression analysis of MTEA algorithm on the number of probe nodes under the model M1 and the generated FTS at different μ values.
FIG. 3(b) is a schematic diagram of the regression analysis of MTEA algorithm on the number of probe nodes under the model M2 and the generated FTS at different μ values.
FIG. 3(c) is a schematic diagram of the regression analysis of MTEA algorithm on different μ values of the number of probe nodes and the generated FTS under the model M3.
FIG. 3(d) is a schematic diagram of the regression analysis of MTEA algorithm on different μ values for the number of probe nodes under the model M4 and the generated FTS.
FIG. 3(e) is a schematic diagram of the regression analysis of MTEA algorithm on different μ values for the number of probe nodes under the model M5 and the generated FTS.
Figure 4 is a general flow diagram of the MCTS algorithm.
Detailed Description
In order to more specifically describe the present invention, the following detailed description is provided for the technical solution of the present invention with reference to the accompanying drawings and the specific embodiments.
The main framework of the MTEA method of the present invention is described below:
Figure BDA0002592149740000051
Figure BDA0002592149740000061
algorithm 1 given a test EFSM model M for a system, the inputs to the MTEA algorithm are: initial State schema SC0Testing a coverage transition set TS, a maximum search depth Max and a cost parameter mu, and outputting a returned result of the algorithm as an executable test sequence FTS meeting the coverage requirement. An algorithm initialization phase (S1-S2) using an initial state constellation SC0To initialize the root node N of the TEA treeroot(ii) a The main part of the algorithm is a while loop body (S3-S10); the termination condition of the algorithm is as follows: the search depth for successfully finding an executable test sequence or TEA tree that satisfies the test coverage requirement exceeds the maximum upper bound Max. From the perspective of high-level abstraction, the algorithm mainly searches a target transition sequence by sampling an extension space of a part of a TEA tree by an MCTS technology, and the decision of each step of extension of the TEA tree is realized according to a feedback result from node simulation and sampling, specifically by a function search (n) of the algorithm S7; once a new child node is expanded, the algorithm immediately checks whether the path corresponding to the node meets the test requirements, and if so, searches for an FTS. In the algorithm, the test coverage criterion adopted by the algorithm is all-transitions, and obviously, the method is also suitable for other consistency test coverage criteria through simple extension.
The function search (N) realizes the fusion of the Monte Carlo search tree algorithm MCTS and TEA, and the final aim of the function search is to select one from a plurality of candidate sub-nodes to be expandedAnd serves as the root node of the new sub-tree. The MCTS process typically includes four steps: selection, extension, Simulation, and backtracking. In the algorithm, a function FeasibleOutTrans (N.sc) outputs an executable transition set corresponding to a node N.sc, | FeasibleOutTrans (N.sc) | represents the number of alternative executable output transitions; if the current node has only one output transition, the algorithm calls function Expand directly (N.T)next) To implement the node expansion step; otherwise the four steps of MCTS are iteratively performed to select the next optimal extension node.
The above iteration process is continuously performed, unless the algorithm reaches the overhead upper limit budget, the overhead upper limit is defined as:
Figure BDA0002592149740000071
where | TS | represents the number of transitions in the overlay bonding, μ is an adjustable overhead parameter, and | N.path | is the length of the node path. The definition of budget takes into account the fact that: the complexity of algorithm search is in direct proportion to the number of target transitions which are not covered currently, and in order to reduce the search overhead to the maximum extent, a self-adaptive mode is adopted to dynamically adjust the search cost; according to the definition of the budget, we can find that the more nodes currently cover the test target, the less overhead the budget of the budget for the point is. During each round of MCTS iteration, the algorithm firstly searches a node which is not completely expanded, and then calls the Expand function to Expand the child node N of the current nodechildIf N is presentchildA path contains all transitions in the TS, it is returned as an executable test sequence. The method comprises the steps that a Select function and an Expand function are combined to achieve a tree strategy in MCTS, then an algorithm calls a Simulation function to randomly sample a space of a tree, and a Simulation process takes the arrival of a set sampling search depth as an end condition; then, calling Backpropagation function to calculate the reward of the simulation sampling; finally, according to the set budget, an MCTS searching sub-tree can be constructed, and according to the MCTS tree, the most potential sub-nodes are selected to serve as the extended sub-nodes of the TEA tree by adopting a strategy in a Selection function. As shown in fig. 4, the MCTS search algorithm corresponds to fourThe method comprises the following steps:
step 1: the Selection phase is selected.
Figure BDA0002592149740000072
Figure BDA0002592149740000081
The main purpose of this step is to select a child node with the largest UCT value to expand the TEA tree, the formula for calculating the UCT value is shown as S7 in Algorithm 2, where Q (N)child) And V (N)child) The left part of the calculation formula embodies the search algorithm encourages to search preferentially the node with the largest reward value, and the right part embodies the property that the algorithm encourages to explore nodes with less visits. With this strategy, MTEA can achieve a tradeoff between search overhead and optimal results; specifically, the more times each node is accessed, the smaller the UCT, thereby forcing the algorithm to have an opportunity to explore its siblings, so that each node has a corresponding opportunity to be expanded.
Algorithm 2 has two input parameters: and N and e, wherein N is the current node to be expanded, and e describes the state of the current node in the selection step. When e is true, the algorithm means that a sub-tree is currently constructed to search for child nodes, and the parameter eta is set to be 0.5 under the condition, so that the reward value is taken in an interval of 0-1 and meets the Hoeffding inequality; when e is false, the decision search sub-tree is successfully constructed, so that node selection is performed only by means of the right value in the UCT formula, the parameter eta is set to be 0, and when the operation of the algorithm 2 is finished, the algorithm returns a node with the maximum UCT value as a next node N to be expandedbest
Step 2: the Expansion phase is extended.
Figure BDA0002592149740000082
The Expand function displayed by the algorithm 3 randomly selects the child nodes of the current node N, thereby realizing the expansion of the one-step search tree, and the node N is the result returned by the algorithm 2. Specifically, there may be multiple output transitions at node N, and first the Expand function randomly executes an executable output transition to generate a corresponding tail state pattern and assigns N with the tail state patternchildSc to construct new child nodes (S2-S3); then we need to initialize its Q (N) before saving the generated child node to the child node set of Nchild) And V (N)child) (ii) a Finally, returning the node N generated by the new expansionchild
And step 3: and simulating a Simulation phase.
Figure BDA0002592149740000091
MCTS essentially belongs to a heuristic search algorithm, which benefits from a simulation process based on search space sampling, the sampling process being performed according to a specifically set simulation strategy; in the invention, the TEA tree space is adopted based on a mainstream random strategy to realize the simulation process of the MCTS algorithm. Generally, each round of simulation process in the MCTS algorithm is iterated until a terminal node is reached; in the context of the TEA extension tree, the actual end node does not exist due to the strong connectivity of the measured protocol EFSM model. In algorithm 4, there are two types of nodes we use as end nodes: one is a node when the search depth reaches a preset upper limit of the overhead, and the other is a node of which the node path contains all the test coverage target transitions.
Specifically, the simulation function is a while loop body, and the end condition of the loop reflects the two cases discussed above, i.e. the simulation sampling depth reaches the maximum upper limit Max set by the algorithm, or n. When the simulation function finishes executing, it returns a reward value of node N calculated by function reward (N), which needs to be defined according to the above two cases, specifically as shown in algorithm 5:
Figure BDA0002592149740000092
Figure BDA0002592149740000101
the reward function provides a mechanism to quantify the correctness estimates of the current node propagation direction for a specific test target, and in the context of test sequence generation, the definition of the reward function needs to take into account the coverage criteria of the test. For the test coverage criteria of all-transform, a corresponding reward function is given in algorithm 5. Wherein, | TS | is the size of the test coverage set, | n. ω | is the path length of the terminal node when the simulation process is finished; in the algorithm 5, S2-S6 count the number of covered test target transitions in the current node path, and based on the data, a specific reward function S7 is constructed.
The definition of the reward function takes into account two types of simulation: one is to successfully find a node whose path contains all the test target transitions, the right part of the function
Figure BDA0002592149740000103
Decreasing with decreasing path length will eventually result in an increase in the function value. The larger the reward in the simulation process is, the larger the reward is, the current node is taken as a child node of the next expansion, and the test sequence with the shortest length can be generated; another case is that the end node fails to cover all target transitions, but searches for and reaches a set upper limit. Intermediate part of the reward function
Figure BDA0002592149740000104
Quantifying the coverage of the current test target, a terminal node covering more target transitions will have a larger reward value, and the final function value is in direct proportion to the value. In general, the reward value of the former case is greater than that of the latter case, and it is obvious that the value interval of the reward function is [0,1 ]]。
And 4, step 4: backpropagation stage is traced back.
Figure BDA0002592149740000102
Figure BDA0002592149740000111
In the simulation step in each search iteration process, a backtracking operation is used for updating relevant statistical data of a selected node, in a backprogramming function shown in an algorithm 6, two input parameters N and delta respectively represent a newly expanded node and a reward value of the simulation, parent (N) represents a parent node of N, and the function returns the reward value delta of a terminal node to a backtracking path of a root node along the backtracking path to update the statistical data of the node through while loop. In this process, all node data on the path from node N to the root node, including the cumulative reward q (N) and the total number of visits v (N), are updated one by one.
An example of MTEA algorithm is described below, where fig. 2 shows an example of a partial TEA tree search for the test sequence generation of the Network Monitor protocol EFSM model (as shown in fig. 1), in this example we assume that the test coverage target transition set TS ═ T3, T5, T6, T7, and the test target is to cover at least once all transitions of the TS set.
According to the MTEA algorithm provided by the invention, an attempt is made to search a shortest executable test sequence capable of meeting the coverage requirement in a TEA tree space, after each tree expansion operation, the algorithm needs to immediately judge whether a transition sequence meeting the coverage requirement is found, if so, the algorithm is terminated and a result sequence is output, otherwise, the TEA heuristic expansion search is continued.
As shown in FIG. 2, the root node tn of the tree1The corresponding model state is S1It has only one executable output transition T1 under the current state schema, so the TEA tree expands one step directly forward, since there is no selectable item, the corresponding child of the T1 transitionNode tn2Naturally becomes the root node of the next extended sub-tree. Node tn2There are two candidate output transitions T17 and T2, which are extended respectively, and at this time, we face the decision of the extension direction, and need to select one from the tail nodes of T17 and T2 as the child node to be extended next, and the correct decision should be able to guide the TEA extension to proceed toward the target direction. The method adopted by the invention is to initiate a round of MCTS search to sample the expansion space of the subsequent tree corresponding to the current node so as to make a correct decision, therefore tn2And the node executes MCTS search to construct a sub-TEA-Tree1 sub-Tree, the algorithm iteratively searches and constructs a search sub-Tree according to four steps of the MCTS, and the final decision of the expansion direction is made based on the sampling result of the search sub-Tree. In particular, in the selection step, because S3UCT value of corresponding node is larger than S1Of (a) thus S3The selected node is used as a next step of expansion, the algorithm enters the expansion step, S3With only one output transition T3, T3 tail state pattern S4Is selected as the extension object; in the simulation step, the slave S4Corresponding nodes are iterated to carry out random search sampling until a path covering a target is found or the set search cost is exhausted, the algorithm enters a backtracking step, the reward value of the terminal node is returned and updated along the historical sampling path, finally, one round of MCTS search is completed, and the node S4Is successfully extended.
Each round of search iteration expands a new child node and gradually constructs the whole MCTS search Tree, and when the overhead budget set by the MCTS is exhausted, the sub-TEA-Tree1 sub-Tree shown in FIG. 2 is constructed and can be used for supporting the decision of the TEA Tree expansion direction. In this example, according to the sub-TEA-Tree1 sub-Tree, since node tn4Has the largest value and is therefore selected as the next child node of the TEA tree extension. In the process of generating the test sequence, whenever the TEA tree extension faces the directional decision, the MTEA algorithm assists the decision through the sampling search of the MCTS, and finally a target executable test sequence can be searched always with relative high efficiency.
To verify the feasibility and effectiveness of the proposed method, we carried out a detailed experimental analysis based on five reference protocol EFSM test models, which are: m1(Network Monitor), M2(Inres initiator), M3(Class II), M4(OLSR) and M5(SCP), and the details of the model are shown in Table 1. In the experiment, all-transition is used as a coverage criterion, and executable test sequence generation is carried out by adopting different initial state patterns and test coverage sets with different lengths aiming at each model.
TABLE 1
Figure BDA0002592149740000121
Specifically, given an initial state configuration and a test coverage set TS, the algorithm will generate a corresponding executable test sequence that can cover at least once the test target transitions in all TS's. In the experiment, the difficulty degree of achieving the test coverage target is related to the size of the TS set and the target transition contained in the set, so that for each EFSM test model, the TS set with the length of 1 to the total number of model transitions is randomly generated; for each size, we randomly generated 20 sets of TS sets as test targets, respectively.
In order to study the influence of the algorithm on the stochastic nature and the initial state pattern in detail, we repeated 100 times per set of experiments and evaluated the performance of the method by statistical analysis. To illustrate the effectiveness of the method of the present invention, we chose random TEA method (RTEA) and breadth-first based TEA method (BTEA) as baseline methods for comparative experiments. In a specific experiment, the initial state pattern was set as follows: an M1 model, wherein the initial state is idle, and the range of the initial variable value is [0,10 ]; the M2 model, the initial state is set as Disconnect, the range of the initial variable value is [0,5 ]; an M3 model, wherein the initial state is set as s1, and the range of the initial variable value is [0,1000 ]; an M4 model, wherein the initial state is idle, and the range of the initial variable value is [0,2 ]; the M5 model has an initial state set to s1 and an initial variable value range of [0,3 ]. The method mainly solves the problem of state explosion in the TEA method, and for the convenience of experiments, the condition explosion is generated when the node of the TEA tree reaches 2000000, so that 2000000 becomes the upper limit of the number of nodes for the operation of the algorithm, and the algorithm stops operating when the limit is reached. Setting an initial parameter Max in the MTEA algorithm to be 50; in addition, in order to explore the sensitivity of the algorithm to the parameter μ, we developed corresponding experiments based on the values 20, 40, 60, 80 and 100, respectively, and the specific experimental environments are i7-7700 CPU, 16GB memory and Windows 1064-bit system.
TABLE 2
Figure BDA0002592149740000131
Table 2 shows the statistical analysis result of the average experiment, and column # N in table 2 indicates the number of nodes of the extended search in the test generation process, and the unit is 10000; column # L indicates the average length of the resulting sequence; columns Cov and Gen represent the coverage of the mean coverage transition set and the mean test sequence generation success rate, respectively. In order to ensure the fairness of comparison, only the average number of extended search nodes of the price comparison 3 methods when the test generation is successful is counted. The statistics in table 2 show that the method of the present invention can greatly reduce the required TEA search space compared to the other 2 methods. Compared with the BTEA method, the MTEA method reduces the average node number of the models M1-M4 by at least 89.72% and reaches 92.49% at most when the test generation is successful. The experimental results of model M5 show that the performance of the method of the invention is similar to that of the other 2 methods, and careful study can find that the model of M5 is very simple, in other words, there is no state explosion problem in the test generation. Thus, we can conclude that: the method provided by the invention aims at a complex test sequence generation scene, has the capability of avoiding state explosion, and can be effectively applied to protocol consistency test generation engineering practice based on an EFSM model.
TABLE 3
Figure BDA0002592149740000132
Figure BDA0002592149740000141
Table 3 shows the results of comparison of the time performance in the experiment. Intuitively, the heuristic method needs extra time overhead to make a decision, which may cause the time cost of algorithm operation, however, through experimental data, we can clearly find that the time performance of the MTEA method is superior to that of the BTEA method; for this reason, MTEA reduces a large amount of node search time, thus improving overall time performance.
In the case of different parameter μ values, fig. 3(a) to fig. 3(e), the algorithm generates regression analysis results of the number of nodes to be searched and the length of the result FTS. From the data in the graph, we can find that the larger the value of μ, i.e. the larger the upper limit of the search overhead, the shorter the FTS result length obtained by the algorithm, but the rising of the number of searched nodes is obvious, and the reduction of the result length is not obvious compared with the increased search cost. Through regression analysis, a plurality of empirical data are given to the application of the method, and the parameters can be specifically adjusted according to the test context in practical application.
The embodiments described above are presented to enable a person having ordinary skill in the art to make and use the invention. It will be readily apparent to those skilled in the art that various modifications to the above-described embodiments may be made, and the generic principles defined herein may be applied to other embodiments without the use of inventive faculty. Therefore, the present invention is not limited to the above embodiments, and those skilled in the art should make improvements and modifications to the present invention based on the disclosure of the present invention within the protection scope of the present invention.

Claims (4)

1. An EFSM executable test sequence generation method based on Monte Carlo tree search is characterized in that: establishing a TEA tree corresponding to the EFSM by using a Monte Carlo tree search algorithm, finding a path meeting a test coverage condition from the TEA tree, wherein the path is an executable test sequence, and the input and the output of each transition on the path and the path form a complete test case;
the specific implementation mode of the Monte Carlo tree search algorithm is as follows: firstly, establishing a TEA tree corresponding to EFSM, wherein each node in the TEA tree corresponds to a state and comprises a corresponding state name and a variable of the whole EFSM; searching is carried out from a given initial state, namely a root node, when a certain node has a plurality of output transitions, the next node is searched through the output transition with the maximum corresponding UCT value by calculating the UCT value of each output transition, and whether the path which passes through each transition contains all the test target transitions or not is checked, if so, the searching is finished, the output path is used as an executable test sequence, otherwise, the searching is continued;
the calculation expression of the UCT value is as follows:
Figure FDA0003456107000000011
Figure FDA0003456107000000012
Figure FDA0003456107000000013
Figure FDA0003456107000000014
wherein: n is the current node, N 'is the parent node of N, UCT (N) is the UCT value of the transition between nodes N and N', Q (N) is the accumulated reward value of the current node N, V (N) is the visited times of the current node N, V (N ') is the visited times of the parent node N', eta is a given weight coefficient, and delta (N)i) For the terminal node N in the simulation phase of the ith Monte Carlo tree searching process of the current node NiThe budget value is the upper limit of search cost of Monte Carlo tree search, N is the number of test target transitions covered on the path from the current node N to the root node in the TEA tree, | TS | is the number of test target transitions required to be covered, | Niω | is atCarrying out ith Monte Carlo tree search on the current node N from the root node to the terminal node NiMax is the maximum exploration depth set by the Monte Carlo tree search, | N.path | is the path depth from the current node N to the root node, and μ is a given overhead parameter used for controlling the scaling of the budget.
2. The method of generating an EFSM executable test sequence of claim 1, wherein: in the process of continuing searching, if a path covering all the test targets from the root node is not found if the set maximum exploration depth Max is exceeded, the Monte Carlo tree searching algorithm searches again from the root node or increases the maximum exploration depth Max or increases the overhead parameter mu.
3. The method of generating an EFSM executable test sequence of claim 1, wherein: the method converts the EFSM executable test sequence generation problem into a Markov decision process based on TEA tree search, and solves the problem by applying a Monte Carlo tree search algorithm.
4. The method of generating an EFSM executable test sequence of claim 1, wherein: the method establishes a fusion mechanism of the TEA tree and the Monte Carlo tree search algorithm, utilizes the Monte Carlo tree search algorithm to predict the extension rationality of the nodes in the TEA tree, namely establishes a TEA sub-tree established in a Monte Carlo tree search mode each time the TEA tree extends the nodes, and utilizes the state space information of the TEA sub-tree to select a more reasonable extension direction.
CN202010698489.XA 2020-07-20 2020-07-20 EFSM executable test sequence generation method based on Monte Carlo tree search Active CN111934948B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010698489.XA CN111934948B (en) 2020-07-20 2020-07-20 EFSM executable test sequence generation method based on Monte Carlo tree search

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010698489.XA CN111934948B (en) 2020-07-20 2020-07-20 EFSM executable test sequence generation method based on Monte Carlo tree search

Publications (2)

Publication Number Publication Date
CN111934948A CN111934948A (en) 2020-11-13
CN111934948B true CN111934948B (en) 2022-04-12

Family

ID=73313930

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010698489.XA Active CN111934948B (en) 2020-07-20 2020-07-20 EFSM executable test sequence generation method based on Monte Carlo tree search

Country Status (1)

Country Link
CN (1) CN111934948B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433853B (en) * 2020-11-30 2023-04-28 西安交通大学 Heterogeneous perception data partitioning method for supercomputer data parallel application
CN114020648B (en) * 2022-01-04 2022-04-12 广东拓思软件科学园有限公司 Application control testing method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102368226A (en) * 2011-10-10 2012-03-07 南京大学 Method for automatically generating test cases based on analysis on feasible paths of EFSM (extended finite state machine)
CN104077228A (en) * 2014-07-08 2014-10-01 浙江理工大学 EFSM performable test sequence generating method based on predicate dependency graph
CN104142888A (en) * 2014-07-14 2014-11-12 北京理工大学 Regularization state machine model design method with stateful protocol
CN104243243A (en) * 2014-10-14 2014-12-24 清华大学 Method for generating protocol testing sequence
CN104407977A (en) * 2014-12-08 2015-03-11 北京航空航天大学 Model detection based automatic joint debugging test method for staged task system
CN109582558A (en) * 2018-09-06 2019-04-05 杭州电子科技大学 A kind of minimum cost method for generating test case based on EFSM model

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101254609B1 (en) * 2008-05-19 2013-04-15 존슨 컨트롤스 테크놀러지 컴퍼니 Method of automatically formulating test cases for verifying at least one part of a piece of software
CN108429259B (en) * 2018-03-29 2019-10-18 山东大学 A kind of online dynamic decision method and system of unit recovery
CN110209770B (en) * 2019-06-03 2022-04-15 北京邮电大学 Named entity identification method based on strategy value network and tree search enhancement
CN110989352B (en) * 2019-12-06 2022-05-27 上海应用技术大学 Group robot collaborative search method based on Monte Carlo tree search algorithm

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102368226A (en) * 2011-10-10 2012-03-07 南京大学 Method for automatically generating test cases based on analysis on feasible paths of EFSM (extended finite state machine)
CN104077228A (en) * 2014-07-08 2014-10-01 浙江理工大学 EFSM performable test sequence generating method based on predicate dependency graph
CN104142888A (en) * 2014-07-14 2014-11-12 北京理工大学 Regularization state machine model design method with stateful protocol
CN104243243A (en) * 2014-10-14 2014-12-24 清华大学 Method for generating protocol testing sequence
CN104407977A (en) * 2014-12-08 2015-03-11 北京航空航天大学 Model detection based automatic joint debugging test method for staged task system
CN109582558A (en) * 2018-09-06 2019-04-05 杭州电子科技大学 A kind of minimum cost method for generating test case based on EFSM model

Also Published As

Publication number Publication date
CN111934948A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
CN111934948B (en) EFSM executable test sequence generation method based on Monte Carlo tree search
Das et al. Counter-example based predicate discovery in predicate abstraction
JPH1098465A (en) State machine slave station and system
Cassel et al. RALib: A LearnLib extension for inferring EFSMs
Hollanders et al. The complexity of policy iteration is exponential for discounted Markov decision processes
EP3232339B1 (en) Method and device for determining sql execution plan
CN104462657A (en) Selection method based on multiple design schemes of Petri network complex system
US7730436B2 (en) Verification using simultaneous and inductive SAT algorithms
Naik Efficient computation of unique input/output sequences in finite state machines
Grumberg et al. Achieving speedups in distributed symbolic reachability analysis through asynchronous computation
US7308657B2 (en) Method for generating hints for program analysis
US7685554B1 (en) Determination of data rate and data type in a high-level electronic design
CN109952742A (en) Graph structure processing method, system, the network equipment and storage medium
Liu et al. Smart DAG task scheduling with efficient pruning-based MCTS method
JP2007066125A (en) Graph search algorithm and graph search device using it
CN110991712B (en) Planning method and device for space debris removal task
Olvera-Cravioto PageRank's behavior under degree-degree correlations
CN106330559A (en) Complex network topology characteristic parameter calculation method and system based on MapReduce
Zhang et al. A refined resolution calculus for CTL
Fawaz et al. Hybrid evolutionary algorithm and application to structural optimization
Coja-Oghlan et al. Warning Propagation on random graphs
CN115392482B (en) Deep learning model selection method, device and equipment
KR102535636B1 (en) Apparatus and method for searching neural network architecture
CN112699039B (en) Automatic test data generation method and system based on classification tree
Pfeffer et al. Lazy factored inference for functional probabilistic programming

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant