Tehnički Vjesnik (Jan 2022)
Automated Test Case Generation Based on Competitive Swarm Optimizer with Schema and Node Branch Archive
Abstract
Software testing plays an important role in the software development life cycle, among which automated test case generation (ATCG) technology is widely concerned because of its low cost and high degree of automation. In the process of using search-based algorithms to solve the automated test case generation for path coverage (ATCG-PC), how to minimize the generation of redundant test cases under the premise of 100% path coverage has always been a challenge. Inspired by improving the search ability of the search-based algorithm itself and the prior knowledge in the field of ATCG-PC, we propose a competitive swarm optimizer with schema and node branch archive (SNBAr-CSO) algorithm to solve the problem of complex test case generation with multiple variables in nodes. On the basis of competitive swarm optimizer, this algorithm uses the prior knowledge of schema to find all variables that affect the direction of a node branch quickly, and uses node branch archive to record the relationship between node branch direction and variable value. The experimental results of 12 practical programs on iFogSim and CoreNLP show that compared with other newly proposed algorithms, SNBAr-CSO can greatly reduce the number of redundant test cases under the premise of 100% path coverage.
Keywords