ABSTRACT
Object oriented programming promotes reuse of classes in multiple contexts. Thus, a class is designed and implemented with several usage scenarios in mind, some of which possibly open and generic. Correspondingly, the unit testing of classes cannot make too strict assumptions on the actual method invocation sequences, since these vary from application to application.In this paper, a genetic algorithm is exploited to automatically produce test cases for the unit testing of classes in a generic usage scenario. Test cases are described by chromosomes, which include information on which objects to create, which methods to invoke and which values to use as inputs. The proposed algorithm mutates them with the aim of maximizing a given coverage measure. The implementation of the algorithm and its application to classes from the Java standard library are described.
- A. Baresel, H. Sthamer, and M. Schmidt. Fitness function design to improve evolutionary structural testing. In Proceedings of the Genetic and Evolutionary Computation Conference, GECCO-2002, New York, USA, July 2002. Google ScholarDigital Library
- B. Baudry, F. Fleurey, J.-M. Jézéquel, and Y. Le Traon. Genes and bacteria for automatic test cases optimization in the .NET environment. In Proc. of the 13th International Symposium on Software Reliability (ISSRE), pages 195--206, Annapolis, Maryland, USA, November 2002. IEEE Computer Society. Google ScholarDigital Library
- B. Baudry, V. Le Hanh, J.-M. Jézéquel, and Y. Le Traon. Building trust into OO components using a genetic analogy. In Proc. of the 11th International Symposium on Software Reliability (ISSRE), pages 4--14, San Jose, California, USA, October 2000. IEEE Computer Society. Google ScholarDigital Library
- C. Boyapati, S. Khurshid, and D. Marinov. Korat: Automated testing based on java predicates. In Proceedings of the ACM International Symposium on Software Testing and Analysis (ISSTA), pages 123--133. ACM Press, July 2002. Google ScholarDigital Library
- U. Buy, A. Orso, and M. Pezzè. Automated testing of classes. In Proceedings of the International Symposium on Software Testing and Analysis (ISSTA 2000), Portland, OR, USA, August 2000. Google ScholarDigital Library
- M. D. Ernst, J. Cockrell, W. G. Griswold, and D. Notkin. Dynamically discovering likely program invariants to support program evolution. IEEE Transactions on Software Engineering, 27(2):1--25, 2001. Google ScholarDigital Library
- R. Ferguson and B. Korel. The chaining approach for software test data generation. ACM Transactions on Software Engineering and Methodology, 5(1):63--86, January 1996. Google ScholarDigital Library
- M. J. Gallagher and V. L. Narasimhan. ADTEST: a test data generation suite for ada software systems. IEEE Transactions on Software Engineering, 23(8):473--484, 1997. Google ScholarDigital Library
- N. Gupta, A. Mathur, and M. L. Soffa. Generating test data for branch coverage. In Proc. of 15th IEEE International Conference on Automated Software Engineering (ASE'2000), Grenoble, France, September 2000. IEEE Computer Society. Google ScholarDigital Library
- N. Gupta, A. P. Mathur, and M. L. Soffa. Automated test data generation using an iterative relaxation method. In Proceedings of the 6th International Symposium on Foundations of Software Engineering (FSE), pages 232--244, Orlando, Florida, USA, November 1998. ACM Press. Google ScholarDigital Library
- J. Henkel and A. Diwan. Discovering algebraic specifications from java classes. In Proceedings of the 17th European Conference on Object-Oriented Programming (ECOOP), pages 431--456. Springer, July 2003.Google ScholarCross Ref
- B. Korel. Automated software test data generation. IEEE Transactions on Software Engineering, 16(8):870--879, 1990. Google ScholarDigital Library
- B. Korel. Automated test data generation for programs with procedures. In Proceedings of the International Symposium on Software Testing and Analysis (ISSTA 1996), pages 209--215. ACM Press, August 1996. Google ScholarDigital Library
- V. Massol and T. Husted. JUnit in Action. Manning Publications Co., Greenwich, Connecticut, USA, 2003. Google ScholarDigital Library
- C. C. Michael and G. McGraw. Automated software test data generation for complex programs. In Proc. of IEEE International Conference on Automated Software Engineering (ASE'98), pages 136--146. IEEE Computer Society, 1998. Google ScholarDigital Library
- R. Pargas, M. J. Harrold, and R. Peck. Test-data generation using genetic algorithms. Journal of Software Testing, Verifications, and Reliability, 9:263--282, September 1999.Google Scholar
- H. Sthamer. The Automatic Generation of Software Test Data Using Genetic Algorithms. PhD thesis, University of Glamorgan, Pontyprid, Wales, Great Britain, 1996.Google Scholar
Index Terms
- Evolutionary testing of classes
Recommendations
Evolutionary testing of classes
Object oriented programming promotes reuse of classes in multiple contexts. Thus, a class is designed and implemented with several usage scenarios in mind, some of which possibly open and generic. Correspondingly, the unit testing of classes cannot make ...
Using evolutionary algorithms for the unit testing of object-oriented software
GECCO '05: Proceedings of the 7th annual conference on Genetic and evolutionary computationAs the paradigm of object orientation becomes more and more important for modern IT development projects, the demand for an automated test case generation to dynamically test object-oriented software increases. While search-based test case generation ...
A testing strategy for abstract classes
One of the characteristics of the increasingly widespread use of object-oriented libraries and the resulting intensive use of inheritance is the proliferation of dependencies on abstract classes. Since abstract classes cannot be instantiated, they ...
Comments