Abstract
Generating test data that can expose the faults of the program is an important issue in software testing. Although previous methods of covering path can generate test data to traverse target path, the test data generated by these methods are difficult in detecting some low-probabilistic faults that lie on the covered paths. We present a method of generating test data for covering multiple paths to detect faults in this study. First, we transform the problem of covering multiple paths and detecting faults into a multi-objective optimization problem with constraint, and construct a mathematical model for it. Then, we give a strategy of solving the model based on a weighted genetic algorithm. Finally, we apply our method to several real-world programs, and compare it with several methods. The experimental results confirm that the proposed method can more efficiently generate test data that not only traverse the target paths but also detect faults lying in them than other methods.
Similar content being viewed by others
References
Ahmed M A, Hermadi I. GA-based multiple paths test data generator. Computer & Operations Research, 2008, 35(10): 3107–3124
Alander J T, Mantere T, Turunen P. Genetic algorithm based software testing. In: Proceedings of the 3rd International Conference on Artificial Neural Networks and Genetic Algorithms. 1997, 325–328
Srivastava P R, Kim T. Application of genetic algorithm in software testing. International Journal of Software Engineering and Its Applications, 2009, 3(4): 87–95
Lin J C, Yeh P L. Automatic test data generation for path testing using GAs. Information Sciences, 2001, 131(1–4): 47–64
Gong D W, Tian T, Yao X J. Grouping target paths for evolutionary generation of test data in parallel. The Journal of Systems and Software, 2012, 85(11): 2531–2540
Miller J, Reformat M, Zhang H. Automatic test data generation using genetic algorithm and program dependence graphs. Information and Software Technology, 2006, 48(7): 586–605
Gong D W, Zhang W Q, Yao X J. Evolutionary generation of test data for many paths coverage based on grouping. The Journal of Systems and Software, 2011, 84(12): 2222–2233
McMinn P, Harman M, Binkley D, Tonella P. The species per path approach to searchbased test data generation. In: Proceedings of International Symposium on Software Testing and Analysis. 2006, 13–24
Zhou Z Q, Huang D H, Tse T H, Yang Z Y, Huang H, Chen T Y. Metamorphic testing and its applications. In: Proceedings of the 8th International Symposium on Future Software Technology. 2004
Whittaker J A. What is software testing? and why is it so hard? IEEE Software, 2000, 17(1): 70–79
Gong D W, Zhang Y. Generating test data for both path coverage and faults detection using genetic algorithms. Frontiers of Computer Science, 2013, 7(6): 822–837
Mills H D, Dyer M D, Linger R C. Cleanroom software engineering. IEEE Software, 1987, 4(5): 19–25
Voas J M, Morell L, Miller KW. Predicting where faults can hide from testing. IEEE Software, 1991, 8(2): 41–48
Thévenod-Fosse P, Waeselynck H. Statemate: applied to statistical software testing. In: Proceedings of the 1993 ACM SIGSOFT International Symposium on Software Testing and Analysis. 1993, 99–109
King J C. Symbolic execution and program testing. Communications of the ACM, 1976, 19(7): 385–394
Botella B, Gotlieb A, Michel C. Symbolic execution of floating-point computations. Software Testing, Verification & Reliability, 2006, 16(2): 97–121
Zhang J. Symbolic execution of program paths involving pointer structure variables. In: Proceedings of the 4th Intemational Conference on Quality Software. 2004, 87-92
Khurshid S, Păsăreanu C S, Visser W. G Generalized symbolic execution for model checking and testing. Lecture Notes in Computer Science, 2003, 2619: 553–56
Korel B. Automated software test data generation. IEEE Transactions on Software Engineering, 1990, 16(8): 870–879
Harman M, Mansouri A, Zhang Y. Search-based Software Engineering: A Comprehensive Analysis and Review of Trends Techniques and Applications. Technical Report TR-09-03: Department of Computer Science, King’s College London. 2009
Holland J H. Adaptation in Natural and Artificial Systems. Michigan: The University of Michigan, 1975
Xanthakis S, Ellis C, Skourlas C, Le Gall A, Katsikas S, Karapoulios K. Application of genetic algorithms to software testing. In: Proceedings of the 5th International Conference on Software Engineering. 1992, 625–636
McMinn P. Search-based software test data generation: a survey. Software Testing, Verification and Reliability, 2004, 14(2): 105–156
Michael C C, McGraw G E, Schatz M A. Opportunism and diversity in automated software test data generation. In: Proceedings of Automated Software Engineer. 1998, 136-146
Pargas R P, Harrold M J, Peck R. Test-data generation using genetic algorithms. Software Testing, Verification and Reliability, 1999, 9(1): 263–282
Wegener J, Baresel A, Sthamer H. Evolutionary test environment for automatic structural testing. Journal of Information and Software Technology, 2001, 43(14): 841–854
Michael C C, McGraw G, Schatz MA. Generating software test data by evolution. IEEE Transactions on Software Engineering, 2001, 27(12): 1085–1110
Xiao M, Mohamed E A, Reformat M, Miller J. Empirical evaluation of optimization algorithms when used in goal-oriented automated test data generation techniques. Empirical Software Engineering, 2007, 12(2): 183–239
Arcuri A, Yao X. Search based software testing of object-oriented containers. Information Sciences, 2008, 178(15): 3075–3095
Buhler O, Wegener J. Evolutionary functional testing. Computers & Operations Research, 2008, 35(10): 3144–3160
Sagarna R, Yao X. Handling constraints for search based software test data generation. In: Proceedings of IEEE International Conference on Software Testing Verification and Validation Workshop. 2008, 232–240
Ghiduk A S, Harrold MJ. Using genetic algorithms to aid test data generation for data flow coverage. In: Proceedings of the 14th Asia-Pacific Software Engineering Conference. 2007, 41–48
Harman M, Lakhotia K, McMinn P. A multi-objective approach to search-based test data generation. In: Proceedings of Genetic and Evolutionary Computation Conference. 2007, 1098–1105
Yoo S, Harman M. Pareto efficient multi-objective test case selection. In: Proceedings of International Symposium on Software Testing and Analysis. 2007, 140–150
Morell L J. A theory of fault-based testing. IEEE Transactions on Software Engineering, 1990, 16(8): 844–857
Yang Z H, Gong Y Z, Xiao Q, Wang Y W. A defect model based testing system. Journal of Beijing University of Posts and Telecommunications, 2008, 31(5): 1–4
Romano D, Penta M D, Antoniol G. An approach for search based testing of null pointer exceptions. In: Proceedings of the International Conference on Software Testing, Verification and Validation. 2011, 160–169
Nanda M G, Sinha S. Accurate interprocedural nulldereference analysis for java. In: Proceedings of the 31st International Conference on Software Engineering. 2009, 133–143
Bhattacharya N, Sakti A, Antoniol G, Guéhéneuc Y G, Pesant G. Divide-by-zero exception raising via branch coverage. In: Proceedings of the 3rd International Conference on Search based Software Engineering, ICSSE’11. 2011, 204–218
Godefroid P, Levin M Y, Molnar D. Active property checking. In: Proceedings of the 8th ACM International Conference on Embedded software. 2008, 207–216
Cui Z Q, Z. W L, Li X D. Target-directed concolic testing. Chinese Journal of Computers, 2011, 34(6): 953–964
Fraser G, Zeller A. Mutation-driven generation of unit tests and oracles. In: Proceedings of the 19th international symposium on Software testing and analysis. 2010, 1689–1696
Jia Y, Harman M. An analysis and survey of the development of mutation testing. IEEE Transactions on Software Engineering, 2011, 37(5): 649–678
Zhong H, Zhang L, Mei H. An experimental study of four typical test suite reduction techniques. Information and Software Technology, 2008, 50(6): 534–546
Hutchins M, Foster H, Goradia T, Ostrand T. Experiments of the effectiveness of data flow and control flow-based test adequacy criteria. In: Proceedings of the 16th International Conference on Software Engineering. 1994, 191–200
Zhang Z Y, Jiang B, Chan WK, Tse T H, Wang XM. Fault localization through evaluation sequences. Journal of Systems and Software, 2010, 83(2): 174–187
Gotlieb A, Petit M. Path-oriented random testing. In: Proceedings of the 1st International Workshop on Random Testing. 2006, 28–35
Hyunsook D, Sebastian E, Gregg R. Supporting controlled experimentation with testing techniques: an infrastructure and its potential impact. Empirical Software Engineering, 2005, 10(4): 405–435
Author information
Authors and Affiliations
Corresponding author
Additional information
Yan Zhang received PhD degree in control theory and control engineering from China University of Mining and Technology, Xuzhou, China in 2013. Hermain research interest is generation of test data of complex software.
Dunwei Gong received PhD degree in control theory and control engineering from China University of Mining and Technology, Xuzhou, China in 1999. Since 2004, he has been a professor and the director of Institute of Automation, China University of Mining and Technology. His research interest is search-based software engineering.
Rights and permissions
About this article
Cite this article
Zhang, Y., Gong, D. Generating test data for both paths coverage and faults detection using genetic algorithms: multi-path case. Front. Comput. Sci. 8, 726–740 (2014). https://doi.org/10.1007/s11704-014-3372-7
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11704-014-3372-7