Skip to main content
Log in

Test data generation method based on multiple convergence direction adaptive PSO

  • Published:
Software Quality Journal Aims and scope Submit manuscript

Abstract

Automated test data generation is a traditional technique for reducing the cost and time of software testing. Various metaheuristic techniques have been successfully applied for this task. In contrast to the typical metaheuristic algorithms applied for branch and path coverage, this study focused on low resource consumption and efficient information coverage for critical path coverage. First, we combined the characteristics of branch coverage and path coverage to determine a critical path based on quantified path scores. As a result, we constructed a fine-grained fitness function based on the uniform scale branch distance. Second, we proposed an adaptive particle swarm optimization (MCD-APSO) algorithm with multiple convergence directions to accelerate convergence and escape from local optima. The proposed MCD-APSO algorithm improved the global search ability by enriching the diversity of the particle swarm and enhancing the current evolutionary information use of the particles. Finally, to validate the performance of the MCD-APSO algorithm, we compared the proposed algorithm with six test-data generation algorithms on six normal-scale and six large-scale benchmark programs. The results showed that the MCD-APSO algorithm outperforms the benchmark programs regarding the mean number of iterations, total running time, and coverage failure probability.

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
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

References

  • Aghdam, Z. K., & Arasteh, B. (2017). An efficient method to generate test data for software structural testing using artificial bee colony optimization algorithm. International Journal of Software Engineering and Knowledge Engineering, 27(06), 951–966.

    Article  Google Scholar 

  • Ahmed, M. A., & Hermadi, I. (2008). GA-based multiple paths test data generator. Computers & Operations Research, 35(10), 3107–3124.

    Article  Google Scholar 

  • Beizer, B. (2003). Software testing techniques. Dreamtech Press.

  • Bidgoli, A. M., & Haghighi, H. (2020). Augmenting ant colony optimization with adaptive random testing to cover prime paths. Journal of Systems and Software, 161, 110495.

    Article  Google Scholar 

  • Dai, X., Gong, W., & Gu, Q. (2021). Automated test case generation based on differential evolution with node branch archive. Computers & Industrial Engineering, 156, 107290.

    Article  Google Scholar 

  • Dalal, S., & Solanki, K. (2018). Performance analysis of BCO-m-GA technique for test case selection. Indian Journal of Science and Technology, 8(1).

  • Ghaemi, A., & Arasteh, B. (2020). SFLA‐based heuristic method to generate software structural test data. Journal of Software: Evolution and Process, 32(1), e2228.

  • Ghiduk, A. S., Harrold, M. J., & Girgis, M. R. (2007) .Using genetic algorithms to aid test-data generation for data-flow coverage. In 14th Asia-Pacific Software Engineering Conference (APSEC'07) (pp. 41–48). IEEE.

  • Grano, G., Titov, T. V., Panichella, S., et al. (2019). Branch coverage prediction in automated testing. Journal of Software: Evolution and Process, 31(9), e2158.

    Google Scholar 

  • Huang, H., Liu, F., Zhuo, X., et al. (2017). Differential evolution based on self-adaptive fitness function for automated test case generation. IEEE Computational Intelligence Magazine, 12(2), 46–55.

    Article  Google Scholar 

  • Huang, H., Liu, F., Yang, Z., et al. (2018). Automated test case generation based on differential evolution with relationship matrix for IFOGSIM toolkit. IEEE Transactions on Industrial Informatics, 14(11), 5005–5016.

    Article  Google Scholar 

  • Kumar, S., Yadav, D. K., & Khan, D. A. (2017). A novel approach to automate test data generation for data flow testing based on hybrid adaptive PSO-GA algorithm. International Journal of Advanced Intelligence Paradigms, 9(2–3), 278–312.

    Article  Google Scholar 

  • Lakshminarayana, P., & SureshKumar, T. V. (2021). Automatic generation and optimization of test case using hybrid cuckoo search and bee colony algorithm. Journal of Intelligent Systems, 30(1), 59–72.

    Article  Google Scholar 

  • Lv, X. W., Huang, S., Hui, Z. W., et al. (2018). Test cases generation for multiple paths based on PSO algorithm with metamorphic relations. IET Software, 12(4), 306–317.

    Article  Google Scholar 

  • Mahajan, M., Kumar, S., & Porwal, R. (2012). Applying genetic algorithm to increase the efficiency of a data flow-based test data generation approach. Acm Sigsoft Software Engineering Notes, 37(5), 1–5.

    Article  Google Scholar 

  • McMinn, P. (2011). Search-based software testing: Past, present and future. In 2011 IEEE Fourth International Conference on Software Testing, Verification and Validation Workshops (pp. 153–163). IEEE.

  • Palak, P., & Gulia, P. (2019). Hybrid swarm and GA based approach for software test case selection. International Journal of Electrical and Computer Engineering, 9(6), 4898.

    Google Scholar 

  • Sahoo, R. R., & Ray, M. (2018). Metaheuristic techniques for test case generation: A review. Journal of Information Technology Research.

  • Sahoo, R. R., & Ray, M. (2020). PSO based test case generation for critical path using improved combined fitness function. Journal of King Saud University-Computer and Information Sciences, 32(4), 479–490.

    Article  Google Scholar 

  • Sahoo, R. K., Mohapatra, D. P., & Patra, M. R. (2017a). Model driven approach for test data optimization using activity diagram based on cuckoo search algorithm. International Journal of Information Technology and Computer Science, 9(10), 77–84.

    Article  Google Scholar 

  • Sahoo, R. K., Nanda, S. K., Mohapatra, D. P., et al. (2017b). Model driven test case optimization of UML combinational diagrams using hybrid bee colony algorithm. International Journal of Intelligent Systems and Applications, 11(6), 43.

    Article  Google Scholar 

  • Salahirad, A., Almulla, H., & Gay, G. (2019). Choosing the fitness function for the job: Automated generation of test suites that detect real faults. Software Testing, Verification and Reliability, 29(4–5), e1701.

    Google Scholar 

  • Sharifipour, H., Shakeri, M., & Haghighi, H. (2018). Structural test data generation using a memetic ant colony optimization based on evolution strategies. Swarm and Evolutionary Computation, 40, 76–91.

    Article  Google Scholar 

  • Shi, J. J., Jiang, S. J., Han, H., et al. (2013). Adaptive particle swarm optimization algorithm and its application in test data generation. Acta Electronica Sinica, 41(8), 1555–1559.

    Google Scholar 

  • Tao, X. M., Liu, F. R., Liu, Y., et al. (2012). Multi-scale cooperative mutation particle swarm optimization algorithm. Ruanjian Xuebao/Journal of Software, 23(7), 1805–1815.

    MATH  Google Scholar 

  • Varshney, S., & Mehrotra, M. (2013). Search based software test data generation for structural testing: A perspective. ACM SIGSOFT Software Engineering Notes, 38(4), 1–6.

    Article  Google Scholar 

  • Zhu, X. M., & Yang, X. F. (2010). Software test data generation automatically based on improved adaptive particle swarm optimizer. In International Conference on Computational and Information Sciences (pp. 1300–1303). IEEE.

Download references

Acknowledgements

We thank the National Natural Science Foundation of China under Grant No. 61867004 and the Jiangxi Provincial Department of Science and Technology under Grant No. 20202BBEL53002 for their generous support of this work. In addition, we would like to thank the English editors of Editage (www.editage.cn) for English language editing.

Funding

This work was supported by the National Natural Science Foundation of China under Grant No. 61867004.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yong-jian Fan.

Ethics declarations

Competing interests

The authors declare no competing interests.

Additional information

Publisher's Note

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

This manuscript has not been published or presented elsewhere in part or in entirety and is not under consideration by another journal. We have read and understood your journal’s policies, and we believe that neither the manuscript nor the study violates any of these.

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

Yang, Fy., Fan, Yj., Xiao, P. et al. Test data generation method based on multiple convergence direction adaptive PSO. Software Qual J 31, 279–303 (2023). https://doi.org/10.1007/s11219-022-09605-1

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11219-022-09605-1

Keywords

Navigation