Test data generation for improved path coverage and diversity using birds of prey-based optimization
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.
Authors
- Amir Seyyedabbasi (ORCID: https://orcid.org/0000-0001-5186-4499)
- Ali Ghaffari (ORCID: https://orcid.org/0000-0001-5407-8629)
- Abbas Mirzaei Somarin
- Behzad Hosseinlo
- Amin Mohajer
Institutions
- Khazar University (AZ)
- Islamic Azad University of Tabriz (IR)
- University of British Columbia (CA)
- Istinye University (TR)
- Islamic Azad University Ardabil (IR)
Publication Details
- Journal
- Scientific Reports
- Published
- 2026-08-28
- DOI
- https://doi.org/10.1038/s41598-026-68438-1
- Primary Topic
- Software Testing and Debugging Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00