Abstract
Testing is an important way to ensure and improve the quality of software system. However, it is a time-consuming and labor-intensive activity. In the paper, our main concern is software structural testing, and propose a search-based test data generation solution. In our framework, particle swarm optimization (PSO) technique is adopted due to its simplicity and fast convergence speed. For test data generation problem, the inputs of program under test are encoded into particles. Once a set of test inputs is produced, coverage information can be collected by test driver. Meanwhile, the fitness value of branch coverage can be calculated based on such information. Then, the fitness is used for PSO to adjust the search direction. Finally, the test data set with the highest coverage rate is yielded. In addition, eight well-known programs are used for experimental analysis. The results show that PSO-based approach has a distinct advantage compared to the traditional evolutionary algorithms such as generic algorithm and simulated annealing, and also outperforms comprehensive learning-PSO both in covering effect and in evolution speed.
Similar content being viewed by others
References
Cargill, T.: Exception handling: a false sense of security. C++ Rep. 6(9), 423–431 (1994). http://www.awprofessional.com/content/images/020163371x/supplements/ExceptionHandlingArticle.html
Shafer D., Laplante P.A.: The bp oil spill: could software be a culprit? IT Prof. 12(5), 6–9 (2010)
Beizer, B.: Software Testing Techniques, 2nd edn. Van Nostrand Reinhold Co., New York (1990)
Mathur, A.P.: Foundations of Software Testing. Addison-Wesley Professional, USA (2008)
McMinn, P.: Search-based software testing: past, present and future. In: Proceedings of ICSE Workshop on the Search-Based Software Testing (SBST’11), pp. 153–163 (2011)
Harman M.: Software engineering meets evolutionary computation. IEEE Comput. 44(10), 31–39 (2011)
McMinn P.: Search-based software test data generation: a survey. Softw. Test. Verif. Reliab. 14, 105–156 (2004)
Harman M., McMinn P.: A theoretical and empirical study of search-based testing: local, global, and hybrid search. IEEE Trans. Softw. Eng. 36(2), 226–247 (2010)
Kennedy, J.; Eberhart, R.C.: Particle swam optimization. In: Proceedings of IEEE International Conference on Neural Networks (ICNN’95), pp. 1942–1948 (1995)
Shi, Y.; Eberhart, R.C.: A modified particle swarm optimizer. In: Proceedings of the 1998 IEEE International Conference on Evolutionary Computation (ICEC’98), pp. 69–73 (1998)
Mao, C.; Yu, X.; Chen, J.: Swarm intelligence-based test data generation for structural testing. In: Proceedings of the IEEE/ACIS 11th International Conference on Computer and Information Science (ACIS-ICIS’12), pp. 623–628 (2012)
Bertolino A., Mirandola R., Peciola E.: A case study in branch testing automation. J. Syst. Soft. 38(1), 47–59 (1997)
Jones B.F., Sthamer H.H., Eyres D.E.: Automated structural testing using genetic algorithms. Softw. Eng. J. 11(5), 299–306 (1996)
Pargas R.P., Harrold M.J., Peck R.: Automated structural testing using genetic algorithms. Softw. Test. Verif. Reliab. 9(4), 263–282 (1999)
Kirkpatrick, S.; Gelatt, J.C.D.; Vecchi, M.P.: Optimization by simulated annealing. Science 220(4598), 671–680 (1983)
Cohen, M.B.; Colbourn, C.J.; Ling, A.C.H.: Augmenting simulated annealing to build interaction test suites. In: Proceedings of the 14th International Symposium on Software Reliability Engineering (ISSRE’03), pp. 394–405 (2003)
Windisch, A.; Wappler, S.; Wegener, J.: Applying particle swarm optimization to software testing. In: Proceedings of the 9th Annual Conference on Genetic and Evolutionary Computation (GECCO’07), pp. 1121–1128 (2007)
Liang J.J., Qin A.K., Suganthan P.N., Baskar S.: Comprehensive learning particle swarm optimizer for global optimization of multimodal functions. IEEE Trans. Evol. Comput. 10(3), 281–295 (2006)
Chen, X.; Gu, Q.; Qi, J.; Chen, D.: Applying particle swarm optimization to pairwise testing. In: Proceedings of the 34th Annual IEEE Computer Software and Applications Conference (COMPSAC’10), pp. 107–116 (2010)
Ahmed, B.S.; Zamli, K.Z.: A variable strength interaction test suites generation strategy using particle swarm optimization. J. Syst. Softw. 84, 2171–2185 (2011)
Kaur A., Bhatt D.: Hybrid particle swarm optimization for regression testing. Int. J. Comput. Sci. Eng. (IJCSE) 3(5), 1815–1824 (2011)
Hla, K.H.S.; Choi, Y.; Park, J.S.: Applying particle swarm optimization to prioritizing test cases for embedded real time software retesting. In: Proceedings of the 2008 IEEE 8th International Conference on Computer and Information Technology Workshops (CITWorkshops’08), pp. 527–532 (2008)
Maghsoudi M.J., Ibrahim Z., Buyamin S., Rahmat M.F.: Data clustering for the dna computing readout method implemented on lightcycler and based on particle swarm optimization. Arab. J. Sci. Eng. 37(3), 697–707 (2012)
Poli, R.: Analysis of the publications on the applications of particle swarm optimisation. J. Artif. Evol. Appl. 2008, 1–10 (2008)
Tracey, N.; Clark, J.; Mander, K.; McDermid, J.: An automated framework for structural test-data generation. In: Proceedings of the 13th International Conference on Automated Software Engineering (ASE’98), pp. 285–288 (1998)
Korel B.: Automated software test data generation. IEEE Trans. Softw. Eng. 16(8), 870–879 (1990)
Alba E., Chicano F.: Observations in using parallel and sequential evolutionary algorithms for automatic software testing. Comput. Oper. Res. 35, 3161–3183 (2008)
Ferrer J., Chicano F., Alba E.: Evolutionary algorithms for the multi-objective test data generation problem. Softw. Pract. Exp. 42(11), 1331–1362 (2012)
Bouchachia, A.: An immune genetic algorithm for software test data generation. In: Proceedings of the 7th International Conference on Hybrid Intelligent Systems (HIS’07), pp. 84–89 (2007)
Ammann, P.; Offutt, J.: Introduction to Software Testing. Cambridge University Press, Cambridge, UK (2008)
Liang, Y.D.: Introduction to Java Programming, 8th edn. Pearson Education Inc., USA (2011)
Hollander, M.; Wolfe, D.A.: Nonparametric Statistical Methods, 2nd edn. Wiley-Interscience, New York (1999). ISBN 978-0471190455
R Development Core Team. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna (2010)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Mao, C. Generating Test Data for Software Structural Testing Based on Particle Swarm Optimization. Arab J Sci Eng 39, 4593–4607 (2014). https://doi.org/10.1007/s13369-014-1074-y
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s13369-014-1074-y