Adapting Swarm Intelligence Based Methods for Test Data Generation

Document Type : Original Article

Authors

1 Department of Computer Engineering and Information Technology, Shiraz University of Technology, Shiraz, Iran

2 Department of Computer Science, Engineering and Information Technology, Shiraz University, Shiraz, Iran

Abstract

To achieve high-quality software, different tasks such as testing should be performed. Testing is known as a complex and time-consuming task. Efficient test suite generation (TSG) methods are required to suggest the best data for test designers to obtain better coverage in terms of testing criteria. In recent years, researchers to generate test data in time-efficient ways have presented different types of methods. Evolutionary and swarm-based methods are among them. This work is aimed to study the applicability of swarm-based methods for efficient test data generation in EvoSuite. The Firefly Algorithm (FA), Particle Swarm Optimization (PSO), Teaching Learning Based Optimization (TLBO), and Imperialist Competitive Algorithm (ICA) are used here. These methods are added to the EvoSuite. The methods are adapted to work in a discrete search space of test data generation problem. Also, a movement pattern is presented for generating new solutions. The performances of the presented methods are compared over 103 java classes with two built-in genetic-based methods in EvoSuite. The results show that swarm-based methods are successful in solving this problem and competitive results are obtained in comparison with the evolutionary methods. 

Keywords


