Skip to main content

Advertisement

Log in

Generating test data for both path coverage and fault detection using genetic algorithms

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

Abstract

The aim of software testing is to find faults in a program under test, so generating test data that can expose the faults of a program is very important. To date, current studies on generating test data for path coverage do not perform well in detecting low probability faults on the covered path. The automatic generation of test data for both path coverage and fault detection using genetic algorithms is the focus of this study. To this end, the problem is first formulated as a bi-objective optimization problem with one constraint whose objectives are the number of faults detected in the traversed path and the risk level of these faults, and whose constraint is that the traversed path must be the target path. An evolutionary algorithmis employed to solve the formulatedmodel, and several types of fault detectionmethods are given. Finally, the proposed method is applied to several real-world programs, and compared with a random method and evolutionary optimization method in the following three aspects: the number of generations and the time consumption needed to generate desired test data, and the success rate of detecting faults. The experimental results confirm that the proposed method can effectively generate test data that not only traverse the target path but also detect faults lying in it.

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

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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. Myers G. The art of software testing. New York: Wiley, 1979

    Google Scholar 

  2. Beizer B. Software testing techniques. New York: Van Nostrand Rheinhold, 1990

    Google Scholar 

  3. Tassey G. The economic impacts of inadequate infrastructure for software testing. Gaithersburg: National Institute of Standards and Technology, 2002

    Google Scholar 

  4. Gross H, Kruse P M, Wegener J. Evolutionary white-box software test with the evotest framework, a progress report. In: Proceedings of IEEE International Conference on Software Testing Verification and Validation Workshops, ICST’ 09. 2009, 111–120

    Google Scholar 

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

    Article  Google Scholar 

  6. Sofokleous A A, Andreou A S. Automatic, evolutionary test data generation for dynamic software testing. The Journal of Systems and Software, 2008, 81(11): 1883–1898

    Article  Google Scholar 

  7. Gong D W, Zhang Y. Novel evolutionary generation approach of test data for multiple paths. Acta Electronica Sinica, 2010, 38(6): 1299–1304

    MathSciNet  Google Scholar 

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

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

  10. Zhang Y, Gong DW. Evolutionary genetation of test data for path coverage based on automatic reduction of searchspace. Acta Electronica Sinica, 2012, 40(5): 1011–1016

    Google Scholar 

  11. Caserta M, Uribe A M. Tabu search-based metaheuristic algorithm for software system reliability problems. Computers & Operations Research, 2009, 36(3): 811–822

    Article  MATH  Google Scholar 

  12. Windisch A, Wappler S, Wegener J. Applying particle swarm optimization to software testing. In: Proceedings of Genetic and Evolutionary Computation Conference, GECCO’ 07. 2007, 1121–1128

    Chapter  Google Scholar 

  13. 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, ICST’ 08. 2008, 232–240

    Chapter  Google Scholar 

  14. 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, APSEC’ 07. 2007, 41–48

    Chapter  Google Scholar 

  15. Harman M, Lakhotia K, McMinn P. A multi-objective approach to search-based test data generation. In: Proceedings of Genetic and Evolutionary Computation Conference, GECCO’ 07. 2007, 1098–1105

    Google Scholar 

  16. Gong D W, Zhang Y. Generating test data for both paths coverage and faults detection using genetic algorithms. In: Proceedings of International Conference on Intelligent Computing, ICIC’ 11. 2011, 664–671

    Google Scholar 

  17. Shan J H, Wang J, Qi Z C. Survey on path-wise automatic generation of test data. Acta Electronica Sinica, 2004, 32(1): 109–113

    Google Scholar 

  18. Chen T Y, Kuo F C, Merkel R G. Adaptive random testing: the art of test case diversity. The Journal of Systems and Software, 2010, 83(1): 60–66

    Article  Google Scholar 

  19. Ding Z, Zhang K, Hua J. A rigorous approach towards test case generation. Information Sciences, 2008, 178(21): 4057–4079

    Article  Google Scholar 

  20. Holland J H. Adaptation in natural and artificial systems. Michigan: The University of Michigan, 1975

    Google Scholar 

  21. Xanthakis S, Ellis C, Skourlas C. Application of genetic algorithms to software testing. In: Proceedings of the 5th International Conference on Software Engineering, ICSE’ 92. 1992, 625–636

    Google Scholar 

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

    Article  Google Scholar 

  23. Pachauri A, Srivastava G. Automated test data generation for branch testing using genetic algorithm: an improved approach using branch ordering, memory and elitism. The Journal of Systems and Software, 2013, 86(5): 1191–1208

    Article  Google Scholar 

  24. Xiao M, Mohamed E A, Reformat M. 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 

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

    Article  Google Scholar 

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

    Article  Google Scholar 

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

    Google Scholar 

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

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

    Article  Google Scholar 

  30. Gong Y Z, Zhao R L, Zhang W, Zhao H Q. Software testing. Beijing: China Machine Press, 2008

    Google Scholar 

  31. Deb K. Multi-objective optimization using evolutionary algorithms. American: John Wiley & Sons Inc., 2009

    MATH  Google Scholar 

  32. Xuan G N, Cheng R W. Genetic algorithms and engineering optimization. Beijing: Tsinghua University Press, 2004

    Google Scholar 

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

  34. Hyunsook D, Sebastian E, Gregg R. Supporting controlled experimentation with testing techniques: an infrastructure and its potential impact. Empirical Software Engineering: An International Journal, 2005, 10(4): 405–435

    Article  Google Scholar 

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

  36. Hutchins M, Foster H, Goradia T. Experiments of the effectiveness of data flow and control flow-based test adequacy criteria. In: Proceedings of 16th International Conference on Software Engineering, ICSE’ 94. 1994, 191–200

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yan Zhang.

Additional information

Dunwei Gong received PhD 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 is now director of the Institute of Automation, China University of Mining and Technology. His research interest is search-based software engineering.

Yan Zhang received MS in education from Liaoning Normal University, Dalian, China, in 2000. Since 2008, she has been a PhD candidate in control theory and control engineering at China University of Mining and Technology, Xuzhou, China. Her main research interest is generation of test data of complex software.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Gong, D., Zhang, Y. Generating test data for both path coverage and fault detection using genetic algorithms. Front. Comput. Sci. 7, 822–837 (2013). https://doi.org/10.1007/s11704-013-3024-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11704-013-3024-3

Keywords