Software Quality Journal

, Volume 12, Issue 2, pp 121–136 | Cite as

Data Generation for Path Testing

  • Nashat Mansour
  • Miran Salame
Article

Abstract

We present two stochastic search algorithms for generating test cases that execute specified paths in a program. The two algorithms are: a simulated annealing algorithm (SA), and a genetic algorithm (GA). These algorithms are based on an optimization formulation of the path testing problem which include both integer- and real-value test cases. We empirically compare the SA and GA algorithms with each other and with a hill-climbing algorithm, Korel's algorithm (KA), for integer-value-input subject programs and compare SA and GA with each other on real-value subject programs. Our empirical work uses several subject programs with a number of paths. The results show that: (a) SA and GA are superior to KA in the number of executed paths, (b) SA tends to perform slightly better than GA in terms of the number of executed paths, and (c) GA is faster than SA; however, KA, when it succeeds in finding the solution, is the fastest.

genetic algorithms path testing simulated annealing software testing software quality structural testing 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Beizer, B. 1990. Software Testing Techniques. New York, Van Nostrand Reinhold.Google Scholar
  2. Clarke, L. 1976. A system to generate test data and symbolically execute programs, IEEE Trans. on Software Engineering 2(3): 215-222.Google Scholar
  3. Debnath, N., Swindan, T., Lee, R. and Abachi, H. 2000. Test case generating and execution tools, Software Engineering Applied to Networks and Parallel/Distributed Computing, Reims, France, May 18-21, pp. 123-129.Google Scholar
  4. DeMillo, R. and Offutt, A.J. 1991. Constraint-based automatic test data generation, IEEE Trans. on Software Engineering 17(9): 900-910.Google Scholar
  5. Duran, J. and Ntafos, S. 1984. An evaluation of random testing, IEEE Trans. on Software Engineering 10(4): 438-443.Google Scholar
  6. Garey, M. and Johnson, D. 1979. Computers and Intractability. New York, Freeman.Google Scholar
  7. Goldberg, D. 1989. Genetic Algorithms in Search, Optimization and Machine Learning. Reading, MA, Addison-Wesley.Google Scholar
  8. Graham, D. 1994. Testing, Encyclopedia of Software Engineering, ed. J.J. Marciniak, pp. 1330-1353. New York, Wiley.Google Scholar
  9. Hamlet, G. and Taylor, R. 1990. Partition testing does not inspire confidence, IEEE Trans. on Software Engineering 16(12): 1402-1411.Google Scholar
  10. Howden, W. 1977. Symbolic testing and the DISSECT symbolic evaluation system, IEEE Trans. on Software Engineering 4(4): 266-278.Google Scholar
  11. Howden, W. 1986. A functional approach to program testing and analysis, IEEE Trans. on Software Engineering 12(10): 997-1005.Google Scholar
  12. Jeng, B. 1994. Integrating data flow and domain testing, Asia-Pacific Software Engineering Conference, Tokyo, pp. 123-135.Google Scholar
  13. Jones, B., Sthamer, H. and Eyres, D. 1998. A strategy for using genetic algorithms to automate branch and fault-based testing, The Computer Journal 41(2): 98-107.Google Scholar
  14. Kirkpatrick, S., Gelatt, C.D. and Vecchi, M.P. 1983. Optimization by simulated annealing, Science 220(4598): 671-680.Google Scholar
  15. Korel, B. 1990. Automated software test generation, IEEE Trans. on Software Engineering 16(8): 870-879.Google Scholar
  16. Korel, B. 1992. Dynamic method for software test data and generation, J. of Software Testing, Verification, and Reliability 2: 203-213.Google Scholar
  17. Korel, B. and Al-Yami, A. 1996. Assertion-oriented automated test data generation, Int. Conf. Software Engineering, pp. 71-80.Google Scholar
  18. Marx, D.I.S. and Frankl, P.G. 1999. Path-sensitive alias analysis for data flow testing, Journal of Software Testing, Verification, and Reliability 9: 51-73.Google Scholar
  19. McCabe, T. 1982. Structured Testing. Washington, DC, US Government Printing Office.Google Scholar
  20. Offutt, A.J., Jin, Z. and Pan, J. 1999. The dynamic domain reduction procedure for test data generation, Software Practice and Experience 29(2): 167-193.Google Scholar
  21. Pargas, R.P., Harrold, M.J. and Peck, R.R. 1999. Test-data generation using genetic algorithms, Journal of Software Testing, Verification, and Reliability 9: 263-282.Google Scholar
  22. Ramamoorthly, C., Ho, S. and Chen, W. 1976. On the automated generation of program test data, IEEE Trans. on Software Engineering 2(4): 293-300.Google Scholar
  23. Rapps, S. and Weyuker, E. 1985. Selecting software test data using data flow information, IEEE Trans. on Software Engineering 11(4): 367-375.Google Scholar
  24. Sait, S.M. 1999. Iterative Computer Algorithms with Applications in Engineering. Los Alamitos, CA, IEEE Computer Society.Google Scholar
  25. Stocks, P.A. and Carrington, D.A. 1993. Test template framework: a specification-based testing case study, Int. Conf. Software Engineering, May, pp. 405-414.Google Scholar
  26. Tai, K.-C. 1993. Predicate-based test generation for computer programs, Int. Conf. Software Engineering, pp. 267-276.Google Scholar
  27. Vidal, R.V.V. (ed.). 1993. Applied Simulated Annealing. Berlin, Springer.Google Scholar
  28. Whittaker, J.A. 2000. What is software testing? And why is it so hard?, IEEE Software 17(1): 70-79.Google Scholar
  29. Zhu, H., Hall, P.A. and May, J.H. 1997. Software unit test coverage and adequacy, ACM Computing Surveys 29(4): 366-423.Google Scholar

Copyright information

© Kluwer Academic Publishers 2004

Authors and Affiliations

  • Nashat Mansour
    • 1
  • Miran Salame
    • 1
  1. 1.Division of Computer Science and MathematicsLebanese American UniversityBeirutLebanon

Personalised recommendations