Skip to main content
Log in

Path test data generation using adaptive simulated annealing particle swarm optimization

  • Optimization
  • Published:
Soft Computing Aims and scope Submit manuscript

Abstract

Software testing is an effective means of ensuring software quality. The cost of software testing is the main component of the total cost of software development. The generation of test data is very important in testing, because the efficiency of testing depends on the test data used. A significant part of software testing automation is the test data generation. How to automatically generate test datasets is still an open problem. Search-based software testing (SBST) is a process of generating test data that employs meta-heuristic methods to resolve tough NP-hard problems. The test data generation problem belongs to NP-hard problems. This paper focuses on the automatic generation of test data for path coverage based on control flow criteria in structural testing. Some meta-heuristic algorithms have been used to search for software test data. To advance the efficiency and effectiveness of path test data generation, an adaptive simulated annealing particle swarm optimization (ASAPSO) algorithm is proposed. The probabilistic jumping property of simulated annealing (SA) algorithm is introduced into the particle swarm optimization (PSO) algorithm to make the particle accept bad solution at a certain probability during the searching process, and therefore boost the capacity of the proposed algorithm to bounce from the local optimum. The fitness function is constructed by the branch function superposition to properly guide the search process. In addition, to improve the convergence speed of the algorithm, an adaptive adjustment scheme based on inertial weight and an adjustment scheme based on learning factor are proposed as well. The experimental results show that the proposed method can effectually avoid premature convergence and effectively upgrades the efficiency of generating test data automatically. It is also competitive in solving other complicated optimization problems.

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

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10

Similar content being viewed by others

Explore related subjects

Discover the latest articles, news and stories from top researchers in related subjects.

Data availability

The data used to support the findings of this study are available from the corresponding author upon request.

