Skip to main content
Log in

Generating test data for both paths coverage and faults detection using genetic algorithms: multi-path case

  • Research Article
  • Published:
Frontiers of Computer Science Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Ahmed M A, Hermadi I. GA-based multiple paths test data generator. Computer & Operations Research, 2008, 35(10): 3107–3124

    Article  Google Scholar 

  2. 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

    Google Scholar 

  3. 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

    Google Scholar 

  4. Lin J C, Yeh P L. Automatic test data generation for path testing using GAs. Information Sciences, 2001, 131(1–4): 47–64

    Article  MATH  Google Scholar 

  5. 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

    Article  Google Scholar 

  6. 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

    Article  Google Scholar 

  7. 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

    Article  Google Scholar 

  8. 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

    Google Scholar 

  9. 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

    Google Scholar 

  10. Whittaker J A. What is software testing? and why is it so hard? IEEE Software, 2000, 17(1): 70–79

    Article  Google Scholar 

  11. 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

    Article  MathSciNet  Google Scholar 

  12. Mills H D, Dyer M D, Linger R C. Cleanroom software engineering. IEEE Software, 1987, 4(5): 19–25

    Article  Google Scholar 

  13. Voas J M, Morell L, Miller KW. Predicting where faults can hide from testing. IEEE Software, 1991, 8(2): 41–48

    Article  Google Scholar 

  14. 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

    Google Scholar 

  15. King J C. Symbolic execution and program testing. Communications of the ACM, 1976, 19(7): 385–394

    Article  MATH  Google Scholar 

  16. Botella B, Gotlieb A, Michel C. Symbolic execution of floating-point computations. Software Testing, Verification & Reliability, 2006, 16(2): 97–121

    Article  Google Scholar 

  17. Zhang J. Symbolic execution of program paths involving pointer structure variables. In: Proceedings of the 4th Intemational Conference on Quality Software. 2004, 87-92

  18. 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

    Article  Google Scholar 

  19. Korel B. Automated software test data generation. IEEE Transactions on Software Engineering, 1990, 16(8): 870–879

    Article  Google Scholar 

  20. 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

    Google Scholar 

  21. Holland J H. Adaptation in Natural and Artificial Systems. Michigan: The University of Michigan, 1975

    Google Scholar 

  22. 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

    Google Scholar 

  23. McMinn P. Search-based software test data generation: a survey. Software Testing, Verification and Reliability, 2004, 14(2): 105–156

    Article  Google Scholar 

  24. 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

  25. Pargas R P, Harrold M J, Peck R. Test-data generation using genetic algorithms. Software Testing, Verification and Reliability, 1999, 9(1): 263–282

    Article  Google Scholar 

  26. Wegener J, Baresel A, Sthamer H. Evolutionary test environment for automatic structural testing. Journal of Information and Software Technology, 2001, 43(14): 841–854

    Article  Google Scholar 

  27. Michael C C, McGraw G, Schatz MA. Generating software test data by evolution. IEEE Transactions on Software Engineering, 2001, 27(12): 1085–1110

    Article  Google Scholar 

  28. 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

    Article  Google Scholar 

  29. Arcuri A, Yao X. Search based software testing of object-oriented containers. Information Sciences, 2008, 178(15): 3075–3095

    Article  Google Scholar 

  30. Buhler O, Wegener J. Evolutionary functional testing. Computers & Operations Research, 2008, 35(10): 3144–3160

    Article  Google Scholar 

  31. 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

    Google Scholar 

  32. 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

    Chapter  Google Scholar 

  33. 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

    Google Scholar 

  34. Yoo S, Harman M. Pareto efficient multi-objective test case selection. In: Proceedings of International Symposium on Software Testing and Analysis. 2007, 140–150

    Google Scholar 

  35. Morell L J. A theory of fault-based testing. IEEE Transactions on Software Engineering, 1990, 16(8): 844–857

    Article  Google Scholar 

  36. 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

    Google Scholar 

  37. 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

    Google Scholar 

  38. Nanda M G, Sinha S. Accurate interprocedural nulldereference analysis for java. In: Proceedings of the 31st International Conference on Software Engineering. 2009, 133–143

    Google Scholar 

  39. 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

    Chapter  Google Scholar 

  40. Godefroid P, Levin M Y, Molnar D. Active property checking. In: Proceedings of the 8th ACM International Conference on Embedded software. 2008, 207–216

    Chapter  Google Scholar 

  41. Cui Z Q, Z. W L, Li X D. Target-directed concolic testing. Chinese Journal of Computers, 2011, 34(6): 953–964

    Article  Google Scholar 

  42. 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

    Google Scholar 

  43. Jia Y, Harman M. An analysis and survey of the development of mutation testing. IEEE Transactions on Software Engineering, 2011, 37(5): 649–678

    Article  Google Scholar 

  44. 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

    Article  Google Scholar 

  45. 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

    Chapter  Google Scholar 

  46. 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

    Article  Google Scholar 

  47. Gotlieb A, Petit M. Path-oriented random testing. In: Proceedings of the 1st International Workshop on Random Testing. 2006, 28–35

    Chapter  Google Scholar 

  48. 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

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dunwei Gong.

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

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11704-014-3372-7

Keywords

Navigation