Abstract
In testing object-oriented programs (OOP), a fundamental problem of a genetic algorithm (GA) is how to achieve high code coverage for a class under test (CUT), and it is challenging since it requires the search to generate method calls that reach as many different CUT states as possible. This paper introduces a Guided Genetic Algorithm (GGA) that uses static analysis to set the initial population and guide the mutation operator. GGA uses static analysis to generate test cases that focus on only methods of a CUT that help to cover target branches. GGA also uses a seeding strategy for constant values and reference types to increase the likelihood of covering a target branch. We compared GGA with EvoSuite and pure Random Testing (RT) on six Java open-source projects. Our results show that GGA achieved higher branch coverage.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Aburas A, Groce A (2014) An improved memetic algorithm with method dependence relations (MAMDR). In: 2014 14th international conference on quality software. IEEE, pp 11–20 (2014)
Baresi L, Lanzi PL, Miraz M (2010) Testful: an evolutionary test approach for java. In: Software testing, verification and validation (ICST). IEEE, pp 185–194 (2010)
Ciupa I, Leitner A, Oriol M, Meyer B (2007) Experimental assessment of random testing for object-oriented software. In: Proceedings of the 2007 international symposium on Software testing and analysis, pp 84–94 (2007)
Fraser G, Arcuri A (2012) The seed is strong: seeding strategies in search-based software testing. In: 2012 IEEE Fifth international conference on software testing, verification and validation. IEEE, pp. 121–130
Fraser G, Arcuri A (2013) Whole test suite generation. IEEE Trans Softw Eng 39(2):276–291
Groce A, Zhang C, Alipour MA, Eide E, Chen Y, Regehr J (2013) Help, help, i’m being suppressed! the significance of suppressors in software testing. In: 2013 IEEE 24th international symposium on software reliability engineering (ISSRE). IEEE, pp 390–399
JaCoCo: Java Code Coverage Library Version 3.1.3. http://www.eclemma.org/jacoco/
Ma L, Artho C, Zhang C, Sato H, Gmeiner J, Ramler R (2015) Grt: program-analysis-guided random testing (t). In: 2015 30th IEEE/ACM international conference on automated software engineering (ASE), pp 212–223
McMinn P (2004) Search-based software test data generation: a survey. Softw Test Verif Reliab 14(2):105–156
Miraz M, Lanzi PL, Baresi L (2010) Improving evolutionary testing by means of efficiency enhancement techniques. In: IEEE congress on evolutionary computation, pp 1–8 (2010)
Sakti A, Pesant,G, Guéhéneuc YG (2015) Instance generator and problem representation to improve object oriented code coverage. IEEE Trans Softw Eng 41(3):294–313
Soot: a Java Optimization Framework Version 2.5.0. https://www.sable.mcgill.ca/soot/
Zhang S, Saff D, Bu Y, Ernst MD (2011) Combined static and dynamic automated test generation. In: Proceedings of the 2011 international symposium on software testing and analysis, pp 353–363
Acknowledgements
The author would like to thank the two anonymous reviewers for their constructive comments and suggestions. The author would also like to thank the University of Tripoli (Libya) and the SUNY Morrisville (USA) for their support.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Aburas, A. (2022). An Improved Genetic Algorithm With Initial Population Strategy and Guided Mutation. In: Yang, XS., Sherratt, S., Dey, N., Joshi, A. (eds) Proceedings of Sixth International Congress on Information and Communication Technology. Lecture Notes in Networks and Systems, vol 236. Springer, Singapore. https://doi.org/10.1007/978-981-16-2380-6_76
Download citation
DOI: https://doi.org/10.1007/978-981-16-2380-6_76
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-16-2379-0
Online ISBN: 978-981-16-2380-6
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)