Software testing (ST) is one of the most important software development life cycle (SDLC) phases and ST effort is often expressed as a percentage of SDLC effort. Unfortunately, in the literature ST effort percentage ranges from 10% to 60%. In the literature most of the machine learning algorithms and metaheuristics for optimizing them have looked at predicting overall SDLC effort without focusing on any specific SDLC phase, including testing. Therefore, this study investigates the application of the STEP of Gradient Boosting (GB) machine learning regression algorithm optimized through Differential Evolution (DE). Its prediction accuracy is compared with those obtained when the GB is also optimized through Particle Swarm Optimization (PSO) and Genetic Algorithms (GA). The performance of GB-DE, GB-PSO, and GB-GA was also compared to that of statistical regression (SR). Seven data sets of actual projects were selected from an international public repository for software projects. The results showed that GB-DE was statistically better than SR in all seven data sets at 95% confidence, whereas GB-PSO and GB-GA were better than SR in four and three data sets, respectively. Thus, we can conclude that GB-DE can be used for STEP of either new projects or enhancement projects developed in either the third or fourth programming language generation.