Skip to main content
Log in

Data Generation for Path Testing

  • Published:
Software Quality Journal Aims and scope Submit manuscript

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.

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

  • Beizer, B. 1990. Software Testing Techniques. New York, Van Nostrand Reinhold.

    Google Scholar 

  • Clarke, L. 1976. A system to generate test data and symbolically execute programs, IEEE Trans. on Software Engineering 2(3): 215-222.

    Google Scholar 

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

  • DeMillo, R. and Offutt, A.J. 1991. Constraint-based automatic test data generation, IEEE Trans. on Software Engineering 17(9): 900-910.

    Google Scholar 

  • Duran, J. and Ntafos, S. 1984. An evaluation of random testing, IEEE Trans. on Software Engineering 10(4): 438-443.

    Google Scholar 

  • Garey, M. and Johnson, D. 1979. Computers and Intractability. New York, Freeman.

    Google Scholar 

  • Goldberg, D. 1989. Genetic Algorithms in Search, Optimization and Machine Learning. Reading, MA, Addison-Wesley.

    Google Scholar 

  • Graham, D. 1994. Testing, Encyclopedia of Software Engineering, ed. J.J. Marciniak, pp. 1330-1353. New York, Wiley.

    Google Scholar 

  • Hamlet, G. and Taylor, R. 1990. Partition testing does not inspire confidence, IEEE Trans. on Software Engineering 16(12): 1402-1411.

    Google Scholar 

  • Howden, W. 1977. Symbolic testing and the DISSECT symbolic evaluation system, IEEE Trans. on Software Engineering 4(4): 266-278.

    Google Scholar 

  • Howden, W. 1986. A functional approach to program testing and analysis, IEEE Trans. on Software Engineering 12(10): 997-1005.

    Google Scholar 

  • Jeng, B. 1994. Integrating data flow and domain testing, Asia-Pacific Software Engineering Conference, Tokyo, pp. 123-135.

  • 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 

  • Kirkpatrick, S., Gelatt, C.D. and Vecchi, M.P. 1983. Optimization by simulated annealing, Science 220(4598): 671-680.

    Google Scholar 

  • Korel, B. 1990. Automated software test generation, IEEE Trans. on Software Engineering 16(8): 870-879.

    Google Scholar 

  • Korel, B. 1992. Dynamic method for software test data and generation, J. of Software Testing, Verification, and Reliability 2: 203-213.

    Google Scholar 

  • Korel, B. and Al-Yami, A. 1996. Assertion-oriented automated test data generation, Int. Conf. Software Engineering, pp. 71-80.

  • 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 

  • McCabe, T. 1982. Structured Testing. Washington, DC, US Government Printing Office.

    Google Scholar 

  • 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 

  • 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 

  • 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 

  • 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 

  • Sait, S.M. 1999. Iterative Computer Algorithms with Applications in Engineering. Los Alamitos, CA, IEEE Computer Society.

    Google Scholar 

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

  • Tai, K.-C. 1993. Predicate-based test generation for computer programs, Int. Conf. Software Engineering, pp. 267-276.

  • Vidal, R.V.V. (ed.). 1993. Applied Simulated Annealing. Berlin, Springer.

    Google Scholar 

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

    Google Scholar 

  • 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 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Mansour, N., Salame, M. Data Generation for Path Testing. Software Quality Journal 12, 121–136 (2004). https://doi.org/10.1023/B:SQJO.0000024059.72478.4e

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/B:SQJO.0000024059.72478.4e

Navigation