Skip to main content
Log in

Generating Test Data for Software Structural Testing Based on Particle Swarm Optimization

  • Research Article - Computer Engineering and Computer Science
  • Published:
Arabian Journal for Science and Engineering Aims and scope Submit manuscript

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.

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.

Similar content being viewed by others

References

  1. 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

  2. Shafer D., Laplante P.A.: The bp oil spill: could software be a culprit? IT Prof. 12(5), 6–9 (2010)

    Google Scholar 

  3. Beizer, B.: Software Testing Techniques, 2nd edn. Van Nostrand Reinhold Co., New York (1990)

  4. Mathur, A.P.: Foundations of Software Testing. Addison-Wesley Professional, USA (2008)

  5. 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)

  6. Harman M.: Software engineering meets evolutionary computation. IEEE Comput. 44(10), 31–39 (2011)

    Article  Google Scholar 

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

    Article  Google Scholar 

  8. 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)

    Article  Google Scholar 

  9. Kennedy, J.; Eberhart, R.C.: Particle swam optimization. In: Proceedings of IEEE International Conference on Neural Networks (ICNN’95), pp. 1942–1948 (1995)

  10. 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)

  11. 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)

  12. Bertolino A., Mirandola R., Peciola E.: A case study in branch testing automation. J. Syst. Soft. 38(1), 47–59 (1997)

    Article  Google Scholar 

  13. Jones B.F., Sthamer H.H., Eyres D.E.: Automated structural testing using genetic algorithms. Softw. Eng. J. 11(5), 299–306 (1996)

    Article  Google Scholar 

  14. Pargas R.P., Harrold M.J., Peck R.: Automated structural testing using genetic algorithms. Softw. Test. Verif. Reliab. 9(4), 263–282 (1999)

    Article  Google Scholar 

  15. Kirkpatrick, S.; Gelatt, J.C.D.; Vecchi, M.P.: Optimization by simulated annealing. Science 220(4598), 671–680 (1983)

    Google Scholar 

  16. 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)

  17. 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)

  18. 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)

    Article  Google Scholar 

  19. 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)

  20. 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)

    Google Scholar 

  21. Kaur A., Bhatt D.: Hybrid particle swarm optimization for regression testing. Int. J. Comput. Sci. Eng. (IJCSE) 3(5), 1815–1824 (2011)

    Google Scholar 

  22. 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)

  23. 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)

    Article  Google Scholar 

  24. Poli, R.: Analysis of the publications on the applications of particle swarm optimisation. J. Artif. Evol. Appl. 2008, 1–10 (2008)

  25. 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)

  26. Korel B.: Automated software test data generation. IEEE Trans. Softw. Eng. 16(8), 870–879 (1990)

    Article  Google Scholar 

  27. Alba E., Chicano F.: Observations in using parallel and sequential evolutionary algorithms for automatic software testing. Comput. Oper. Res. 35, 3161–3183 (2008)

    Article  MATH  Google Scholar 

  28. Ferrer J., Chicano F., Alba E.: Evolutionary algorithms for the multi-objective test data generation problem. Softw. Pract. Exp. 42(11), 1331–1362 (2012)

    Article  Google Scholar 

  29. 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)

  30. Ammann, P.; Offutt, J.: Introduction to Software Testing. Cambridge University Press, Cambridge, UK (2008)

  31. Liang, Y.D.: Introduction to Java Programming, 8th edn. Pearson Education Inc., USA (2011)

  32. Hollander, M.; Wolfe, D.A.: Nonparametric Statistical Methods, 2nd edn. Wiley-Interscience, New York (1999). ISBN 978-0471190455

  33. R Development Core Team. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna (2010)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Chengying Mao.

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s13369-014-1074-y

Keywords

Navigation