[1] رافع، وحید، اسفندیاری، سجاد. راهکاری نوین جهت تولید دنباله آزمون کمینه در فرآیند آزمون نرم افزار با ترکیب الگوریتم های جستجوی تپه نوردی و جستجوی خفاش. مجله مهندسی برق دانشگاه تبریز, 46(3), 25-35، 2016.
[2] عسگری عراقی، رافع، وحید، کلائی، اکرم. تولید مورد آزمون مبتنی بر مدل از توصیفات تبدیل گراف با استفاده از الگوریتم جستجوی پرتو. مجله مهندسی برق دانشگاه تبریز, 49(1), 343-356،‎ 2019.
[3] M. Khari, P. Kumar, "An extensive evaluation of search-based software testing: a review", Soft Computing, Vol. 23, no. 6, pp.1933-1946, 2019.
[4] A. Aleti, I. Moser, L. Grunske, "Analysing the fitness landscape of search-based software testing problems", Automated Software Engineering, Vol. 24, no. 3, pp. 603-621, 2017.
[5] G. Fraser, A. Arcuri, “EvoSuite : Automatic Test Suite Generation for Object-Oriented Software,” 19th ACM SIGSOFT Symposium and 13th European Conference on Found. Software Engineering, 2011, pp. 416–419.
[6] P. McMinn, “Search-Based Software Testing: Past, Present and Future,” in 2011 IEEE Fourth International Conference on Software Testing, Verification and Validation Workshops, 2011, pp. 153–163.
[7] D. Bruce, D. Menéndez, H. D. Clark, D. Dorylus, "An ant colony based tool for automated test case generation", In International Symposium on Search Based Software Engineering, August 2019, Springer, Cham, pp. 171-180.
[8] J. M. Rojas, J. Campos, M. Vivanti, G. Fraser, A. Arcuri, "Combining multiple coverage criteria in search-based unit test generation", In International Symposium on Search Based Software Engineering, September  2015, Springer, Cham, pp. 93-108.
[9] D. Bruce, H. D. Menéndez, E. T. Barr, D. Clark, "Ant Colony Optimization for Object-Oriented Unit Test Generation", In International Conference on Swarm Intelligence, Springer, Cham, October 2020, pp. 29-41.
[10] N. Jatana, B. Suri, "An improved crow search algorithm for test data generation using search-based mutation testing", Neural Processing Letters, Vol. 52, no. 1, pp. 767-784, 2020.
[11] J. Campos, Y. Ge, G. Fraser, M. Eler, A. Arcuri, "An empirical evaluation of evolutionary algorithms for test suite generation", In International Symposium on Search Based Software Engineering, Springer, Cham, September 2017, pp. 33-48.
[12] J. M. Rojas, M. Vivanti, A. Arcuri, G. Fraser, "A detailed investigation of the effectiveness of whole test suite generation", Empirical Software Engineering, Vol. 22, no. 2, pp. 852-893, 2017.
[13] M. Mehdi, D. Shahabi, S. P. Badiei, S. E. Beheshtian, R. Akbari, and S. M. Reza, “On the Performance of EvoPSO : a PSO Based Algorithm for Test Data Generation in EvoSuite", In 2nd Conference on Swarm Intelligence and Evolutionary Computation  (CSIEC), Kerman, Iran, 2017, pp. 129–134.
[14] M. M. D. Shahabi, S. P. Badiei, S. E. Beheshtian, R. Akbari, S. M. R. Moosavi, "EVOTLBO: A TLBO based Method for Automatic Test Data Generation in EvoSuite", International Journal of Advanced Computer Science and Applications, Vol. 8, no. 6, 2017.
[15] M. M. Almasi, H. Hemmati, G. Fraser, A. Arcuri, J. Benefelds, "An industrial evaluation of unit test generation: Finding real faults in a financial application", In 2017 IEEE/ACM 39th International Conference on Software Engineering: Software Engineering in Practice Track (ICSE-SEIP), May 2017, pp. 263-272.
[16] S. Shamshiri, J. M. Rojas, L. Gazzola, G. Fraser, P. McMinn, L. Mariani, A. Arcuri, "Random or evolutionary search for object‐oriented test suite generation", Software Testing, Verification and Reliability, Vol. 28, no. 4, e1660, 2018.
[17] C. Oliveira, A. Aleti, L. Grunske, K. Smith-Miles, "Mapping the effectiveness of automated test suite generation techniques", IEEE Transactions on Reliability, Vol. 67, no. 3, pp. 771-785, 2018.
[18] N. M. Albunian, "M. Diversity in search-based unit test suite generation", In International Symposium on Search Based Software Engineering, Springer, Cham, September 2017, pp. 183-189.
[19] G. Gay, "Generating effective test suites by combining coverage criteria", In International Symposium on Search Based Software Engineering, Springer, Cham, September 2017, pp. 65-82.
[20] M. Olsthoorn, P. Derakhshanfar, X. Devroey,"An Application of Model Seeding to Search-Based Unit Test Generation for Gson", In International Symposium on Search Based Software Engineering, Springer, Cham, October 2020, pp. 239-245.
[21] D. Serra, G. Grano, F. Palomba, F. Ferrucci, H. C. Gall, A. Bacchelli, "On the effectiveness of manual and automatic unit test generation: ten years later", In 2019 IEEE/ACM 16th International Conference on Mining Software Repositories (MSR), May 2019, pp. 121-125.
[22] G. Rudžionienė, Š. Packevičius, E. Bareiša, "Directed multi-target search based unit tests generation", In International Conference on Information and Software Technologies, Springer, Cham, October 2019, pp. 90-109.
[23] H. Almulla, G. Gay, "Generating Diverse Test Suites for Gson Through Adaptive Fitness Function Selection", In International Symposium on Search Based Software Engineering, Springer, Cham, October 2020, pp. 246-252.
[24] B. Evers, P. Derakhshanfar, X. Devroey, A. Zaidman, "Commonality-Driven Unit Test Generation" In International Symposium on Search Based Software Engineering", Springer, Cham, October 2020, pp. 121-136.
[25] G. Fraser, A. Arcuri, "Evosuite: On the challenges of test case generation in the real world", In 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation, March 2013, pp. 362-369.
[26] G. Fraser, A. Arcuri, and P. McMinn, “Test Suite Generation with Memetic Algorithms,” Gecco’13 Proceeding of Genetic and Evolutionary Computation Conference, 2013, pp. 1437–1444.
[27] R. V. Rao, V. J. Savsani, D. P. Vakharia, “Teaching–learning-based optimization: A novel method for constrained mechanical design optimization problems”, Comput. Des., Vol. 43, no. 3, pp. 303–315, 2011.
[28] R. Eberhart, J. Kennedy, “A New Optimizer Using Particle Swarm Theory,” pp. 39–43, 1995.
[29] D. YueMing, W. YiTing, and W. DingHui, “Particle swarm optimization algorithm for test case automatic generation based on clustering thought,” In 2015 IEEE International Conference on Cyber Technology in Automation, Control, and Intelligent Systems (CYBER), pp. 1479–1485.
[30] E. Atashpaz-Gargari, C. Lucas, “Imperialist competitive algorithm: An algorithm for optimization inspired by imperialistic competition”, 2007 IEEE Congress on Evolutionary Computation, CEC 2007, pp. 4661–4667.
[31] I. Fister, I. Fister Jr, X. S. Yang, J. Brest, "A comprehensive review of firefly algorithms", Swarm and Evolutionary Computation, 2013, pp. 34-46.