Skip to main content
Log in

Effective test-data generation using the modified black widow optimization algorithm

  • Original Paper
  • Published:
Signal, Image and Video Processing Aims and scope Submit manuscript

Abstract

Software testing is one of the software development activities and is used to identify and remove software bugs. Most small-sized projects may be manually tested to find and fix any bugs. In large and real-world software products, manual testing is thought to be a time and money-consuming process. Finding a minimal subset of input data in the shortest amount of time (as test data) to obtain the maximal branch coverage is an NP-complete problem in the field. Different heuristic-based methods have been used to generate test data. In this paper, for addressing and solving the test data generation problem, the black widow optimization algorithm has been used. The branch coverage criterion was used as the fitness function to optimize the generated data. The obtained experimental results on the standard benchmarks show that the proposed method generates more effective test data than the simulated annealing, genetic algorithm, ant colony optimization, particle swarm optimization, and artificial bee colony algorithms. According to the results, with 99.98% average coverage, 99.96% success rate, and 9.36 required iteration, the method was able to outperform the other methods.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Algorithm 1.
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

Data availability

The data relating to the current study is available via the following link: https://drive.google.com/drive/folders/1vfB0XnplA7t771tFUz4aap_kc8j-bek1?usp=sharing.

References

  1. Arasteh, B., Miremadi, S.G., Rahmani, A.M.: Developing inherently resilient software against soft-errors based on algorithm level inherent features. J. Electron. Test. 30, 193–212 (2014)

    Article  Google Scholar 

  2. Arasteh, B., Pirahesh, S., Zakeri, A., Arasteh, B.: Highly available and dependable e-learning services using grid system. Procedia Soc. Behav. Sci. 143, 471–476 (2014). https://doi.org/10.1016/j.sbspro.2014.07.519

    Article  Google Scholar 

  3. Keshtgar, S.A., Arasteh, B.B.: Enhancing software reliability against soft-error using minimum redundancy on critical data. Int. J. Comput. Netw. Inf. Secur. 9(5), 21 (2017)

    Google Scholar 

  4. Pan, R., Bagherzadeh, M., Ghaleb, T.A., et al.: Test case selection and prioritization using machine learning: a systematic literature review. Empir. Softw. Eng. 27, 29 (2022). https://doi.org/10.1007/s10664-021-10066-6

    Article  Google Scholar 

  5. Khanna, M., Chaudhary, A., Toofani, A., et al.: Performance comparison of multi-objective algorithms for test case prioritization during web application testing. Arab. J. Sci. Eng. 44, 9599–9625 (2019). https://doi.org/10.1007/s13369-019-03817-7

    Article  Google Scholar 

  6. Khanna, M., Chauhan, N., Sharma, D.K., Toofani, A.: Test case prioritisation during web application testing. Int. J. Comput. Appl. Technol. 56(3), 230–243 (2017). https://doi.org/10.1504/IJCAT.2017.088200

    Article  Google Scholar 

  7. Pradhan, S., Ray, M., Swain, S.K.: Transition coverage based test case generation from state chart diagram. J. King Saud Univ. Comput. Inf. Sci. 34(3), 993–1002 (2022). https://doi.org/10.1016/j.jksuci.2019.05.005

    Article  Google Scholar 

  8. Khatun, S., Rabbi, K., Yaakub, C., Klaib, M. J.: A Random search based effective algorithm for pairwise test data generation. In: International Conference on Electrical, Control and Computer Engineering 2011 (InECCE) (2011)

  9. Eler, M.M., Endo, A.T., Durelli, V.H.: An empirical study to quantify the characteristics of Java programs that may influence symbolic execution from a unit testing perspective. J. Syst. Softw. 121, 281–297 (2016)

    Article  Google Scholar 

  10. Cohen, M. B., Colbourn, C. J., Ling, A. C.: Augmenting simulated annealing to build interaction test suites. In: 14th International Symposium on Software Reliability Engineering, 2003. ISSRE (2003)

  11. Lin, J.-C., Yeh, P.-L.: Automatic test data generation for path testing using GAs. Inf. Sci. 131(1–4), 47–64 (2001)

    Article  Google Scholar 

  12. Esnaashari, M., Damia, A.H.: Automation of software test data generation using genetic algorithm and reinforcement learning. Expert Syst. Appl. 183, 115446 (2021)

    Article  Google Scholar 

  13. Mao, C.: Generating test data for software structural testing based on particle swarm optimization. Arab. J. Sci. Eng. 39, 4593–4607 (2014)

    Article  Google Scholar 

  14. Mao, C., Xiao, L., Yu, X., Chen, J.: Adapting ant colony optimization to generate test data for software structural testing. Swarm Evol. Comput. 20, 23–36 (2015)

    Article  Google Scholar 

  15. Aghdam, Z.K., Arasteh, B.: An efficient method to generate test data for software structural testing using artificial bee colony optimization algorithm. Int. J. Softw. Eng. Knowl. Eng. 27(06), 951–966 (2017)

    Article  Google Scholar 

  16. Ghaemi, A., Arasteh, B.: SFLA-based heuristic method to generate software structural test data. J. Softw. Evol. Process 32(1), e2228 (2020)

    Article  Google Scholar 

  17. Hayyolalam V., Kazem A.: Black Widow Optimization Algorithm: a novel meta-heuristic approach for solving engineering optimization problems. Eng. Appl. Artif. Intell. 87 (2020)

  18. Khanna, M., Chauhan, N., Sharma, D.K.: Search for prioritized test cases during web application testing. Int. J. Appl. Metaheuristic Comput. (2019). https://doi.org/10.4018/IJAMC.2019040101

    Article  Google Scholar 

  19. Arasteh, B., Fatolahzadeh, A., Kiani, F.: Savalan: multi objective and homogeneous method for software modules clustering. J. Softw. Evol. Process 34(1), e2408 (2022)

    Article  Google Scholar 

  20. Arasteh, B., Sadegi, R., Arasteh, K.: Araz: a software modules clustering method using the combination of particle swarm optimization and genetic algorithms. Intell. Decis. Technol. 14(4), 449–462 (2020)

    Google Scholar 

  21. Arasteh, B.: Software fault-prediction using combination of neural network and naive bayes algorithm. J. Netw. Technol. 9(3), 94–101 (2018)

    Article  Google Scholar 

  22. Arasteh, B., Sadegi, R., Arasteh, K.: Bölen: software module clustering method using the combination of shuffled frog leaping and genetic algorithm. Data Technol. Appl. 55(2), 251–279 (2021)

    Google Scholar 

  23. Bouyer, A., Beni, H.A., Arasteh, B., Aghaee, Z., Ghanbarzadeh, R.: FIP: a fast overlapping community-based influence maximization algorithm using probability coefficient of global diffusion in social networks. Expert Syst. Appl. 213, 118869 (2023). https://doi.org/10.1016/j.eswa.2022.118869

    Article  Google Scholar 

  24. Arasteh, B.: Clustered design-model generation from a program source code using chaos-based metaheuristic algorithms. Neural Comput. Appl. 35, 3283–3305 (2023)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Contributions

The proposed method was developed and discretized by B. Arasteh and M. Khadir. The designed algorithm was implemented and coded by B. Arasteh, M. Khadir and A. Ghaffari The implemented method code was adapted and benchmarked by B. Arasteh and M. Khadir. The data and results analysis were performed by B. Arasteh and A. Ghaffari. The manuscript of the paper was written by B. Arasteh and Mahsa Torkamanian-Afshar and S. Pirahesh.

Corresponding author

Correspondence to Bahman Arasteh.

Ethics declarations

Conflict of interest

The authors declare that no funds, grants, or other support were received during the preparation of this manuscript. The authors have no relevant financial or non-financial conflict of interest.

Ethical and informed consent for data used

The data used in this research does not belong to any other person or third party and was prepared and generated by the researchers themselves during the research. The data of this research will be accessible to other researchers.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Arasteh, B., Ghaffari, A., Khadir, M. et al. Effective test-data generation using the modified black widow optimization algorithm. SIViP (2024). https://doi.org/10.1007/s11760-024-03236-8

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11760-024-03236-8

Keywords

Navigation