Font Size: a A A

Research On Random Generation And Prioritization Of String Test Case

Posted on:2020-03-15Degree:MasterType:Thesis
Country:ChinaCandidate:Y N ZhouFull Text:PDF
GTID:2428330596991443Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
With the rapid development of the Internet industry,computer software system as a new productivity tool of high efficiency,has penetrated into all walks of life.Software testing is the process of executing programs to detect errors.Random testing(RT)is a black-box testing method,which is widely used in the field of software testing.It randomly selects test cases of the input domain and is often used to detect specific functions of related programs.As an important supplement to manual testing,random generation of test cases can reduce the cost and improve the error detection rate.As an effective test method,test case prioritization(TCP)can improve test efficiency by rearranging test case execution sequence to maximize the established test objectives.The selection of test cases and the reduction of test case sets can reduce the cost of testing.In addition,test case prioritization can make use of test cases that are more valuable or detect more errors,and can also improve the speed of test case sets to detect faults in the system during testing.In this paper,from the point of view of random test case generation technology and test case prioritization technology,an output-based adaptive random test case generation method and a multi-information fusion method for string test case prioritization are proposed.Relevant experiments are carried out respectively,and the proposed method and the existing methods are compared and analyzed,the feasibility and effectiveness of the method are verified.At the same time,a test prototype system is designed and implemented.The main achievements of this paper are as follows:1.To solve the problem that generating legitimate test cases from random tests takes a lot of time and cost,an output-based adaptive random string test case generation(RT_ORS)method is proposed.RT_ORS method first obtains relevant information about code coverage method,then determines the probability of legal string generation,and then generates legal string test cases and illegal string test cases according to the determined probability.The illegal string test cases include emptystrings and non-empty strings,and each test set has at most one empty string.The method of generating illegal non-empty strings is to randomly select the length of the target string,and then randomly allocate each character or position of the string of the characters of ASCII code from 32 to 127.Finally,the real programs are tested,and the test results show that the algorithm of RT_ORS method is better than the existing algorithms in most cases.2.A method of Multi-Information Fusion String Test Case Prioritization(MIF_STCP)is proposed.The existing abstract test case sorting methods and specific test case sorting methods are analyzed.On the basis of these two algorithms,three improved multi-information fusion algorithms are proposed.They are:(1)Normalize two distances and add them as new distance metrics;(2)comparing distance after normalization to a larger value as a new distance measure,and then selecting the farthest distance as a new distance measure,and(3)sorting abstract and specific test cases respectively,adding the corresponding positions of test cases as a new location method to sort to test cases.The experimental results show that the string test case prioritization method based on multi-information fusion can detect more errors with fewer test cases.3.The test prototype system(ORS_MIF)is designed and implemented,which includes six core modules: parameter configuration module,pile insertion module,mutation module,test case generation algorithm execution module,test case prioritization algorithm execution module and result analysis module.The feasibility and effectiveness of the system are verified by experiments.
Keywords/Search Tags:Random testing, Coverage, Distance measurement, Test case generation, Test case prioritization
PDF Full Text Request
Related items