CN114968824B - Testing method and system based on chain multi-path coverage - Google Patents

Testing method and system based on chain multi-path coverage Download PDF

Info

Publication number
CN114968824B
CN114968824B CN202210894579.5A CN202210894579A CN114968824B CN 114968824 B CN114968824 B CN 114968824B CN 202210894579 A CN202210894579 A CN 202210894579A CN 114968824 B CN114968824 B CN 114968824B
Authority
CN
China
Prior art keywords
path
model
sub
submodel
support vector
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
CN202210894579.5A
Other languages
Chinese (zh)
Other versions
CN114968824A (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.)
Jiangxi University of Finance and Economics
Original Assignee
Jiangxi University of Finance and Economics
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 Jiangxi University of Finance and Economics filed Critical Jiangxi University of Finance and Economics
Priority to CN202210894579.5A priority Critical patent/CN114968824B/en
Publication of CN114968824A publication Critical patent/CN114968824A/en
Application granted granted Critical
Publication of CN114968824B publication Critical patent/CN114968824B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a testing method and a testing system based on chain type multi-path coverage.A support vector machine-extreme gradient lifting chain type model for path prediction is constructed to replace a pile inserting method to simulate a testing data coverage path so as to reduce pile inserting time; meanwhile, similar target paths are screened as much as possible, and the utilization rate and the path coverage efficiency of the test cases are improved. Compared with other models, the SVM-LGM-LIFT chain model provided by the invention has great advantages in precision and time. In addition, more similar target paths can be obtained by the support vector machine-extreme gradient lifting chain model, so that more paths can be covered as much as possible in the subsequent test case generation, and the path coverage efficiency is improved.

Description

