Automated Test Data Generation Using a Combination of Firefly Algorithm and Asexual Reproduction Optimization Algorithm

Document Type : Original Article

Authors

K. N. Toosi University of Technology

Abstract

Software testing is an expensive and time-consuming process. These costs can be significantly reduced using automated methods. Recently, many researchers have focused on automating this process using search algorithms. Many different methods have been proposed, all of which using a means of heuristic or meta-heuristic search algorithms. The main problem with these methods is that they are usually stuck in local optima. In this paper, to overcome such a problem, we have combined the firefly algorithm (FA) and asexual reproduction optimization algorithm (ARO). FA is a bio-inspired algorithm that is very efficient at exploitation and local searches; however, it suffers from poor exploration and is prone to local optima problem. On the other hand, ARO can be used for escaping from local optima. For this combination, we have inserted ARO into the steps of FA for increasing the population diversity. We have utilized this combination for automatic test case generation with the aim of covering all finite paths of the control flow graph. To evaluate the performance of the proposed method, we have utilized it for generating test cases for a number of programs. Results have indicated that, while giving similar results in terms of the test coverage, the proposed method is significantly better than the existing state of the art algorithms in terms of the number of fitness evaluations. Compared algorithms are FA, ARO, traditional genetic algorithm (TGA), adaptive genetic algorithm (AGA), adaptive particle swarm optimization (APSO), hybrid genetic tabu search algorithm (HGATS), random search (RS), differential evolution (DE), and hybrid cuckoo search and genetic algorithm (CSGA).

