Abstract
Heuristic search-based test data generation has a potential higher efficiency in software testing with path covering. However, these approaches are suffered in covering the long and complex path. In this paper, we propose a method for generating test data based on program slicing and particle swarm optimization. With the interest points selected from a target path, we perform a program slicing to remove the statements which are irrelevant to the interest points. Our method simplifies the target path and the actual path to get a better fitness value. After program slices obtained, the population is evolved using particle swarm optimization to improve the efficiency of test data generation.
Similar content being viewed by others
References
Xie XY, Xu BW, Nie CH (2009) Genetic test case generation for path-oriented testing. Softw J 20(12):3117–3136
Pargas RP, Harrold MJ, Peck RR (1999) Test-data generation using genetic algorithms. Softw Test Verif Reliab 9(4):263–282
Ahmed MA, Hermadi I (2008) GA-based multiple paths test data generator. Comput Oper Res 35(10):3107–3124
Pargas R, Harrold M, Peck R (1999) Test-data generation using genetic algorithms. J Softw Test 9(4):263–282
Windisch A, Wappler S, Wegener J (2007) Apply particle swarm optimization to software testing. In: Proceedings of the 9th annual conference on genetic and evolution computation. ACM, New York, pp 1121–1128
Chhabra JK, Kumar S, Dahiya SS (2010) Automated test data generation using swarm intelligence approaches. Inst Eng Electron Telecommun Eng J 90:3–12
Chen X, Gu Q, Wang ZY, Chen DX (2011) Framework of particle swarm optimization based pairwise testing. J Softw 22(12):2879–2893
Kennedy J, Eberhart R (1995) Particle swarm optimization. In: Proceedings of the 1st conference on neural networks, pp 1942–1948
Bouktif S, Sahraoui H, Antoniol G (2006) Simulated annealing for improving software quality prediction. In: Proceedings of the 8th annual conference on genetic and evolutionary computation. ACM, New York, pp 1893–1900
Arcuri A, White DR, Clark J, Yao X (2008) Multi-objective improvement of software using co-evolution and smart seeding. In: Proceedings of the 7th international conference on simulated evolution and learning. Springer, Berlin, pp 61–70
Ayari K, Bouktif S, Antoniol G (2007) Automatic mutation test input data generation via ant colony. In: Proceedings of the 9th annual conference on genetic and evolutionary computation. ACM, New York, pp 1074–1081
Singh Y, Kaur A, Suri B (2010) Test case prioritization using ant colony optimization. Assoc Comput Mach ACM SIGSOFT Softw Eng Note 35:1–7
Glover F (1989) Tabu search-Part I. ORSA J Comput 1:190–206
Weiser M (1981) Program slicing. In: Proceedings of the 5th international conference on software engineering. IEEE, pp 439–449
Yi DD, Jiang SJ, Zhang YM (2012) Fitness function design approach for test data generation of multiple path coverage. Comput Eng Appl 48(22):79–83
Tiwari S, Mishra KK, Misra AK (2013) Test case generation for modified code using a variant of particle swarm optimization (PSO) algorithm. In: Proceedings of the tenth international conference on information technology: new generations (ITNG), IEEE, pp 363–368
Nie P (2012) A PSO test case generation algorithm with enhanced exploration ability. J Comput Inf Syst 8(14):5785–5793
Wang S, Wu H (2013) A novel algorithm for multi-path test data generation. In: Proceedings of the 4th international conference on digital manufacturing and automation (ICDMA), IEEE, pp 58–60
Shi JJ, Jiang SJ, Han H, Wang LS (2013) Adaptive particle swarm optimization algorithm and its application in test data generation. Chin J Electron 41(8):1555–1559
Khan SA, Nadeem A (2014) Automated test data generation for coupling based integration testing of object oriented programs using particle swarm optimization (PSO). Genetic and evolutionary computing. Springer International Publishing, New York, pp 115–124
Souza LSD, Prudêncio RBC, Barros FA et al (2013) Search based constrained test case selection using execution effort. Expert Syst Appl 40(12):4887–4896
Jiang SJ, Li W, Li HY, Zhang YM, Zhang HC, Liu YQ (2012) Fault localization for null pointer exception based on stack trace and program slicing. In: Proceedings of the 12th international conference on quality software. IEEE, pp 9–12
Liu YQ, Li W, Jiang SJ, Zhang YM, Ju XL (2013) An approach for fault localization based on program slicing and Bayesian. In: Proceedings of the 13th international conference on quality software. IEEE, pp 326–332
McMinn P, Harman M, Lakhotia K, Hassoun Y, Wegener J (2012) Input domain reduction through irrelevant variable removal and its effect on local, global, and hybrid search-based structural test data generation. IEEE Trans Softw Eng 38(2):453–477
Acknowledgments
This work is supported in part by the NSFC Project under Grant Nos. 60970032, 61202006, and 61340037, the “QingLan” Project and “333” Project of Jiangsu Province, the Fundamental Research Funds for the Central Universities under Grant No. 2013NB17, the University Natural Science Research Project of Jiangsu Province under Grant No. 12KJB520014, and the Graduate Training Innovative Projects Foundation of Jiangsu Province under Grant No. CXZZ12_0935.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Jiang, S., Yi, D., Ju, X. et al. An approach for test data generation using program slicing and particle swarm optimization. Neural Comput & Applic 25, 2047–2055 (2014). https://doi.org/10.1007/s00521-014-1692-z
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00521-014-1692-z