| The significance of software security has become increasingly salient with the swift advancement of software technology.Among the essential stages of software testing,regression testing is a pivotal process.Nonetheless,given the constraints of testing resources,fulfilling the testing demands within a restricted timeframe poses a challenge.Therefore,a test case optimization strategy is pivotal for improving efficiency in regression testing.Test case prioritization,a crucial technique,has garnered significant attention in the regression testing domain for generating more efficient execution sequences.Among many sorting techniques,dynamic techniques are widely studied due to their high validity,but they may not be applicable in certain environments.SD-TCP is one of the classic methods for sorting static black-box test cases,with a simple and easy-to-use algorithm but a large time overhead due to the iterative comparison process.In this thesis,we focus on the ranking process of SD-TCP.Fast ranking of test cases is achieved by introducing clustering techniques.An improvement strategy is then proposed from the viewpoint of applicability and stability.Finally,a prototype system for test case sorting is implemented,and the performance of the proposed method is evaluated based on extensive experimental comparisons.The experimental results show that the proposed method improves the sequence generation efficiency as well as the applicability while ensuring the sorting effect of the original method.1.The KS-TCP method(Test Case Prioritization Method Based on K-medoids and String Metric),which stands for Test Case Prioritization based on K-medoids and string metric,aims to address the issues of high time overhead and sensitivity to extreme test cases that arise with traditional black-box static test case prioritization methods.The proposed method employs an improved clustering algorithm to more finely classify test cases,and then reduces overall time overhead through a group sorting process.Execution sequences are combined using greedy algorithms and polling strategies for classified clusters to improve early diversity.Comparisons with various black-box static test case sorting methods show that the KS-TCP method not only significantly improves time efficiency but also increases the average fault detection rate to some extent.2.To further verify the applicability of the black-box static sorting method,the proposed sorting method is combined with the combined testing technique to test and verify the program.The DC-TCP method(Test Case Prioritization Method based on DBSCAN and Combination Strategy),which stands for Test Case Prioritization based on DBSCAN and Combination Strategy,is proposed to address the poor performance of the KS-TCP algorithm in terms of applicability and sensitivity to configuration conditions.This method introduces the idea of a Combination Strategy,models program inputs to generate corresponding input models,and maps the test case set to a consistency structure type to improve the generality of the method.The stability of the clustering results is improved using the DBSCAN method,and the effectiveness of sequence merging is improved using the Firefly heuristic search algorithm.Experimental results show that the time overhead of the improved algorithm is much smaller than that of SD-TCP,further enhancing the stability and applicability of KS-TCP.3.A prototype system for efficient test case prioritization based on clustering technology is designed and implemented,consisting of a test case preprocessing module,KS-TCP algorithm execution module,DC-TCP algorithm execution module,comparison algorithm execution module,test result statistical analysis module,and test result access module.The study verifies the effectiveness of the proposed two algorithms in a variety of program tests based on the implemented prototype system. |