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.
Similar content being viewed by others
References
Beizer, B. 1990. Software Testing Techniques. New York, Van Nostrand Reinhold.
Clarke, L. 1976. A system to generate test data and symbolically execute programs, IEEE Trans. on Software Engineering 2(3): 215-222.
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.
Duran, J. and Ntafos, S. 1984. An evaluation of random testing, IEEE Trans. on Software Engineering 10(4): 438-443.
Garey, M. and Johnson, D. 1979. Computers and Intractability. New York, Freeman.
Goldberg, D. 1989. Genetic Algorithms in Search, Optimization and Machine Learning. Reading, MA, Addison-Wesley.
Graham, D. 1994. Testing, Encyclopedia of Software Engineering, ed. J.J. Marciniak, pp. 1330-1353. New York, Wiley.
Hamlet, G. and Taylor, R. 1990. Partition testing does not inspire confidence, IEEE Trans. on Software Engineering 16(12): 1402-1411.
Howden, W. 1977. Symbolic testing and the DISSECT symbolic evaluation system, IEEE Trans. on Software Engineering 4(4): 266-278.
Howden, W. 1986. A functional approach to program testing and analysis, IEEE Trans. on Software Engineering 12(10): 997-1005.
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.
Kirkpatrick, S., Gelatt, C.D. and Vecchi, M.P. 1983. Optimization by simulated annealing, Science 220(4598): 671-680.
Korel, B. 1990. Automated software test generation, IEEE Trans. on Software Engineering 16(8): 870-879.
Korel, B. 1992. Dynamic method for software test data and generation, J. of Software Testing, Verification, and Reliability 2: 203-213.
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.
McCabe, T. 1982. Structured Testing. Washington, DC, US Government Printing Office.
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.
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.
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.
Rapps, S. and Weyuker, E. 1985. Selecting software test data using data flow information, IEEE Trans. on Software Engineering 11(4): 367-375.
Sait, S.M. 1999. Iterative Computer Algorithms with Applications in Engineering. Los Alamitos, CA, IEEE Computer Society.
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.
Whittaker, J.A. 2000. What is software testing? And why is it so hard?, IEEE Software 17(1): 70-79.
Zhu, H., Hall, P.A. and May, J.H. 1997. Software unit test coverage and adequacy, ACM Computing Surveys 29(4): 366-423.
Author information
Authors and Affiliations
Rights 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
Issue Date:
DOI: https://doi.org/10.1023/B:SQJO.0000024059.72478.4e