Font Size: a A A

Reuse And Generation Of Test Cases Based On Parameter Path Flow Diagram And Chained C-SVMXGBoost Model

Posted on:2022-12-03Degree:MasterType:Thesis
Country:ChinaCandidate:Q Y YuFull Text:PDF
GTID:2518306755965599Subject:Control Engineering
Abstract/Summary:PDF Full Text Request
Presently,the research on test path coverage is relatively extensive,but there are still some problems.On the one hand,a large number of test cases may be accumulated but not fully utilized,resulting in a waste of existing resources and manpower.On the other hand,the time it takes to run the program under test,especially large-scale programs,explodes.How to make full use of test cases and improve test efficiency has become a research hotspot in the field of software testing.Based on this,the following two strategies are proposed.Firstly,an approach to test case reuse that measures program similarity by parameter path similarity is proposed,and this approach mainly focuses on the testing between similar programs.The parameter path flow diagram is constructed by function blocks,and it determines whether the similarity of parameter paths can be compared by their parameter type.On the basis of the parameter selection method,it borrows the dynamic programming algorithm to find the largest common sub-path of the parameter path flow diagram of the program to be tested,and the similarity of the parameter paths is calculated according to the maximum common sub-path distance.In this way,similar programs are found,and the test cases of the reusable program part whose similarity reaches a certain threshold are used in evolutionary generation process.Experiments show that the accuracy of program similarity detection and the efficiency of test case generation can be effectively improved through the parameter path flow diagram.Secondly,in order to improve the test efficiency of dissimilar programs,a chained model combining SVM and XGBoost is proposed,and multi-path test data generation is realized by genetic algorithm.Use a certain sample to train several sub-models(SVM and XGBoost)for predicting the state of path nodes,filter the optimal sub-models based on the prediction accuracy value of the sub-models,and link the optimal sub-models in sequence according to the order of the path nodes to form a chained model which is named C-SVMXGBoost(Chained SVM and XGBoost).When using the genetic algorithm to generate test cases,it makes use of the chained model that is trained instead of the instrumentation method to predict the test data coverage path,finds the path set with the predicted path similar to the target path,instrumentates and verifies the predicted path set with similar path sets,obtains accurate path,and calculates fitness value of the current test case;In the crossover and mutation process,excellent test cases with a large path level depth in the sample set are introduced for reuse to generate test data covering the target path.In addition,it saves the individuals with higher fitness during evolutionary generation,and updates the chained model to further improve the test efficiency.Experiments show that the C-SVMXGBoost is more suitable for solving the path prediction problem and improving the test efficiency than other related chained models.The purpose of research on test case reuse is to improve the efficiency of test case generation of the program under test,and at the same time make full use of the existing test data.Therefore,the methods are proposed of test case reuse and generation based on the parameter path flow diagram,and C-SVMXGBoost chained model respectively.The experiments show that the two methods proposed can quickly generate test data covering the target paths,which validates the feasibility and effectiveness.
Keywords/Search Tags:test case, program similarity, parameter path flow diagram, chained model, evolutionary generation
PDF Full Text Request
Related items