Testing method and system based on chain multi-path coverage
Technical Field
The invention relates to the technical field of computer genetic algorithms, in particular to a testing method and system based on chain multi-path coverage.
Background
At present, a lot of time is spent on a tester for generating data meeting a test target through manual testing, and a plurality of target paths to be tested are often required. Therefore, test data meeting the conditions are automatically generated, the multi-target path is attempted to be covered through the existing data to improve the generation efficiency of the test case, and more repetitive work can be avoided.
In the multi-path coverage test generation, mining the relevance between the coverage path and the test case, analyzing the similarity between the paths and the like is beneficial to improving the quality of the test case. Meanwhile, a Genetic Algorithm (Genetic Algorithm) has mechanisms such as biological evolution, Genetic variation and global probability search, can generate abundant and various test data, and is widely applied to automatic generation of test data. In addition, with the continuous maturity of machine learning methods, many researchers have combined machine learning models and testing theories to perform research in related fields. Among many Machine learning models, SVMs (Support Vector machines) and xgboosts (eXtreme Gradient Boosting) have advantages of small samples, low time consumption, and high accuracy, and are widely used, and they have respective advantages for processing different data types.
In a real test scene, a plurality of target paths contained in a test target have certain relation. Each path node of each path may be represented in two states (i.e., pass or not pass), and the prediction of node state may be considered a binary problem. Because the input data types of the tested programs are different, the path prediction by using a single model has certain limitation. The SVM model has a good classification effect on numerical samples and is suitable for test data of small samples; the XGboost model has good expandability and better classification effect on non-numerical type samples.
However, in the prior art, an effective method capable of simultaneously combining the SVM model and the XGBoost model to realize the chain multi-path coverage test is still lacking, and the actual application requirements cannot be well met.
Disclosure of Invention
In view of the above situation, the main objective of the present invention is to provide a testing method based on chain multi-path coverage to solve the above technical problems.
The embodiment of the invention provides a testing method based on chain multi-path coverage, wherein the method comprises the following steps:
step one, constructing a support vector machine-extreme gradient lifting chain type model:
inputting randomly generated test data into a pile inserting program to obtain a test path, and calculating according to the number of path nodes of the test path and the state of the path nodes to obtain the corresponding path level depth;
selecting a corresponding pre-training model according to the type of the test data; the pre-training model comprises a support vector machine model and a limit gradient lifting model;
training the submodel corresponding to each path node in the test path according to the selected pre-training model to calculate and obtain the corresponding submodel precision, wherein the submodel comprises a support vector machine submodel and a limit gradient lifting submodel;
when the sub-model precision reaches a preset optimal sub-model threshold value, storing the corresponding sub-models and adding 1 to the number of the sub-models until the number of the sub-models is equal to the number of the path nodes, and stopping constructing the sub-model of each path node to obtain an optimal support vector machine sub-model and an optimal limit gradient lifting sub-model;
linking the obtained optimal support vector machine submodel and the optimal extreme gradient lifting submodel according to the sequence of each path node of the test path to obtain the support vector machine-extreme gradient lifting chain model;
step two, utilizing the constructed support vector machine-extreme gradient lifting chain model to generate a test case through a genetic algorithm:
initializing genetic parameters of a genetic algorithm, and converting the genetic parameters into decimal systems for acquiring corresponding coverage paths;
inputting test data into the support vector machine-extreme gradient lifting chain model to obtain a corresponding predicted path, searching to obtain a similar path in a target path according to the predicted path, inputting the current test data into a pile inserting program after obtaining a plurality of similar paths to obtain an accurate path, and calculating to obtain a fitness value according to a fitness function based on the accurate path;
if the calculated fitness value is 1, determining that the target path is covered, deleting the target path, and storing the current test data;
and when all the target paths are judged to be covered, completing the test, and outputting corresponding new test data and target path covering information.
The invention provides a testing method based on chain multi-path coverage, which has the following technical advantages:
(1) constructing a support vector machine-extreme gradient lifting chain model for path prediction to replace a pile inserting method to simulate a test data coverage path so as to reduce pile inserting time; meanwhile, similar target paths are screened as much as possible, and the utilization rate and the path coverage efficiency of the test cases are improved. Compared with other models, the support vector machine-extreme gradient lifting chain model provided by the invention has great advantages in precision and time. In addition, more similar target paths can be obtained through the support vector machine-extreme gradient lifting chain model, so that more paths can be covered as much as possible in the subsequent test case generation, and the path coverage efficiency is improved;
(2) in addition, in the genetic evolution process, the constructed support vector machine-extreme gradient lifting chain model is used for predicting the coverage path corresponding to the case, the stake insertion verification is carried out on the individuals meeting the requirements, and then the fitness is calculated. In order to enable the population individuals to evolve and generate towards the target path as soon as possible, excellent use cases in the original samples are introduced during cross variation. The complicated pile inserting process is simplified, the time consumption is reduced, excellent individuals are introduced, the population individuals are guided to accelerate the evolution towards the target path, and the test case generation efficiency covering the target path is improved;
(3) designing an updating rule of a support vector machine-extreme gradient lifting chain type model, wherein the quality of an original sample has a great influence on the accuracy of an initial path prediction model, and a part of experimental objects are difficult to achieve a good test effect through the initial model; considering the overall efficiency of the test, when the population evolution algebra and the number of excellent individuals reach a certain number, replacing part of samples of the original samples with the latest samples, and retraining the chain model to obtain a model with higher precision, thereby further improving the generation efficiency of the subsequent test cases.
The testing method based on chain multi-path coverage is characterized in that in the step one, for each submodel, the input data format of the training sample of each submodel during training is represented as follows:
Figure 855985DEST_PATH_IMAGE001
wherein, the first and the second end of the pipe are connected with each other,
Figure 92931DEST_PATH_IMAGE002
respectively representkA sample pattern of the different sub-models,
Figure 896939DEST_PATH_IMAGE003
indicating that one of the types of samples containsqThe number of the data is one,
Figure 232718DEST_PATH_IMAGE004
indicating sequential acquisition of test data after input to the instrumentation program
Figure 780374DEST_PATH_IMAGE005
Path node states corresponding to the submodels, wherein the types of sample patterns of the submodels are the same as the number of the path node states;
wherein, the prediction results sequentially output by all submodels form a complete prediction path
Figure 871827DEST_PATH_IMAGE006
I.e. by
Figure 846736DEST_PATH_IMAGE007
Figure 407161DEST_PATH_IMAGE008
Figure 86404DEST_PATH_IMAGE009
Indicating the first obtained after inputting the test data into the instrumentation procedure
Figure 907730DEST_PATH_IMAGE010
The state of the node of each path,
Figure 194486DEST_PATH_IMAGE011
representing a set of integers.
The testing method based on chain multi-path coverage is characterized in that in the step one, in the support vector machine submodel, the test method existshingeThe loss function, specifically represents:
Figure 101262DEST_PATH_IMAGE012
Figure 380934DEST_PATH_IMAGE013
wherein the content of the first and second substances,
Figure 322345DEST_PATH_IMAGE014
in order to separate the coefficients of the hyperplane,
Figure 514423DEST_PATH_IMAGE015
is the number of samples to be tested,
Figure 908495DEST_PATH_IMAGE016
in order to make the parameters of the penalty,
Figure 726278DEST_PATH_IMAGE017
Figure 522196DEST_PATH_IMAGE018
in order to be a function of the relaxation variable,
Figure 147825DEST_PATH_IMAGE019
Figure 357089DEST_PATH_IMAGE020
in order to separate the constant parameters of the hyperplane,
Figure 385088DEST_PATH_IMAGE021
is as follows
Figure 35512DEST_PATH_IMAGE022
The number of the samples is one,
Figure 834972DEST_PATH_IMAGE023
is as follows
Figure 203637DEST_PATH_IMAGE022
The predicted value of the number of samples,
Figure 363223DEST_PATH_IMAGE024
in order to perform the transposing operation,
Figure 868153DEST_PATH_IMAGE025
the representation is constrained to be constrained to,
Figure 838514DEST_PATH_IMAGE026
all indicate sample numbers.
The testing method based on chain multi-path coverage is characterized in thathingeThe loss function is an objective function with constraint conditions, and is converted into an unconstrained objective function through a Lagrange multiplier method, and the corresponding unconstrained objective function is expressed as:
Figure 694475DEST_PATH_IMAGE027
Figure 392173DEST_PATH_IMAGE028
wherein the content of the first and second substances,
Figure 17189DEST_PATH_IMAGE029
is as follows
Figure 158451DEST_PATH_IMAGE022
The lagrange multiplier in the objective function for each sample,
Figure 236129DEST_PATH_IMAGE030
is as follows
Figure 3097DEST_PATH_IMAGE031
The lagrange multiplier in the objective function for each sample,
Figure 482619DEST_PATH_IMAGE032
Figure 995116DEST_PATH_IMAGE033
is as follows
Figure 684723DEST_PATH_IMAGE031
The number of the samples is one,
Figure 599590DEST_PATH_IMAGE034
is as follows
Figure 995936DEST_PATH_IMAGE031
The predicted value of the number of samples,
Figure 682263DEST_PATH_IMAGE035
is a Gaussian kernel function;
the optimal solution derived from the unconstrained objective function is represented as:
Figure 859167DEST_PATH_IMAGE036
wherein the content of the first and second substances,
Figure 577724DEST_PATH_IMAGE037
for a general representation of the optimal solution found in the unconstrained objective function,
Figure 907205DEST_PATH_IMAGE038
for the first derived from the unconstrained objective function
Figure 685805DEST_PATH_IMAGE039
And (4) the optimal solution corresponding to each sample.
The testing method based on chain multi-path coverage is characterized in that in the step one, the extreme gradient lifting submodel is composed of
Figure 350005DEST_PATH_IMAGE040
The objective function of the extreme gradient lifting submodel is expressed as follows:
Figure 872253DEST_PATH_IMAGE041
wherein, the first and the second end of the pipe are connected with each other,
Figure 56241DEST_PATH_IMAGE042
is shown as
Figure 5742DEST_PATH_IMAGE040
The objective function corresponding to each basic model,
Figure 891659DEST_PATH_IMAGE043
representing true values
Figure 217598DEST_PATH_IMAGE044
And the predicted value
Figure 253163DEST_PATH_IMAGE045
The loss function of (a) is calculated,
Figure 373565DEST_PATH_IMAGE046
represents all of
Figure 12357DEST_PATH_IMAGE040
Complexity of individual basis models
Figure 876408DEST_PATH_IMAGE047
And (4) the sum.
The testing method based on chain multi-path coverage is characterized in that in the step one, the path level depth is expressed as:
Figure 690780DEST_PATH_IMAGE048
wherein the content of the first and second substances,
Figure 123030DEST_PATH_IMAGE049
the depth of the path level is represented,
Figure 186801DEST_PATH_IMAGE050
indicates the number of nodes of a complete path,
Figure 588963DEST_PATH_IMAGE051
indicating the current state of the node of the path,
Figure 602050DEST_PATH_IMAGE052
a constant value is represented as a function of time,
Figure 126572DEST_PATH_IMAGE053
representing the number of path node states;
sub-model precision is expressed as:
Figure 412060DEST_PATH_IMAGE054
wherein, the first and the second end of the pipe are connected with each other,
Figure 149071DEST_PATH_IMAGE055
the sub-model accuracy is represented by the sub-model accuracy,
Figure 751085DEST_PATH_IMAGE056
indicating that the prediction is a positive sample,
Figure 649771DEST_PATH_IMAGE057
indicating a prediction as a negative sample.
The testing method based on chain multi-path coverage comprises the following steps of linking an obtained optimal support vector machine submodel and an optimal extreme gradient lifting submodel according to the sequence of each path node of a testing path to obtain the support vector machine-extreme gradient lifting chain model, wherein a corresponding formula is represented as follows:
Figure 219293DEST_PATH_IMAGE058
Figure 228837DEST_PATH_IMAGE059
wherein the content of the first and second substances,
Figure 213586DEST_PATH_IMAGE060
is shown as
Figure 283173DEST_PATH_IMAGE053
The submodel corresponding to each path node,
Figure 339991DEST_PATH_IMAGE061
the submodel corresponding to the maximum value of the model precision is represented,
Figure 153226DEST_PATH_IMAGE062
model of support vector machine
Figure 729832DEST_PATH_IMAGE053
The precision value at each of the path nodes is,
Figure 970321DEST_PATH_IMAGE063
expressing extreme gradient lifting chain model in the first place
Figure 780014DEST_PATH_IMAGE053
The precision value at the node of each path,
Figure 131361DEST_PATH_IMAGE064
a chain model representing the final path prediction,
Figure 828052DEST_PATH_IMAGE065
represents a stripThe chain-wise manner of the full path prediction model,
Figure 973863DEST_PATH_IMAGE066
indicating from the 1 st path node to the 1 stkAll submodels corresponding to 1 path node are chain-combined according to the appearance order of the path nodes.
The testing method based on chain multi-path coverage is characterized in that in the second step, the formula of the path similarity is represented as follows:
Figure 208535DEST_PATH_IMAGE067
wherein the content of the first and second substances,
Figure 238939DEST_PATH_IMAGE068
a value representing the degree of similarity of the paths,
Figure 914771DEST_PATH_IMAGE069
the number of nodes representing the overlay path of the test data in the same state as the target path,
Figure 621696DEST_PATH_IMAGE070
representing the number of nodes of a target path.
The testing method based on the chain multi-path coverage is characterized in that the fitness function is expressed by the following formula:
Figure 812506DEST_PATH_IMAGE071
wherein the content of the first and second substances,
Figure 505655DEST_PATH_IMAGE072
the value of the fitness function is represented,
Figure 377272DEST_PATH_IMAGE073
representing the weight coefficients.
The invention provides a testing system based on chain multi-path coverage, wherein the system comprises:
a build module to:
inputting randomly generated test data into a pile inserting program to obtain a test path, and calculating according to the number of path nodes of the test path and the state of the path nodes to obtain the corresponding path level depth;
selecting a corresponding pre-training model according to the type of the test data; the pre-training model comprises a support vector machine model and a limit gradient lifting model;
training the submodel corresponding to each path node in the test path according to the selected pre-training model to calculate and obtain the corresponding submodel precision, wherein the submodel comprises a support vector machine submodel and a limit gradient lifting submodel;
when the sub-model precision reaches a preset optimal sub-model threshold value, storing the corresponding sub-models and adding 1 to the number of the sub-models until the number of the sub-models is equal to the number of the path nodes, and stopping constructing the sub-model of each path node to obtain an optimal support vector machine sub-model and an optimal limit gradient lifting sub-model;
linking the obtained optimal support vector machine submodel and the optimal extreme gradient lifting submodel according to the sequence of each path node of the test path to obtain the support vector machine-extreme gradient lifting chain model;
a genetic algorithm module to:
initializing genetic parameters of a genetic algorithm, and converting the genetic parameters into a decimal system for acquiring a corresponding coverage path;
inputting test data into the support vector machine-extreme gradient lifting chain model to obtain a corresponding predicted path, searching to obtain a similar path in a target path according to the predicted path, inputting the current test data into a pile inserting program after obtaining a plurality of similar paths to obtain an accurate path, and calculating to obtain a fitness value according to a fitness function based on the accurate path;
if the calculated fitness value is 1, determining that the target path is covered, deleting the target path, and storing the current test data;
and when all the target paths are judged to be covered, completing the test, and outputting corresponding new test data and target path covering information.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
FIG. 1 is a flow chart of a testing method based on chain multi-path coverage according to the present invention;
FIG. 2 is a schematic diagram of a support vector machine-extreme gradient lifting chain model;
FIG. 3 is a schematic diagram of a test case generated by a genetic algorithm using a support vector machine-extreme gradient lifting chain model;
fig. 4 is a structural diagram of a testing system based on chain multi-path coverage according to the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
These and other aspects of embodiments of the invention will be apparent with reference to the following description and attached drawings. In the description and drawings, particular embodiments of the invention have been disclosed in detail as being indicative of some of the ways in which the principles of the embodiments of the invention may be practiced, but it is understood that the scope of the embodiments of the invention is not limited correspondingly. On the contrary, the embodiments of the invention include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
For the convenience of describing the construction of the support vector machine-extreme gradient boost chain model of the present invention, the design of the sample pattern, the mathematical knowledge of the SVM (support vector machine) model and the XGBoost (extreme gradient boost) model involved needs to be introduced here.
(I) sample style:
the C-SVMXGBoost model (support vector machine-extreme gradient lifting chain model) is used for simulating and solving a coverage path of test data, and is formed by chain fusion of a plurality of submodels, each submodel needs a certain number of samples for training and comprises input data and an expected output result. The input data format of each sub-model training sample is different, and the expression form is shown as formula (1); the output result is a certain path node state corresponding to the test data and is expressed as
Figure 255098DEST_PATH_IMAGE006
For each submodel, the input data format of the training samples of each submodel at the time of training is represented as:
Figure 667625DEST_PATH_IMAGE001
(1)
wherein the content of the first and second substances,
Figure 164465DEST_PATH_IMAGE002
respectively representkThe sample patterns of the different sub-models are seeded,
Figure 690256DEST_PATH_IMAGE003
indicating that one type of sample containsqThe number of the data is set to be,
Figure 942245DEST_PATH_IMAGE004
indicating sequential acquisition of test data after input to the instrumentation program
Figure 107647DEST_PATH_IMAGE005
And path node states corresponding to the submodels, wherein the types of the sample patterns of the submodels are the same as the number of the path node states.
In addition, the method can be used for producing a composite materialAll submodels output the prediction results in turn to form a complete prediction path
Figure 142600DEST_PATH_IMAGE006
I.e. by
Figure 522896DEST_PATH_IMAGE007
Figure 617891DEST_PATH_IMAGE074
Figure 332907DEST_PATH_IMAGE009
Indicating the first obtained after inputting the test data into the instrumentation procedure
Figure 171550DEST_PATH_IMAGE010
The state of the node of each path,
Figure 671932DEST_PATH_IMAGE011
representing a set of integers.
In practical applications, a certain amount of test data, expressed as
Figure 937828DEST_PATH_IMAGE075
Figure 140140DEST_PATH_IMAGE076
The number of samples of test data is measured, then the test data is input into the tested program after the instrumentation, and the coverage path, namely
Figure 516894DEST_PATH_IMAGE077
The test data and paths form a set of capacities of
Figure 868854DEST_PATH_IMAGE076
Model sample of (2)
Figure 305651DEST_PATH_IMAGE078
Wherein the first sub-model sample is
Figure 995259DEST_PATH_IMAGE079
The sample of the second submodel is
Figure 254333DEST_PATH_IMAGE080
(ii) a And so on, the firstkThe sub-model samples are then represented as
Figure 650679DEST_PATH_IMAGE081
In addition, in order to make the sub-model sample have certain representativeness, screening is carried out during random generation, the sub-model sample is uniformly distributed in an input field of a tested program as much as possible, and the volume of the selected model sample is not suitable to be too large or too small. If the sample capacity is too small, the accuracy of the model cannot be reflected; if the sample capacity is too large, more computing resources and model building time are consumed, and the testing efficiency is reduced.
And (II) constructing a support vector machine model (SVM model):
in actual software testing, the test case is taken as a sample, and the condition of linear divisibility hardly exists, so that the method is introduced herehingeAnd (5) solving an optimization problem by using an SVM (support vector machine) through a loss function.
In particular, in the support vector machine submodel, there ishingeA loss function, expressed as:
Figure 258378DEST_PATH_IMAGE012
(2)
Figure 169702DEST_PATH_IMAGE013
wherein the content of the first and second substances,
Figure 153839DEST_PATH_IMAGE014
in order to separate the coefficients of the hyperplane,
Figure 483320DEST_PATH_IMAGE015
is the number of samples to be tested,
Figure 261920DEST_PATH_IMAGE016
in order to make a penalty on the parameters,
Figure 660540DEST_PATH_IMAGE017
Figure 182789DEST_PATH_IMAGE018
in order to be a function of the relaxation variable,
Figure 366776DEST_PATH_IMAGE019
Figure 316278DEST_PATH_IMAGE020
to separate the constant parameters of the hyperplane,
Figure 467773DEST_PATH_IMAGE021
is a first
Figure 528133DEST_PATH_IMAGE022
The number of the samples is one,
Figure 852715DEST_PATH_IMAGE023
is as follows
Figure 973117DEST_PATH_IMAGE022
The predicted value of the number of samples,
Figure 346330DEST_PATH_IMAGE024
in order to perform the transposing operation,
Figure 210381DEST_PATH_IMAGE025
the representation is constrained to be constrained to,
Figure 368961DEST_PATH_IMAGE026
all indicate sample numbers.
Further, the abovehingeThe loss function is an objective function with constraint conditions, and is converted into an unconstrained objective function through a Lagrange multiplier method, and the corresponding unconstrained objective function is expressed as:
Figure 660265DEST_PATH_IMAGE027
(3)
Figure 520773DEST_PATH_IMAGE028
wherein the content of the first and second substances,
Figure 188515DEST_PATH_IMAGE029
is as follows
Figure 201602DEST_PATH_IMAGE022
The lagrange multiplier in the objective function for each sample,
Figure 663807DEST_PATH_IMAGE030
is as follows
Figure 11612DEST_PATH_IMAGE031
The lagrange multiplier in the objective function for each sample,
Figure 483044DEST_PATH_IMAGE032
Figure 85058DEST_PATH_IMAGE033
is as follows
Figure 718165DEST_PATH_IMAGE031
The number of the samples is one,
Figure 553266DEST_PATH_IMAGE034
is as follows
Figure 562810DEST_PATH_IMAGE031
The predicted value of the number of samples,
Figure 281980DEST_PATH_IMAGE035
is a gaussian kernel function.
The optimal solution derived from the unconstrained objective function is represented as:
Figure 351567DEST_PATH_IMAGE036
wherein the content of the first and second substances,
Figure 408385DEST_PATH_IMAGE037
for a general representation of the optimal solution found in the unconstrained objective function,
Figure 221620DEST_PATH_IMAGE038
for the first derived from the unconstrained objective function
Figure 798226DEST_PATH_IMAGE039
And (4) the optimal solution corresponding to each sample.
Furthermore, the optimal solution is
Figure 38714DEST_PATH_IMAGE036
The separation hyperplane to be solved can be obtained by substituting the formula (4) and the formula (5).
Figure 582828DEST_PATH_IMAGE082
(4)
Figure 934175DEST_PATH_IMAGE083
(5)
Wherein the content of the first and second substances,
Figure 630867DEST_PATH_IMAGE084
the coefficients representing the final hyperplane are,
Figure 42256DEST_PATH_IMAGE085
a constant parameter representing the final separation hyperplane,
Figure 73666DEST_PATH_IMAGE086
is composed of
Figure 228704DEST_PATH_IMAGE037
One component of (a).
(III) constructing a limit gradient lifting model (XGboost model):
the extreme gradient lifting submodel is composed of
Figure 779902DEST_PATH_IMAGE040
The additive model is composed of basic models, and the objective function of the extreme gradient lifting submodel is expressed as:
Figure 362193DEST_PATH_IMAGE041
(6)
wherein the content of the first and second substances,
Figure 880899DEST_PATH_IMAGE042
is shown as
Figure 574049DEST_PATH_IMAGE040
The objective function corresponding to each basic model,
Figure 507982DEST_PATH_IMAGE043
representing true values
Figure 995596DEST_PATH_IMAGE044
And the predicted value
Figure 1598DEST_PATH_IMAGE045
Is used to determine the loss function of (c),
Figure 498438DEST_PATH_IMAGE046
represents all of
Figure 24229DEST_PATH_IMAGE040
Complexity of individual basis models
Figure 948322DEST_PATH_IMAGE047
And (4) the sum.
By the firsttThe base model is for example the second oneiA sample
Figure 176041DEST_PATH_IMAGE087
The predicted value of (c) can be expressed as shown in equation (7).
Figure 850474DEST_PATH_IMAGE088
(7)
Wherein the content of the first and second substances,
Figure 886563DEST_PATH_IMAGE089
is the firsttThe predicted value of the step model is calculated,
Figure 856924DEST_PATH_IMAGE090
is the firstt-a predicted value of the 1-step model,
Figure 447306DEST_PATH_IMAGE091
the predicted value of the new model is added for the need.
According to the Taylor's theorem,
Figure 410582DEST_PATH_IMAGE092
corresponding loss function
Figure 35599DEST_PATH_IMAGE093
As shown in formula (8):
Figure 377194DEST_PATH_IMAGE094
(8)
wherein the content of the first and second substances,
Figure 579505DEST_PATH_IMAGE095
as true value
Figure 956260DEST_PATH_IMAGE096
And a firstt-1 step model prediction
Figure 311149DEST_PATH_IMAGE097
Is used to determine the loss function of (c),
Figure 544684DEST_PATH_IMAGE098
to loss ofThe first derivative of the function is the derivative of,
Figure 109658DEST_PATH_IMAGE099
is the second derivative of the loss function;
substituting the formula band into the objective function, and simplifying the objective function as shown in formula (9).
Figure 617999DEST_PATH_IMAGE100
(9)
Wherein, the first and the second end of the pipe are connected with each other,
Figure 827395DEST_PATH_IMAGE101
representing the complexity of the model at step t.
In the objective function, each step can be obtained by only solving the first derivative and the second derivative of the loss function of each step and then optimizing the objective functionf(x) And then, according to the addition model, a complete model can be obtained.
Construction of chain model (support vector machine-extreme gradient lifting chain model):
referring to fig. 1 to 3, the present invention provides a testing method based on chain multi-path coverage, wherein the method includes the following steps:
s101, constructing a support vector machine-extreme gradient lifting chain model.
The method specifically comprises the following steps:
and S1011, inputting the randomly generated test data into the instrumentation program to obtain a test path, and calculating to obtain a corresponding path level depth according to the number of path nodes of the test path and the state of the path nodes.
The path level depth is represented as:
Figure 435094DEST_PATH_IMAGE048
(10)
wherein, the first and the second end of the pipe are connected with each other,
Figure 284101DEST_PATH_IMAGE049
the depth of the path level is represented,
Figure 596134DEST_PATH_IMAGE050
indicates the number of nodes of a complete path,
Figure 660036DEST_PATH_IMAGE051
indicating the current path node state (i.e., 1 when the node is traversed, 0 when the node is not traversed),
Figure 438636DEST_PATH_IMAGE052
a constant value is represented as a function of time,
Figure 774939DEST_PATH_IMAGE053
representing the number of path node states;
Figure 421821DEST_PATH_IMAGE102
Figure 730443DEST_PATH_IMAGE052
it can be guaranteed that when the node state is 0, the node path level depth is not 0. In the present embodiment, 0.01 is set.
And S1012, selecting a corresponding pre-training model according to the type of the test data.
The pre-training model comprises a support vector machine model and a limit gradient lifting model. The genetic parameters include: the initial population is 40, the cross probability is 0.9, the mutation probability is 0.1, and the maximum evolution generation number is 1000.
And S1013, training the sub-model corresponding to each path node in the test path according to the selected pre-training model so as to calculate and obtain the corresponding sub-model precision.
The submodels comprise a support vector machine submodel and a limit gradient lifting submodel.
Sub-model precision is expressed as:
Figure 552381DEST_PATH_IMAGE054
(11)
wherein, the first and the second end of the pipe are connected with each other,
Figure 579243DEST_PATH_IMAGE055
the sub-model accuracy is represented by the sub-model accuracy,
Figure 764236DEST_PATH_IMAGE056
indicating that the prediction is a positive sample,
Figure 927365DEST_PATH_IMAGE057
indicating a prediction as a negative sample.
And S1014, when the sub-model precision reaches the preset optimal sub-model threshold value, storing the corresponding sub-models, adding 1 to the number of the sub-models, and stopping constructing the sub-model of each path node until the number of the sub-models is equal to that of the path nodes, so as to obtain the optimal support vector machine sub-model and the optimal limit gradient lifting sub-model.
And S1015, linking the obtained optimal support vector machine submodel and the optimal extreme gradient lifting submodel according to the sequence of each path node of the test path to obtain the support vector machine-extreme gradient lifting chain model.
And linking the obtained optimal support vector machine submodel and the optimal extreme gradient lifting submodel according to the sequence of each path node of the test path to obtain the support vector machine-extreme gradient lifting chain model, wherein the corresponding formula is expressed as follows:
Figure 188713DEST_PATH_IMAGE058
(12)
Figure 437291DEST_PATH_IMAGE059
(13)
wherein, the first and the second end of the pipe are connected with each other,
Figure 425976DEST_PATH_IMAGE060
is shown as
Figure 709190DEST_PATH_IMAGE053
The submodel corresponding to each path node,
Figure 875860DEST_PATH_IMAGE061
the submodel corresponding to the maximum value of the model precision is represented,
Figure 611735DEST_PATH_IMAGE062
model of support vector machine
Figure 404110DEST_PATH_IMAGE053
The precision value at the node of each path,
Figure 541831DEST_PATH_IMAGE063
expressing extreme gradient lifting chain model in the first place
Figure 879402DEST_PATH_IMAGE053
The precision value at each of the path nodes is,
Figure 102573DEST_PATH_IMAGE064
a chain model representing the final path prediction,
Figure 433060DEST_PATH_IMAGE065
representing the chain of modes of a complete path prediction model,
Figure 159708DEST_PATH_IMAGE066
indicating from the 1 st path node to the 1 stkAll submodels corresponding to 1 path node are chain-combined according to the appearance order of the path nodes.
And (3) generating a genetic algorithm test fused with a C-SVMXGBoost chain model (support vector machine-extreme gradient lifting chain model):
designing a fitness function based on path coverage:
the fitness function is a key influence factor for screening excellent individuals and improving the testing efficiency, and the fitness function is designed according to different requirements and is an essential step in a genetic algorithm. By constructing a chain model of path prediction, more similar target paths are found, and test data are fully used in the evolution generation process as much as possible to cover more target paths.
Generating test data for easy-to-cover target paths is not of great significance, and test data that can pass through nodes of difficult-to-cover paths is considered to be a better population of individuals. The depth of the path level is related to the order and status of the path nodes in the instrumentation process, and is one of the factors for measuring the difficulty of the path being covered. In summary, the fitness function needs to be designed by comprehensively considering the similarity between the coverage path and the target path of the test data and the path hierarchy depth.
The formula for path similarity is expressed as:
Figure 196410DEST_PATH_IMAGE067
(14)
wherein the content of the first and second substances,
Figure 641297DEST_PATH_IMAGE068
a value representing the degree of similarity of the paths,
Figure 509896DEST_PATH_IMAGE069
the number of nodes representing the same state of the overlay path of the test data as the target path,
Figure 622209DEST_PATH_IMAGE070
representing the number of nodes of a target path.
The fitness function is formulated as:
Figure 301583DEST_PATH_IMAGE071
(15)
wherein the content of the first and second substances,
Figure 499346DEST_PATH_IMAGE072
the value of the fitness function is represented,
Figure 171636DEST_PATH_IMAGE073
representing the weight coefficients.
Wherein, in order to balance the comprehensive influence of the path similarity and the path hierarchy depth on the individual fitness, a weight coefficient is set, and as the path similarity is a main factor for judging whether the target path is covered or not, the weight is larger, so that the path similarity has the advantages of
Figure 138455DEST_PATH_IMAGE103
. Similarity of current path
Figure 254310DEST_PATH_IMAGE068
When the value is 1, the current test case covers the target path, the value is set to 1, and the individual fitness value is only subjected to
Figure 673790DEST_PATH_IMAGE068
Influence, i.e. fitness value of 1; similarity of current path
Figure 149770DEST_PATH_IMAGE068
When the value is not 1, it indicates that the current test case does not cover the target path, and the individual fitness value is affected by the similarity of the path and the depth of the hierarchy. Therefore, evolution continues to produce superior individuals based on fitness values.
The genetic evolution test generated:
s102, the constructed support vector machine-extreme gradient lifting chain model is utilized, and a test case is generated through a genetic algorithm.
Step S102 specifically includes:
and S1021, initializing the genetic parameters of the genetic algorithm, and converting the genetic parameters into decimal systems for acquiring corresponding coverage paths.
S1022, inputting test data into the support vector machine-extreme gradient lifting chain model to obtain a corresponding prediction path, searching to obtain a similar path in a target path according to the prediction path, inputting current test data into a pile inserting program after obtaining a plurality of similar paths to obtain an accurate path, and calculating to obtain a fitness value according to a fitness function based on the accurate path.
And S1023, if the calculated fitness value is 1, determining that the target path is covered, deleting the merged target path, and storing the current test data.
And S1024, when all the target paths are judged to be covered, completing the test, and outputting corresponding new test data and target path covering information.
The invention provides a testing method based on chain multi-path coverage, which has the following technical advantages:
(1) constructing a support vector machine-extreme gradient lifting chain model for path prediction to replace a pile inserting method to simulate a test data coverage path so as to reduce pile inserting time; meanwhile, similar target paths are screened as much as possible, and the utilization rate of test cases and the path coverage efficiency are improved. Compared with other models, the support vector machine-extreme gradient lifting chain model provided by the invention has great advantages in precision and time. In addition, more similar target paths can be obtained through the support vector machine-extreme gradient lifting chain model, so that more paths are covered as much as possible in the subsequent test case generation, and the path coverage efficiency is improved;
(2) in addition, in the genetic evolution process, the constructed support vector machine-extreme gradient lifting chain model is used for predicting the coverage path corresponding to the case, the stake insertion verification is carried out on the individuals meeting the requirements, and then the fitness is calculated. In order to enable the population individuals to evolve and generate towards the target path as soon as possible, excellent use cases in the original samples are introduced during cross variation. The complicated pile inserting process is simplified, the time consumption is reduced, excellent individuals are introduced, the population individuals are guided to evolve towards the target path in an accelerating mode, and therefore the test case generating efficiency covering the target path is improved;
(3) designing an updating criterion of the support vector machine-extreme gradient lifting chain model, wherein the quality of an original sample has a great influence on the accuracy of an initial path prediction model, and a part of experimental objects are difficult to achieve a good test effect through the initial model; considering the overall efficiency of the test, when the population evolution algebra and the number of excellent individuals reach a certain number, replacing part of samples of the original samples with the latest samples, and retraining the chain model to obtain a model with higher precision, thereby further improving the generation efficiency of the subsequent test cases.
Referring to fig. 4, the present invention provides a testing system based on chain multi-path coverage, wherein the system includes:
a build module to:
inputting randomly generated test data into a pile inserting program to obtain a test path, and calculating to obtain a corresponding path level depth according to the number of path nodes and the state of the path nodes of the test path;
selecting a corresponding pre-training model according to the type of the test data; the pre-training model comprises a support vector machine model and a limit gradient lifting model;
training the submodel corresponding to each path node in the test path according to the selected pre-training model to calculate and obtain the corresponding submodel precision, wherein the submodel comprises a support vector machine submodel and a limit gradient lifting submodel;
when the sub-model precision reaches a preset optimal sub-model threshold value, storing the corresponding sub-models and adding 1 to the number of the sub-models until the number of the sub-models is equal to the number of the path nodes, and stopping constructing the sub-model of each path node to obtain an optimal support vector machine sub-model and an optimal limit gradient lifting sub-model;
linking the obtained optimal support vector machine submodel and the optimal extreme gradient lifting submodel according to the sequence of each path node of the test path to obtain the support vector machine-extreme gradient lifting chain model;
a genetic algorithm module to:
initializing genetic parameters of a genetic algorithm, and converting the genetic parameters into a decimal system for acquiring a corresponding coverage path;
inputting test data into the support vector machine-extreme gradient lifting chain model to obtain a corresponding prediction path, searching to obtain a similar path in a target path according to the prediction path, inputting the current test data into a pile inserting program after obtaining a plurality of similar paths to obtain an accurate path, and calculating to obtain a fitness value according to a fitness function based on the accurate path;
if the calculated fitness value is 1, confirming that the target path is covered, deleting the target path and storing the current test data;
and when all the target paths are judged to be covered, completing the test, and outputting corresponding new test data and target path coverage information.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A testing method based on chain multi-path coverage is characterized by comprising the following steps:
step one, constructing a support vector machine-extreme gradient lifting chain model:
inputting randomly generated test data into a pile inserting program to obtain a test path, and calculating according to the number of path nodes of the test path and the state of the path nodes to obtain the corresponding path level depth;
selecting a corresponding pre-training model according to the type of the test data; the pre-training model comprises a support vector machine model and a limit gradient lifting model;
training the submodel corresponding to each path node in the test path according to the selected pre-training model to calculate and obtain the corresponding submodel precision, wherein the submodel comprises a support vector machine submodel and a limit gradient lifting submodel;
when the sub-model precision reaches a preset optimal sub-model threshold value, storing the corresponding sub-models and adding 1 to the number of the sub-models until the number of the sub-models is equal to the number of the path nodes, and stopping constructing the sub-model of each path node to obtain an optimal support vector machine sub-model and an optimal limit gradient lifting sub-model;
linking the obtained optimal support vector machine submodel and the optimal extreme gradient lifting submodel according to the sequence of each path node of the test path to obtain the support vector machine-extreme gradient lifting chain model;
step two, utilizing the constructed support vector machine-extreme gradient lifting chain model to generate a test case through a genetic algorithm:
initializing genetic parameters of a genetic algorithm, and converting the genetic parameters into decimal systems for acquiring corresponding coverage paths;
inputting test data into the support vector machine-extreme gradient lifting chain model to obtain a corresponding predicted path, searching to obtain a similar path in a target path according to the predicted path, inputting the current test data into a pile inserting program after obtaining a plurality of similar paths to obtain an accurate path, and calculating to obtain a fitness value according to a fitness function based on the accurate path;
if the calculated fitness value is 1, determining that the target path is covered, deleting the target path, and storing the current test data;
and when all the target paths are judged to be covered, completing the test, and outputting corresponding new test data and target path coverage information.
2. The method as claimed in claim 1, wherein in the step one, for each submodel, the input data format of the training samples of each submodel during training is represented as:
Figure 715817DEST_PATH_IMAGE001
wherein the content of the first and second substances,
Figure 164116DEST_PATH_IMAGE002
respectively representkThe sample patterns of the different sub-models are seeded,
Figure 225744DEST_PATH_IMAGE003
indicating that one of the types of samples containsqThe number of the data is set to be,
Figure 152111DEST_PATH_IMAGE004
indicating sequential acquisition of test data after input to the instrumentation program
Figure 763221DEST_PATH_IMAGE005
Path node states corresponding to the submodels, wherein the types of sample patterns of the submodels are the same as the number of the path node states;
wherein, all the sub-models output the prediction results in turn to form a complete prediction path
Figure 867575DEST_PATH_IMAGE006
I.e. by
Figure 665766DEST_PATH_IMAGE007
Figure DEST_PATH_IMAGE008
Figure 661404DEST_PATH_IMAGE009
Indicating the first obtained after inputting the test data into the instrumentation procedure
Figure 861441DEST_PATH_IMAGE010
The state of the node of each path,
Figure 133766DEST_PATH_IMAGE011
representing a set of integers.
3. The method as claimed in claim 2, wherein in the step one, there is a sub-model of the support vector machinehingeThe loss function, in particular, represents:
Figure 419254DEST_PATH_IMAGE012
Figure 687424DEST_PATH_IMAGE013
wherein, the first and the second end of the pipe are connected with each other,
Figure 741968DEST_PATH_IMAGE014
in order to separate the coefficients of the hyperplane,
Figure 453703DEST_PATH_IMAGE015
is the number of samples to be tested,
Figure 226487DEST_PATH_IMAGE016
in order to make the parameters of the penalty,
Figure 32769DEST_PATH_IMAGE017
Figure 207399DEST_PATH_IMAGE018
in order to be a function of the relaxation variable,
Figure 824456DEST_PATH_IMAGE019
Figure DEST_PATH_IMAGE020
to separate the constant parameters of the hyperplane,
Figure 615694DEST_PATH_IMAGE021
is a first
Figure 225667DEST_PATH_IMAGE022
The number of the samples is one,
Figure 5536DEST_PATH_IMAGE023
is as follows
Figure 308341DEST_PATH_IMAGE022
The predicted value of the number of samples,
Figure 524559DEST_PATH_IMAGE024
in order to perform the transposition operation,
Figure 938222DEST_PATH_IMAGE025
the representation is constrained to be constrained to,
Figure 835247DEST_PATH_IMAGE026
all indicate sample numbers.
4. The method for testing chain multi-path coverage as claimed in claim 3, wherein the testing method is based on chain multi-path coveragehingeThe loss function is an objective function with constraint conditions, and is converted into an unconstrained objective function through a Lagrange multiplier method, and the corresponding unconstrained objective function is expressed as follows:
Figure 43374DEST_PATH_IMAGE027
Figure 12467DEST_PATH_IMAGE028
wherein the content of the first and second substances,
Figure 964243DEST_PATH_IMAGE029
is as follows
Figure 718703DEST_PATH_IMAGE022
The lagrange multiplier in the objective function for each sample,
Figure 363311DEST_PATH_IMAGE030
is as follows
Figure 85280DEST_PATH_IMAGE031
The lagrange multiplier in the objective function for each sample,
Figure 840746DEST_PATH_IMAGE032
Figure 184134DEST_PATH_IMAGE033
is a first
Figure 999643DEST_PATH_IMAGE031
The number of the samples is one,
Figure 677749DEST_PATH_IMAGE034
is as follows
Figure 502486DEST_PATH_IMAGE031
The predicted value of the number of samples,
Figure 965959DEST_PATH_IMAGE035
is a Gaussian kernel function;
the optimal solution derived from the unconstrained objective function is represented as:
Figure 421211DEST_PATH_IMAGE036
wherein, the first and the second end of the pipe are connected with each other,
Figure 852192DEST_PATH_IMAGE037
for a general representation of the optimal solution found in the unconstrained objective function,
Figure 949461DEST_PATH_IMAGE038
for the first derived from the unconstrained objective function
Figure 530091DEST_PATH_IMAGE039
And (4) the optimal solution corresponding to each sample.
5. The method as claimed in claim 4, wherein in the step one, the extreme gradient boost submodel is composed of
Figure 421824DEST_PATH_IMAGE040
Additive model composed of individual basic models and extreme gradient extractionThe objective function of the liter model is represented as:
Figure 340101DEST_PATH_IMAGE041
wherein, the first and the second end of the pipe are connected with each other,
Figure 241061DEST_PATH_IMAGE042
denotes the first
Figure 413547DEST_PATH_IMAGE040
The objective function corresponding to each basic model,
Figure 741761DEST_PATH_IMAGE043
representing true values
Figure 881755DEST_PATH_IMAGE044
And the predicted value
Figure 586406DEST_PATH_IMAGE045
Is used to determine the loss function of (c),
Figure 878978DEST_PATH_IMAGE046
represents all of
Figure 378092DEST_PATH_IMAGE040
Complexity of individual basis models
Figure 5383DEST_PATH_IMAGE047
And (4) summing.
6. The method as claimed in claim 5, wherein in the step one, the path level depth is expressed as:
Figure DEST_PATH_IMAGE048
wherein, the first and the second end of the pipe are connected with each other,
Figure 530036DEST_PATH_IMAGE049
the depth of the path level is represented,
Figure 926382DEST_PATH_IMAGE050
indicates the number of nodes of a complete path,
Figure 596398DEST_PATH_IMAGE051
indicating the current state of the node of the path,
Figure 710985DEST_PATH_IMAGE052
a constant value is represented as a function of time,
Figure 239662DEST_PATH_IMAGE053
representing the number of path node states;
sub-model precision is expressed as:
Figure 756094DEST_PATH_IMAGE054
wherein the content of the first and second substances,
Figure 597011DEST_PATH_IMAGE055
the sub-model accuracy is represented by the sub-model accuracy,
Figure 198893DEST_PATH_IMAGE056
indicating that the prediction is a positive sample,
Figure 534191DEST_PATH_IMAGE057
indicating a prediction as a negative sample.
7. The method as claimed in claim 6, wherein the step of obtaining the SVM-DGL chain model by linking the obtained optimal SVM sub-model and optimal DGL sub-model according to the order of each path node of the test path is represented by a corresponding formula:
Figure 170709DEST_PATH_IMAGE058
Figure 182527DEST_PATH_IMAGE059
wherein, the first and the second end of the pipe are connected with each other,
Figure 6126DEST_PATH_IMAGE060
denotes the first
Figure 145115DEST_PATH_IMAGE053
The submodel corresponding to each path node,
Figure 370560DEST_PATH_IMAGE061
the submodel corresponding to the maximum value of the model precision is represented,
Figure 553280DEST_PATH_IMAGE062
model of support vector machine
Figure 129754DEST_PATH_IMAGE053
The precision value at the node of each path,
Figure 806854DEST_PATH_IMAGE063
represents the extreme gradient lifting chain model in the first
Figure 152385DEST_PATH_IMAGE053
The precision value at each of the path nodes is,
Figure 771585DEST_PATH_IMAGE064
a chain model representing the final path prediction,
Figure 341017DEST_PATH_IMAGE065
representing the chain of modes of a complete path prediction model,
Figure 71076DEST_PATH_IMAGE066
indicating from the 1 st path node to the 1 stkAll submodels corresponding to 1 path node are chain-combined according to the appearance order of the path nodes.
8. The method for testing chain multi-path coverage according to claim 7, wherein in the second step, the formula of the path similarity is represented as:
Figure 5534DEST_PATH_IMAGE067
wherein the content of the first and second substances,
Figure 795635DEST_PATH_IMAGE068
a value representing the degree of similarity of the paths,
Figure 831856DEST_PATH_IMAGE069
the number of nodes representing the overlay path of the test data in the same state as the target path,
Figure 100026DEST_PATH_IMAGE070
representing the number of nodes of a target path.
9. The method for testing based on chain multi-path coverage as claimed in claim 8, wherein the fitness function is formulated as:
Figure 420149DEST_PATH_IMAGE071
wherein the content of the first and second substances,
Figure 381152DEST_PATH_IMAGE072
the value of the fitness function is represented as,
Figure 639089DEST_PATH_IMAGE073
representing the weight coefficients.
10. A chained multi-path coverage based test system, the system comprising:
a build module to:
inputting randomly generated test data into a pile inserting program to obtain a test path, and calculating according to the number of path nodes of the test path and the state of the path nodes to obtain the corresponding path level depth;
selecting a corresponding pre-training model according to the type of the test data; the pre-training model comprises a support vector machine model and a limit gradient lifting model;
training the submodel corresponding to each path node in the test path according to the selected pre-training model to calculate and obtain the corresponding submodel precision, wherein the submodel comprises a support vector machine submodel and a limit gradient lifting submodel;
when the sub-model precision reaches a preset optimal sub-model threshold value, storing the corresponding sub-models and adding 1 to the number of the sub-models until the number of the sub-models is equal to the number of the path nodes, and stopping constructing the sub-model of each path node to obtain an optimal support vector machine sub-model and an optimal limit gradient lifting sub-model;
linking the obtained optimal support vector machine submodel and the optimal extreme gradient lifting submodel according to the sequence of each path node of the test path to obtain the support vector machine-extreme gradient lifting chain model;
a genetic algorithm module to:
initializing genetic parameters of a genetic algorithm, and converting the genetic parameters into decimal systems for acquiring corresponding coverage paths;
inputting test data into the support vector machine-extreme gradient lifting chain model to obtain a corresponding prediction path, searching to obtain a similar path in a target path according to the prediction path, inputting the current test data into a pile inserting program after obtaining a plurality of similar paths to obtain an accurate path, and calculating to obtain a fitness value according to a fitness function based on the accurate path;
if the calculated fitness value is 1, determining that the target path is covered, deleting the target path, and storing the current test data;
and when all the target paths are judged to be covered, completing the test, and outputting corresponding new test data and target path covering information.
CN202210894579.5A 2022-07-28 2022-07-28 Testing method and system based on chain multi-path coverage Active CN114968824B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210894579.5A CN114968824B (en) 2022-07-28 2022-07-28 Testing method and system based on chain multi-path coverage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210894579.5A CN114968824B (en) 2022-07-28 2022-07-28 Testing method and system based on chain multi-path coverage

Publications (2)

Publication Number Publication Date
CN114968824A CN114968824A (en) 2022-08-30
CN114968824B true CN114968824B (en) 2022-09-30

Family

ID=82970447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210894579.5A Active CN114968824B (en) 2022-07-28 2022-07-28 Testing method and system based on chain multi-path coverage

Country Status (1)

Country Link
CN (1) CN114968824B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117632770B (en) * 2024-01-25 2024-04-19 江西财经大学 Multipath coverage test case generation method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083531A (en) * 2019-04-12 2019-08-02 江西财经大学 It improves the shared multi-goal path coverage test method of individual information and realizes system
CN110533150A (en) * 2019-07-05 2019-12-03 江西财经大学 Self -adaptive and reuse system and method based on Support vector regression model
CN111240995A (en) * 2020-01-21 2020-06-05 江西财经大学 Multi-path covering method and system combining key point probability and path similarity
US11169288B1 (en) * 2017-12-07 2021-11-09 Triad National Security, Llc Failure prediction and estimation of failure parameters
CN114780439A (en) * 2022-06-13 2022-07-22 江西财经大学 Reuse method of test cases among similar programs facing to parameter path flow graph

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763055B (en) * 2018-04-19 2020-08-25 北京航空航天大学 Construction method of test case constraint control technology based on epigenetic inheritance

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11169288B1 (en) * 2017-12-07 2021-11-09 Triad National Security, Llc Failure prediction and estimation of failure parameters
CN110083531A (en) * 2019-04-12 2019-08-02 江西财经大学 It improves the shared multi-goal path coverage test method of individual information and realizes system
CN110533150A (en) * 2019-07-05 2019-12-03 江西财经大学 Self -adaptive and reuse system and method based on Support vector regression model
CN111240995A (en) * 2020-01-21 2020-06-05 江西财经大学 Multi-path covering method and system combining key point probability and path similarity
CN114780439A (en) * 2022-06-13 2022-07-22 江西财经大学 Reuse method of test cases among similar programs facing to parameter path flow graph

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
基于分支覆盖的回归测试路径选择;吴川等;《软件学报》;20160114;第27卷(第04期);全文 *
基于支持向量机回归模型的测试用例生成与重用;钱忠胜等;《电子学报》;20210731;第49卷(第7期);全文 *
架空线路改造工程造价的组合预测方法;俞敏等;《电力科学与技术学报》;20200128(第01期);全文 *
结合关键点概率与路径相似度的多路径覆盖策略;钱忠胜等;《软件学报》;20220228;第33卷(第2期);全文 *

