skip to main content
article

Evolutionary testing of classes

Published:01 July 2004Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarCross RefCross Ref
  12. B. Korel. Automated software test data generation. IEEE Transactions on Software Engineering, 16(8):870--879, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. V. Massol and T. Husted. JUnit in Action. Manning Publications Co., Greenwich, Connecticut, USA, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle Scholar
  17. H. Sthamer. The Automatic Generation of Software Test Data Using Genetic Algorithms. PhD thesis, University of Glamorgan, Pontyprid, Wales, Great Britain, 1996.Google ScholarGoogle Scholar

Index Terms

  1. Evolutionary testing of classes

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGSOFT Software Engineering Notes
      ACM SIGSOFT Software Engineering Notes  Volume 29, Issue 4
      July 2004
      284 pages
      ISSN:0163-5948
      DOI:10.1145/1013886
      Issue’s Table of Contents
      • cover image ACM Conferences
        ISSTA '04: Proceedings of the 2004 ACM SIGSOFT international symposium on Software testing and analysis
        July 2004
        294 pages
        ISBN:1581138202
        DOI:10.1145/1007512

      Copyright © 2004 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 1 July 2004

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader