Researchers are currently seeking effective methods for automated software testing to reduce time, avoid test case redundancy, and create comprehensive test cases to cover (paths, benches, conditions, and statements). Generating a minimum number of test cases and covering all code paths is challenging in automated test case generation. Therefore, the use of optimization algorithms has become a popular trend for generating test cases to achieve many goals. In this study, we used a teaching-learning-based optimization algorithm to generate the minimum number of test cases. We compared our results with those of other state-of-the-art methods based on the path coverage for ten Java programs. The motive for using this algorithm is to optimize the number of test cases that cover all code paths in the unit test. The results emphasize that the proposed algorithm generates the minimum number of test cases and covers all paths in the code at a full-coverage rate.INDEX TERMS Test suite generation, unit testing, object-oriented test case generation, coverage-based optimization.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.