Also Published As

Publication number Publication date
CN114968824A (en) 2022-08-30

Similar Documents

Publication Publication Date Title
Zhou et al. A survey on evolutionary construction of deep neural networks
Gaier et al. Data-efficient exploration, optimization, and modeling of diverse designs through surrogate-assisted illumination
US20120130929A1 (en) Controlling quarantining and biasing in cataclysms for optimization simulations
Kyriakides et al. An introduction to neural architecture search for convolutional networks
CN110533150B (en) Test generation and reuse system and method based on support vector machine regression model
US20210133378A1 (en) Methods and systems for the estimation of the computational cost of simulation
Tjanaka et al. pyribs: A bare-bones python library for quality diversity optimization
JP7411977B2 (en) Machine learning support method and machine learning support device
CN114968824B (en) Testing method and system based on chain multi-path coverage
Hartmann et al. Meta-modelling meta-learning
CN116629352A (en) Hundred million-level parameter optimizing platform
Yi et al. Intergroup cascade broad learning system with optimized parameters for chaotic time series prediction
Shahshahani et al. Resource and performance estimation for CNN models using machine learning
CN115310355A (en) Multi-energy coupling-considered multi-load prediction method and system for comprehensive energy system
CN113010687B (en) Exercise label prediction method and device, storage medium and computer equipment
CN113128771B (en) Expensive function optimization method and device for parallel differential evolution algorithm
CN111026661B (en) Comprehensive testing method and system for software usability
CN113240094A (en) SVM-based LSTM hyper-parameter optimization method, system, medium and device
Luo et al. A new approach to building the Gaussian process model for expensive multi-objective optimization
CN112667591A (en) Data center task interference prediction method based on mass logs
Al-Helali et al. GP-based feature selection and weighted KNN-based instance selection for symbolic regression with incomplete data
Bahnsen et al. Effect analysis of low-level hardware faults on neural networks using emulated inference
CN117474125B (en) Automatic training machine learning model system
de Kievit Effect volume loss term in graph neural networks predicting material behavior
Lu et al. Noise-Tolerant Hardware-Aware Pruning for Deep Neural Networks

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