Using Swarm Intelligence to Generate Test Data for Covering Prime Paths

  • Atieh Monemi Bidgoli
  • Hassan HaghighiEmail author
  • Tahere Zohdi Nasab
  • Hamideh Sabouri
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10522)


Search-based test data generation methods mostly consider the branch coverage criterion. To the best of our knowledge, only two works exist which propose a fitness function that can support the prime path coverage criterion, while this criterion subsumes the branch coverage criterion. These works are based on the Genetic Algorithm (GA) while scalability of the evolutionary algorithms like GA is questionable. Since there is a general agreement that evolutionary algorithms are inferior to swarm intelligence algorithms, we propose a new approach based on swarm intelligence for covering prime paths. We utilize two prominent swarm intelligence algorithms, i.e., ACO and PSO, along with a new normalized fitness function to provide a better approach for covering prime paths. To make ACO applicable for the test data generation problem, we provide a customization of this algorithm. The experimental results show that PSO and the proposed customization of ACO are both more efficient and more effective than GA when generating test data to cover prime paths. Also, the customized ACO, in comparison to PSO, has better effectiveness while has a worse efficiency.


Search based test data generation Prime paths Swarm intelligence algorithms Ant colony optimization Particle swarm optimization 


  1. 1.
    McMinn, P.: Search-based software test data generation: a survey. Softw. Testing Verification Reliab. 14(2), 105–156 (2004)CrossRefGoogle Scholar
  2. 2.
    Ali, Sh, Briand, L.C., Hemmati, H., Panesar-Walawege, R.K.: A systematic review of the application and empirical investigation of search-based test case generation. IEEE Trans. Softw. Eng. 36(6), 742–762 (2010)CrossRefGoogle Scholar
  3. 3.
    Kennedy, J., Eberhart, R.: Particle swarm optimization. In: Proceeding of IEEE International Conference Neural Networks, vol. 4, pp. 1942–1948 (1995)Google Scholar
  4. 4.
    Ammann, P., Offutt, J.: Introduction to Software Testing. Cambridge University Press, New York (2008)CrossRefGoogle Scholar
  5. 5.
    Watkins, A., Hufnagel, E.M.: Evolutionary test data generation: a comparison of fitness functions. Softw. Pract. Exp. 36(1), 95–116 (2006)CrossRefGoogle Scholar
  6. 6.
    King, J.C.: A new approach to program testing. ACM SIGPLAN Not. 10(6), 228–233 (1975)CrossRefGoogle Scholar
  7. 7.
    Baresel, A., Harmen, S., Michael, S.: Fitness function design to improve evolutionary structural testing. In: GECCO 2002, vol. 2, pp. 1329–1336 (2002)Google Scholar
  8. 8.
    Lin, J.C., Yeh, P.L.: Automatic test data generation for path testing using GAs. Inf. Sci. 131(1), 47–64 (2001)CrossRefzbMATHGoogle Scholar
  9. 9.
    Dorigo, M., Maniezzo, V., Colorni, A.: Ant system: optimization by a colony of cooperating agents. IEEE Trans. Syst. Man Cybern. Part B (Cybern.) 26(1), 29–41 (1996)CrossRefGoogle Scholar
  10. 10.
    Floreano, D., Mattiussi, C.: Bio-Inspired Artificial Intelligence: Theories, Methods, and Technologies. MIT press, Cambridge (2008)Google Scholar
  11. 11.
  12. 12.
  13. 13.
    Thierens, D.: Scalability problems of simple genetic algorithms. Evol. Comput. 7(4), 331–352 (1999)CrossRefGoogle Scholar
  14. 14.
    Feldt, R., Poulding, S.: Broadening the search in search-based software testing: It need not be evolutionary. In: Proceedings of the Eighth International Workshop on Search-Based Software Testing, pp. 1–7. IEEE Press, May 2015Google Scholar
  15. 15.
    Ghiduk, A.S.: Automatic generation of basis test paths using variable length genetic algorithm. Inform. Process. Lett. 114(6), 304–316 (2014)CrossRefzbMATHMathSciNetGoogle Scholar
  16. 16.
    Pargas, R.P., Harrold, M.J., Peck, R.R.: Test-data generation using genetic algorithms. Softw. Testing Verification Reliab. 9(4), 263–282 (1999)CrossRefGoogle Scholar
  17. 17.
    Mao, C.: Generating test data for software structural testing based on particle swarm optimization. Arab. J. Sci. Eng. 39(6), 4593–4607 (2014)CrossRefGoogle Scholar
  18. 18.
    Arcuri, A.: It really does matter how you normalize the branch distance in search-based software testing. Softw. Testing Verification Reliab. 23(2), 119–147 (2013)CrossRefGoogle Scholar
  19. 19.
    Blum, C., Li, X.: Swarm Intelligence in Optimization. In: Blum, C., Merkle, D. (eds.) Swarm Intelligence. Natural Computing Series, pp. 43–85. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  20. 20.
    Chen, Y., Zhong, Y., Shi, T., Liu, J.: Comparison of two fitness functions for GA-based path-oriented test data generation. In: 2009 Fifth International Conference on Natural Computation, pp. 177–181. IEEE (2009)Google Scholar
  21. 21.
    Bueno, P., Jino, M.: Automatic test data generation for program paths using genetic algorithms. Int. J. Softw. Eng. Knowl. Eng. 12(6), 691–709 (2002)CrossRefGoogle Scholar
  22. 22.
    Jones, B.F., Sthamer, H.H., Eyres, D.E.: Automatic structural testing using genetic algorithms. Softw. Eng. J. 11(5), 299–306 (1996)CrossRefGoogle Scholar
  23. 23.
    Ayari, K., Bouktif, S., Antoniol, G.: Automatic mutation test input data generation via ant colony. In: Proceedings of the 9th Annual Conference on Genetic and Evolutionary Computation, pp. 1074–1081. ACM (2007)Google Scholar
  24. 24.
    Harman, M., et al.: A theoretical and empirical study of search-based testing: Local, global, and hybrid search. IEEE Trans. Softw. Eng. 36(2), 226–247 (2010)CrossRefGoogle Scholar
  25. 25.
    Fraser, G., Arcuri, A.: Whole test suite generation. IEEE Trans. Softw. Eng. 39(2), 276–291 (2013)CrossRefGoogle Scholar
  26. 26.
    Tracey, N., Clark, J., Mander, K., McDermid, J.: An automated framework for structural test-data generation. In: 13th IEEE International Conference on Automated Software Engineering, Proceedings, pp. 285–288. IEEE (1998)Google Scholar
  27. 27.
    Cohen, M.B., Colbourn, C.J., Ling, A.C.: Augmenting simulated annealing to build interaction test suites. In: 14th International Symposium on Software Reliability Engineering, ISSRE 2003, 17 November 2003, pp. 394–405. IEEE (2003)Google Scholar
  28. 28.
    Kennedy, J.F., Eberhart, R.C., Shi, Y.: Swarm Intelligence. Morgan Kaufman, San Francisco (2001)Google Scholar
  29. 29.
    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, 7 July 2007, pp. 1121–1128. ACM (2007)Google Scholar
  30. 30.
    Mao, C., et al.: Adapting ant colony optimization to generate test data for software structural testing. Swarm Evol. Comput. 20, 23–36 (2015)CrossRefGoogle Scholar
  31. 31.
    Li, K., Zhang, Z., Liu, W.: Automatic test data generation based on ant colony optimization. In: Fifth International Conference on Natural Computation, 14 August 2009, pp. 216–220 (2009)Google Scholar
  32. 32.
    Elbeltagi, E., Hegazy, T., Grierson, D.: Comparison among five evolutionary-based optimization algorithms. Adv. Eng. Inform. 19(1), 43–53 (2005)CrossRefGoogle Scholar
  33. 33.
    Dorigo, M., Birattari, M., Stützle, T.: Ant colony optimization. IEEE Comput. Intell. Mag. 1(4), 28–39 (2006)CrossRefGoogle Scholar
  34. 34.
    Simons, C., Smith, J.: A comparison of evolutionary algorithms and ant colony optimization for interactive software design. In: Proceedings of the 4th Symposium on Search Based-Software Engineering 28 September 2012, p. 37 (2012)Google Scholar
  35. 35.
    Suri, B., Singhal, S.: Literature survey of ant colony optimization in software testing. In: CSI Sixth International Conference on (CONSEG), pp. 1–7. IEEE (2012)Google Scholar
  36. 36.
    Li, H., Lam, C.P.: An ant colony optimization approach to test sequence generation for state based software testing. In: Quality Software, (QSIC 2005), pp. 255–262. IEEE (2005)Google Scholar
  37. 37.
    Srivastava, P.R., Baby, K.: Automated software testing using metahurestic technique based on an ant colony optimization. In: Proceedings of 2010 (ISED 2010), pp. 235–240 (2010)Google Scholar

Copyright information

© IFIP International Federation for Information Processing 2017

Authors and Affiliations

  • Atieh Monemi Bidgoli
    • 1
  • Hassan Haghighi
    • 1
    Email author
  • Tahere Zohdi Nasab
    • 1
  • Hamideh Sabouri
    • 1
  1. 1.Department of Computer Science and EngineeringShahid Beheshti University G.C.TehranIran

Personalised recommendations