The invention relates to a method for optimizing test cases in a regression test based on distribution, which comprises the following steps of: performing priority
ranking on the execution sequences of test cases in a
test case set in the regression test according to the distribution of an execution profile in a profile space, and preferentially executing the test cases with high priorities, so that the test cases with adjacent execution sequences are dispersed in the profile space to the greatest extent, error detection capability is maximized as early as possible, and the error
detection rate is improved. The execution sequences of the test cases are ranked on the premise of not performing any
test case reduction, namely the create sequences of the test cases are not taken as the execution sequences of the test cases, and the execution sequences of the test cases are ranked by a distribution-based
test case priority technology, so that on the one hand, the error detection capability of the test case set is not influenced, and on the other hand, the error
detection rate is improved; therefore, a
programmer can find more errors as early as possible, and the
time cost of searching the errors by the
programmer is saved.