Keywords


  • J. Myers, C. Sandler, and T. Badgett, The art of software testing, John Wiley & Sons, 2011.
  • Ammann, and J. Offutt, Introduction to software testing. Cambridge University Press, 2016.
  • McMinn, “Search‐based software test data generation: a survey”. Software testing, Verification and reliability, vol. 14, no. 2, pp. 105-156, 2004.
  • R. Sahoo, and M. Ray, “Metaheuristic techniques for test case generation: a review”. Journal of Information Technology Research (JITR), vol. 11, no. 1, pp.158-171, 2018.
  • J. Cheung, X. M. Ding, and H. B. Shen, “Adaptive firefly algorithm: parameter analysis and its application”. PLoS One, vol. 9, no. 11, e112634, 2014.
  • Fister, X. S. Yang, and J. Brest, “Memetic self-adaptive firefly algorithm”. In Swarm intelligence and bio-inspired computation, Elsevier. 2013, pp. 73-102.
  • Farasat, M. B. Menhaj, T. Mansouri, and M. R. S. Moghadam, “ARO: A new model-free optimization algorithm inspired from asexual reproduction”. Applied Soft Computing, vol. 10, no. 4, pp. 1284-1292, 2010.
  • Bao, Z. Xiong, N. Zhang, J. Qian, B. Wu, and W. Zhang, “Path-oriented test cases generation based adaptive genetic algorithm”. PloS one, vol. 12, no. 11, 2017.
  • R. Girgis, “Automatic Test Data Generation for Data Flow Testing Using a Genetic Algorithm”. J. UCS, vol. 11, no. 6, pp. 898-915, 2005.
  • Jiang, J. Shi, Y. Zhang, and H. Han, “Automatic test data generation based on reduced adaptive particle swarm optimization algorithm”. Neurocomputing, vol. 158, pp.109-116, 2015.
  • Fan, “Test data generation with a hybrid genetic tabu search algorithm for decision coverage criteria”. In The 5th International Conference on Computer Engineering and Networks, SISSA Medialab, October 2015, vol. 259, p.008.
  • Varshney, and M. Mehrotra, A differential evolution based approach to generate test data for data-flow coverage. In 2016 International Conference on Computing, Communication and Automation (ICCCA), IEEE, April 2016, pp. 796-801.
  • [13] R. Khan, M. Amjad, and A. K. Srivastava, “Optimization of automatic test case generation with cuckoo search and genetic algorithm approaches”, Advances in Computer and Computational Sciences, Springer, Singapore, 2018, pp. 413-423.
  • Ammann, and J. Offutt, Introduction to Software Testing, 1 ed., United States of America, New York, Cambridge University Press, April 2008.
  • Utting, B. Legeard, F. Bouquet, E. Fourneret, F. Peureux, and A. Vernotte, “Recent advances in model-based testing”, In Advances in Computers, vol. 101, Elsevier, January 2016, pp. 53-120.
  • Lonetti, and E. Marchetti, “Emerging software testing technologies”. In Advances in Computers, vol. 108, Elsevier, 2018, pp. 91-143.
  • Hamlet, “Random testing”, in Encyclopedia of software Engineering,
  • C. Ntafos, and J. W. Duran, “An Evolution of random testing”, IEEE Transaction on Software Testing, vol. 10, no. 4, pp. 438-444, July 1984.
  • C. Ince, “The automatic generation of test data”, The Computer Journal, vol. 30, no. 1, pp. 63-69, 1987.
  • Zhang, B. Wu, and X. Bao. “Automatic generation of test cases based on multi-population genetic algorithm”. Int. J. Multimedia Ubiquitous Eng., vol. 10, no. 6, pp. 113-122, 2015.
  • Mann, P. Tomar, and O. P. Sangwan, “Test Data Generation Using Optimization Algorithm: An Empirical Evaluation”. Soft Computing: Theories and Applications. Springer, Singapore, 2018, pp. 679-686.
  • Mann, O. P. Sangwan, P. Tomar, and S. Singh, “Automatic goal-oriented test data generation using a genetic algorithm and simulated annealing”. 2016 6th International Conference-Cloud System and Big Data Engineering (Confluence). IEEE, 2016 pp. 83-87.
  • Singla, D. Kumar, H. M. Rai, and P. Singla, “A hybrid PSO approach to automate test data generation for data flow coverage with dominance concepts”. International Journal of Advanced Science and Technology, vol. 37, pp. 15-26, 2011.
  • A. Sofokleous, and A.S. Andreou. “Automatic, evolutionary test data generation for dynamic software testing”. Journal of Systems and Software, vol. 81, no. 11, pp. 1883-1898, 2008.
  • I. Latiu, O. A. Cret, and L. Vacariu, “Automatic test data generation for software path testing using evolutionary algorithms”. 2012 Third International Conference on Emerging Intelligent Data and Web Technologies. IEEE, 2012, pp. 1-8.
  • Windisch, S. Wappler, and J. Wegener, “Applying particle swarm optimization to software testing”. Proceedings of the 9th Annual Conference on Genetic and Evolutionary Computation, 2007, pp. 1121-1128.
  • R. Srivastava, R. Khandelwal, S. Khandelwal, S. Kumar, and S. S. Ranganatha, “Automated test data generation using cuckoo search and tabu search (CSTS) algorithm”. Journal of Intelligent Systems, vol. 21, no. 2, pp. 195-224, 2012.
  • Perumal, J. M. Ungati, G. Kumar, N. Jain, R. Gaurav, and P. R. Srivastava, “Test data generation: a hybrid approach using cuckoo and tabu search”. International Conference on Swarm, Evolutionary, and Memetic Computing, Springer, Berlin, Heidelberg, 2011, pp. 46-54.
  • Sahin, and , B. Akay “Comparisons of metaheuristic algorithms and fitness functions on software test data generation”. Applied Soft Computing, vol. 49, pp.1202-1214, 2016.
  • Kumar, D. K. Yadav, and D. A. Khan, “A novel approach to automate test data generation for data flow testing based on hybrid adaptive PSO-GA algorithm”. International Journal of Advanced Intelligence Paradigms, vol. 9, no. 2-3, pp.278-312, 2017.
  • Jain, R. Porwal, S. Kumar, S.Varshney, and M. Saraswat, “Automatic data flow class testing based on 2-step heterogeneous process using evolutionary algorithms”. Journal of Statistics and Management Systems, vol. 22, no. 7, pp.1315-1348, 2019.
  • R. Srivatsava, B. Mallikarjun, and X. S. Yang, “Optimal test sequence generation using firefly algorithm”. Swarm and Evolutionary Computation, vol. 8, pp.44-53, 2013.
  • P. Mohapatra, “Firefly optimization technique based test scenario generation and prioritization”. Journal of Applied Research and Technology, vol. 16, no. 6, pp.466-483, 2018.
  • S. Yang, “Firefly algorithm, stochastic test functions and design optimization”. International Journal of Bio-inspired Computation, vol. 2, no. 2, pp.78-84, 2010.
  • McGinley, J. Maher, C. O'Riordan, and F. Morgan, “Maintaining healthy population diversity using adaptive crossover, mutation, and selection”. IEEE Transactions on Evolutionary Computation, vol. 15, no. 5, pp.692-714, 2011.
  • Leung, Y. Gao, and Z. B. Xu, “Degree of population diversity-a perspective on premature convergence in genetic algorithms and its markov chain analysis”. IEEE Transactions on Neural Networks, vol. 8, no. 5, pp.1165-1176, 1997.
  • E. Eiben, and J. E. Smith, Multimodal problems and spatial distribution. In Introduction to Evolutionary Computing, Springer, Berlin, Heidelberg, 2003, pp. 153-172.
  • Zhang, B. Wu, and X. Bao. “Automatic generation of test cases based on multi-population genetic algorithm”. Int. J. Multimedia Ubiquitous Eng., vol. 10, no. 6, pp. 113-122, 2015.
  • Zhang, B. Wu, and X. Bao, “Automatic generation of test cases based on multi-population genetic algorithm”. Int. J. Multimedia Ubiquitous Eng, vol. 10, no. 6, pp.113-122, 2015.
  • S., Ghiduk, “Automatic generation of basis test paths using variable length genetic algorithm”. Information Processing Letters, vol. 114, no. 6, pp.304-316, 2014.
  • M. Bidgoli, and H. Haghighi, “Augmenting ant colony optimization with adaptive random testing to cover prime paths”. Journal of Systems and Software, vol. 161, p.110495, 2020.
  • I., Latiu, O. A. Cret, and L. Vacariu, “September. Automatic test data generation for software path testing using evolutionary algorithms”. In 2012 Third International Conference on Emerging Intelligent Data and Web Technologies, IEEE, 2012, pp. 1-8.
  • Harman, and B. F. Jones, “Search-based Software Engineering”. Information and Software Technology, vol. 43, pp. 833-839, 2001.

 Mehdi Esnaashari received the B.S., M.S., and Ph.D. degrees in Computer Engineering, all from Amirkabir University of Technology, Tehran, Iran, in 2002, 2005, and 2011 respectively. He worked at Iran Telecommunications Research Center as an Assistant Professor from 2012 to 2016. Currently, he is an Assistant Professor in the Faculty of Computer Engineering, K. N. Toosi University of Technology. His research interests include computer networks, learning systems, especially reinforcement learning, and information retrieval.

Amir Hossein Damia received his M.S. degree in the field of software engineering from K. N. Toosi University of Technology in 2020. His research interests include evolutionary algorithms, reinforcement learning, and software testing.