Test data generation for improved path coverage and diversity using birds of prey-based optimization
4 affiliations
- 1Department of Computer Engineering, Ta.C., Islamic Azad University
- 2Department of Electrical and Computer Engineering, The University of British Columbia (UBC)
- 3Department of Computer Engineering, Ard.C., Islamic Azad University
- 4Department of Computer Engineering, Faculty of Engineering and Natural Science, Istinye University
Abstract
Automatic white-box test data generation is an essential problem in software engineering that must deal with exploring large and complex input spaces for achieving high code coverage without losing diversity in the test suite. While traditional metaheuristic algorithms (such as Genetic Algorithms (GA) and Particle Swarm Optimization (PSO)) have the tendency of premature convergence, they also tend to generate redundant test cases that are not covering critical execution paths. This paper proposes an Enhanced Birds of Prey‑Based Optimization (BPBO) framework by adapting the original BPBO algorithm to automatic test data generation. The proposed approach is the First domain specific adaptation of BPBO (the predator-prey metaheuristic inspired by the hunting strategy of eagles, hawks and falcons) to software testing, where four complementary predator-prey hunting phases, namely Individual hunting, Cooperative hunting, Competition, and Continuous relocation, are mapped to different search behaviors. Also, the multi-objective fitness function is defined for maximizing the path coverage, giving fitness rewards for the rare execution paths and ensuring population diversity throughout the evolutionary process. For 10 benchmark programs (TriangleType, Fibonacci, QuadraticSolver, NestedIf, CalDay, XML Parser, Bank Account System, Student Grade System, String Validation and Array Processing), the Enhanced BPBO algorithm is compared to six popular algorithms, namely GA, PSO, ACO, ABC, TLBO and Coot, and run 50 independent times. The outcomes of the experiments illustrate the fact that proposed method attain an average path covering 99.11% for all programs which is an absolute rise of 1.63% point (or 63.8% relative decrease of uncovered paths) over TLBO with path covering of 97.48%. The success rate is 0.966 (only 3.4 runs out of 50 fail); 31.2% faster than TLBO and 37.2% faster than Coot to converge. The average execution time is 1.46 s, which is 25.5% faster than TLBO and 29.8% faster than Coot. All p-values for improvements are < 0.05 and Cliff’s delta effect size for all improvements is between 0.45 and 0.91. The results confirm that the search-based software test paradigm based on predator-prey is sound and effective, with almost optimal path coverage achieved with low computational cost and minimal test suite redundancy.
Related
- The potential of a “next generation” of community health workers to accelerate progress in reaching Universal Health Coverage and Health for All
- Cartoon style generation of animated image scenes based on improved GAN and RetNet
- Improved 2.5D-UNet pseudo-CT generation for attenuation correction in PET imaging using 18F-fluorodeoxyglucose and 11C-acetoacetate radiotracers
- Efficient generation of adversarial examples and cross-channel quality optimization based on latent space distribution search
- “We would be killing two birds with one stone”: Assessing perceptions of barbershop-based HIV prevention and sexual health service delivery among clients, barbers, and owners across Durban, South Africa
BibTeX
@article{hosseinlo2026test,
title = {{Test data generation for improved path coverage and diversity using birds of prey-based optimization}},
author = {Behzad Hosseinlo and Ali Ghaffari and Amin Mohajer and Abbas Mirzaei Somarin and Amir Seyyedabbasi},
journal = {Scientific Reports},
year = {2026},
month = aug,
doi = {10.1038/s41598-026-68438-1},
url = {https://doi.org/10.1038/s41598-026-68438-1},
note = {CC BY},
}
RIS
TY - JOUR
TI - Test data generation for improved path coverage and diversity using birds of prey-based optimization
AU - Behzad Hosseinlo
AU - Ali Ghaffari
AU - Amin Mohajer
AU - Abbas Mirzaei Somarin
AU - Amir Seyyedabbasi
PY - 2026
DA - 2026/08/01
JO - Scientific Reports
DO - 10.1038/s41598-026-68438-1
UR - https://doi.org/10.1038/s41598-026-68438-1
AB - Automatic white-box test data generation is an essential problem in software engineering that must deal with exploring large and complex input spaces for achieving high code coverage without losing diversity in the test suite. While traditional metaheuristic algorithms (such as Genetic Algorithms (GA) and Particle Swarm Optimization (PSO)) have the tendency of premature convergence, they also tend to generate redundant test cases that are not covering critical execution paths. This paper proposes an Enhanced Birds of Prey‑Based Optimization (BPBO) framework by adapting the original BPBO algorithm to automatic test data generation. The proposed approach is the First domain specific adaptation of BPBO (the predator-prey metaheuristic inspired by the hunting strategy of eagles, hawks and falcons) to software testing, where four complementary predator-prey hunting phases, namely Individual hunting, Cooperative hunting, Competition, and Continuous relocation, are mapped to different search behaviors. Also, the multi-objective fitness function is defined for maximizing the path coverage, giving fitness rewards for the rare execution paths and ensuring population diversity throughout the evolutionary process. For 10 benchmark programs (TriangleType, Fibonacci, QuadraticSolver, NestedIf, CalDay, XML Parser, Bank Account System, Student Grade System, String Validation and Array Processing), the Enhanced BPBO algorithm is compared to six popular algorithms, namely GA, PSO, ACO, ABC, TLBO and Coot, and run 50 independent times. The outcomes of the experiments illustrate the fact that proposed method attain an average path covering 99.11% for all programs which is an absolute rise of 1.63% point (or 63.8% relative decrease of uncovered paths) over TLBO with path covering of 97.48%. The success rate is 0.966 (only 3.4 runs out of 50 fail); 31.2% faster than TLBO and 37.2% faster than Coot to converge. The average execution time is 1.46 s, which is 25.5% faster than TLBO and 29.8% faster than Coot. All p-values for improvements are < 0.05 and Cliff’s delta effect size for all improvements is between 0.45 and 0.91. The results confirm that the search-based software test paradigm based on predator-prey is sound and effective, with almost optimal path coverage achieved with low computational cost and minimal test suite redundancy.
SN - 2045-2322
ER -