References

  • Abdel-Basset M, Ding W, El-Shahat D (2021) A hybrid Harris Hawks optimization algorithm with simulated annealing for feature selection. Artif Intell Rev 54:593–637

    Google Scholar 

  • Ahmed MA, Hermadi I (2008) GA-based multiple paths test data generator. Comput Oper Res 35(10):3107–3124

    Google Scholar 

  • Alnowibet KA, Mahdi S, El-Alem M, Abdelawwad M, Mohamed AW (2022) Guided hybrid modified simulated annealing algorithm for solving constrained global optimization problems. Mathematics 10(8):1312

    Google Scholar 

  • Bashath S and Ismail A R (2019) Improved particle swarm optimization by fast simulated annealing algorithm. In: 2019 International Conference of Artificial Intelligence and Information Technology (ICAIIT) 2019, pp 297–301

  • Beizer B (1990) Software testing techniques. Van Nostrand Reinhold, New York

    Google Scholar 

  • Bi J, Yuan H, Duanmu S, Zhou M, Abusorrah A (2021) Energy-optimized partial computation offloading in mobile-edge computing with genetic simulated-annealing-based particle swarm optimization. IEEE Internet Things J 8(5):3774–3785

    Google Scholar 

  • Chi R, Su Y, Zhang D, Chi X, Zhang H (2019) A hybridization of cuckoo search and particle swarm optimization for solving optimization problems. Neural Comput Appl 31:653–670

    Google Scholar 

  • Cui Z, Zhang J, Wu D et al (2020) Hybrid many-objective particle swarm optimization algorithm for green coal production problem. Inf Sci 518:256–271

    MathSciNet  Google Scholar 

  • Eberhart RC, Kennedy J (1995) A new optimizer using particle swarm theory. In: Proceedings of the Sixth International Symposium on Micro Machine and Human Science 1995: 39–43

  • Govindan K, Diabat A, Shankar KM (2015) Analyzing the drivers of green manufacturing with fuzzy approach. J Clean Prod 96:182–193

    Google Scholar 

  • Han X, Lei H, Wang Y (2017) Multiple paths test data generation based on particle swarm optimisation. IET Softw 11(2):41–47

    Google Scholar 

  • Hanh LTM, Tung KT, Binh NT (2014) Mutation-based test data generation for simulink models using genetic algorithm and simulated annealing. Int J Comput Inform Technol 3(04):763–771

    Google Scholar 

  • Haznedar B, Kalinli A (2018) Training ANFIS structure using simulated annealing algorithm for dynamic systems identification. Neurocomputing 302:66–74

    Google Scholar 

  • Heppner F, Grenander U (1990) A stochastic nonlinear model for coordinated bird flocks. Ubiquity Chaos 1990:233–238

    Google Scholar 

  • Iwata S, Fukuyama Y (2018) Differential evolutionary particle swarm optimization for load adjustment distribution state estimation using correntropy. Electr Eng Japan 205(3):11–21

    Google Scholar 

  • Jamil MA, Arif M, Abubakar NSA, Ahmad A (2016) Software testing techniques: a literature review. 2016 6th International Conference on Information and Communication Technology for The Muslim World (ICT4M) 2016, pp 177–182

  • Jatana N, Suri B (2020a) Particle swarm and genetic algorithm applied to mutation testing for test data generation: a comparative evaluation. J King Saud Univ Comput Inform Sci 32(4):514–521

    Google Scholar 

  • Jatana N, Suri B (2020b) An improved crow search algorithm for test data generation using search-based mutation testing. Neural Process Lett 52:767–784

    Google Scholar 

  • Jiang S, Yi D, Ju X, Wang L, Liu Y (2014) An approach for test data generation using program slicing and particle swarm optimization. Neural Comput Appl 25:2047–2055

    Google Scholar 

  • Jiang S, Shi J, Zhang Y, Han H (2015) Automatic test data generation based on reduced adaptive particle swarm optimization algorithm. Neurocomputing 158:109–116

    Google Scholar 

  • Jung J, Jayakrishnan R, Park JY (2016) Dynamic shared-taxi dispatch algorithm with hybrid-simulated annealing. Comput-Aided Civ Infrastr Eng 31(4):275–291

    Google Scholar 

  • Kennedy J, Eberhart RC (1995) Particle swarm optimization. In: Proceedings of the IEEE International Conference on neural networks 4(8):1942-1948

  • Khari M, Kumar P (2019) An extensive evaluation of search-based software testing: a review. Soft Comput 23:1933–1946

    Google Scholar 

  • Khari M, Sinha A, Verdu E, Crespo RG (2020) Performance analysis of six meta-heuristic algorithms over automated test suite generation for path coverage-based optimization. Soft Comput 24(12):9143–9160

    Google Scholar 

  • KirkPatrick S, Gelatt CD, Vecchi MP (1983) Optimization by simulated annealing. Science 220(4598):671–680

    MathSciNet  Google Scholar 

  • Koleejan C, Xue B, Zhang M (2015) Code coverage optimisation in genetic algorithms and particle swarm optimisation for automatic software test data generation. In: 2015 IEEE Congress on Evolutionary Computation (CEC) 2015, pp 1204–1211

  • Koohathongsumrit N, Chankham W (2023) Route selection in multimodal supply chains: A fuzzy risk assessment model-BWM-MARCOS framework. Appl Soft Comput 137:110167

    Google Scholar 

  • Korel B (1992) Dynamic method for software test data generation. Softw Test Verif Reliab 2(4):203–213

    Google Scholar 

  • Kuznetsov A, Karpinski M, Ziubina R, Kandiy S, Frontoni E, Peliukh O, Veselska O, Kozak R (2023) Generation of nonlinear substitutions by simulated annealing algorithm. Information 14(5):259

    Google Scholar 

  • Laskar NM, Guha K, Chatterjee I, Chanda S, Baishnab KL, Paul PK (2019) HWPSO: A new hybrid whale-particle swarm optimization algorithm and its application in electronic design optimization problems. Appl Intell 49:265–291

    Google Scholar 

  • Latha T S, Rekha K B, Ferede A W (2023) Lightweight APIT with bat optimization with simulated annealing localization for resource-constrained sensor networks. Wirel Commun Mob Comput

  • Leite N, Melício F, Rosa AC (2019) A fast simulated annealing algorithm for the examination timetabling problem. Expert Syst Appl 122:137–151

    Google Scholar 

  • Lu J, Zhang Z (2021) An improved simulated annealing particle swarm optimization algorithm for path planning of mobile robots using mutation particles. Wirel Commun Mob Comput 2021:1–12

    Google Scholar 

  • Lv XW, Huang S, Hui ZW, Ji HJ (2018) Test cases generation for multiple paths based on PSO algorithm with metamorphic relations. IET Softw 12(4):306–317

    Google Scholar 

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

    Google Scholar 

  • Maragathavalli P (2011) Search-based software test data generation using evolutionary computation. Int J Comput Sci Inform Technol 3(1):213–223

    Google Scholar 

  • McMinn P (2004) Search-based software test data generation: a survey. Softw Test Verif Reliab 14(2):105–156

    Google Scholar 

  • Metropolis N, Rosenbluth AW, Rosenbluth MN, Teller AH, Teller E (1953) Equation of state calculations by fast computing machines. J Chem Phys 21(6):1087–1092

    Google Scholar 

  • Michiels W, Aarts E, Korst J (2007) Theoretical aspect of local search. Berlin, Germany

  • Mirsadeghi E, Khodayifar S (2021) Hybridizing particle swarm optimization with simulated annealing and differential evolution. Clust Comput 24:1135–1163

    Google Scholar 

  • Molaei S, Moazen H, Najjar-Ghabel S, Farzinvash L (2021) Particle swarm optimization with an enhanced learning strategy and crossover operator. Knowl-Based Syst 215:106768. https://doi.org/10.1016/j.knosys.2021.106768

    Article  Google Scholar 

  • Moradi N, Kayvanfar V, Rafiee M (2022) An efficient population-based simulated annealing algorithm for 0–1 knapsack problem. Eng Comput 38(3):2771–2790

    Google Scholar 

  • Nickabadi A, Ebadzadeh MM, Safabakhsh R (2011) A novel particle swarm optimization algorithm with adaptive inertia weight. Appl Soft Comput 11(4):3658–3670

    Google Scholar 

  • Pan X, Xue L, Lu Y, Sun N et al (2019) Hybrid particle swarm optimization with simulated annealing. Multimed Tools Appl 78:29921–29936

    Google Scholar 

  • Sahin O, Akay B (2016) Comparisons of meta-heuristic algorithms and fitness functions on software test data generation. Appl Soft Comput 49:1202–1214

    Google Scholar 

  • Sahoo RR, Ray M (2020) PSO-based test case generation for critical path using improved combined fitness function. J King Saud Univ Comput Inform Sci 32(4):479–490

    Google Scholar 

  • Shi Y, Eberhart RC (1999) Empirical study of particle swarm optimization. In: Proceedings of the 1999 Congress on evolutionary computation 3:1945–1950

  • Soares S, Antunes CH, Araújo R (2013) Comparison of a genetic algorithm and simulated annealing for automatic neural network ensemble development. Neurocomputing 121:498–511

    Google Scholar 

  • Su G, Wang P, Guo Y, Cheng G, Wang S, Zhao D (2022) Multiparameter identification of permanent magnet synchronous motor based on model reference adaptive system-Simulated annealing particle swarm optimization algorithm. Electronics 11(1):159

    Google Scholar 

  • Tracey N, Clark J, Mander K, McDermid J (1998) An automated framework for structural test-data generation. In: Proceeding of the 13th IEEE International Conference on automated software engineering 1998: 285–288

  • Vincent FY, Redi AANP, Hidayat YA, Wibowo OJ (2017) A simulated annealing heuristic for the hybrid vehicle routing problem. Appl Soft Comput 53:119–132

    Google Scholar 

  • Wang Z, Liu Q (2018) A software test case automatic generation technology based on the modified particle swarm optimization algorithm. In: International Conference on Virtual Reality and Intelligent Systems (ICVRIS) 2018, pp 156–159

  • Wang S, Li Y, Yang H (2019) Self-adaptive mutation differential evolution algorithm based on particle swarm optimization. Appl Soft Comput 81:105496

    Google Scholar 

  • Wang K, Li X, Gao L, Li P, Gupta SM (2021) A genetic simulated annealing algorithm for parallel partial disassembly line balancing problem. Appl Soft Comput 107:107404

    Google Scholar 

  • Xu R, Zhao C, Li J, Hu J, Hou X (2023) A hybrid improved-whale-optimization-simulated-annealing algorithm for trajectory planning of quadruped robots. Electronics 12(7):1564

    Google Scholar 

  • Yang S, Wang H, Xu Y, Guo Y, Pan L, Zhang J, Guo X, Meng D, Wang J (2023a) A coupled simulated annealing and particle swarm optimization reliability-based design optimization strategy under hybrid uncertainties. Mathematics 11(23):4790

    Google Scholar 

  • Yang F, Fan Y, Xiao P, Du Q (2023b) Test data generation method based on multiple convergence direction adaptive PSO. Software Qual J 31(1):279–303

    Google Scholar 

  • Yoshida H, Fukuyama Y (2018) Parallel multi-population differential evolutionary particle swarm optimization for voltage and reactive power control. Electr Eng Japan 204(3):31–40

    Google Scholar 

  • Zhang W, Maleki A, Rosen MA, Liu J (2018) Optimization with a simulated annealing algorithm of a hybrid system for renewable energy including battery and hydrogen storage. Energy 163:191–207

    Google Scholar 

  • Zhou BH, Liao XM, Wang K (2019) Kalman filter and multi-stage learning-based hybrid differential evolution algorithm with particle swarm for a two-stage flow shops scheduling problem. Soft Comput 23(24):13067–13083

    Google Scholar 

  • Zhou L, Wang M, Zhang X, Qin P, He B (2023) Adaptive SLAM methodology based on simulated annealing particle swarm optimization for AUV Navigation. Electronics 12(11):2372

    Google Scholar 

Download references

Acknowledgements

This work was supported by the National Natural Science Foundation of China (61572444).

Funding

The authors have not disclosed any funding.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Chongyang Jiao.

Ethics declarations

Conflicts of interest

The authors declare that there is no conflict of interest regarding the publication of this paper.

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

Jiao, C., Zhou, Q. Path test data generation using adaptive simulated annealing particle swarm optimization. Soft Comput 28, 9587–9607 (2024). https://doi.org/10.1007/s00500-024-09803-y

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00500-024-09803-y

Keywords