Automated test case generation based on path coverage (ATCG-PC) is a black-box optimization problem whose difficulty is attributed to the one-to-many relationship between path and test cases. It results in… Click to show full abstract
Automated test case generation based on path coverage (ATCG-PC) is a black-box optimization problem whose difficulty is attributed to the one-to-many relationship between path and test cases. It results in a large number of redundant function evaluations in the search process of algorithms for ATCG-PC. To minimize the redundant function evaluations for solving ATCG-PC, the equivalent mapping subspaces are defined to decompose the search space according to the paths. Inspired by the data distribution hypothesis, we assume that the target path can be covered by searching in one neighborhood of a test case (equivalent mapping subspace) instead of the whole search space. This article presents a manifold-inspired search-based algorithm that finds the equivalent mapping subspaces with the test-case-path relationship matrix. Furthermore, the algorithm generates test cases covering all possible paths by searching in the found subspaces. The experimental results show the proposed algorithm has significantly lower function evaluation consumption than the state-of-the-art algorithms with the highest path coverage rate in two open-source toolkits and 16 open-source real-world programs. Several orders of magnitude of function evaluations can be saved by searching in the found equivalent mapping subspaces instead of exploring the whole search space.
               
Click one of the above tabs to view related content.