skip to main content
10.1145/1321631.1321689acmconferencesArticle/Chapter ViewAbstractPublication PagesaseConference Proceedingsconference-collections
poster

Improving evolutionary class testing in the presence of non-public methods

Published:05 November 2007Publication History

ABSTRACT

Automating the generation of object-oriented unit tests is a challenging task. This is mainly due to the complexity and peculiarities that the principles of object-orientation imply. One of these principles is the encapsulation of class members which prevents non-public methods and attributes of the class under test from being freely accessed.

This paper suggests an improvement of our automated search-based test generation approach which particularly addresses the test of non-public methods. We extend our objective functions by an additional component that accounts for encapsulation. Additionally, we propose a modification of the search space which increases the efficiency of the approach. The value of the improvement in terms of achieved code coverage is demonstrated by a case study with 7 real-world test objects. In contrast to other approaches which break encapsulation in order to test non-public methods, the tests generated by our approach inherently guarantee that class invariants are not violated. At the same time, refactorings of the encapsulated class members will not break the generated tests

References

  1. Agitar Software, Inc. Agitator. http://www.agitar.com, 2006.Google ScholarGoogle Scholar
  2. S. Beydeda and V. Gruhn. Bintest - binary search-based test case generation. In Computer Software and Applications Conference (COMPSAC). IEEE Computer Society Press, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Instantiations, Inc. CodePro. http://www.instantiations.com, March 2007.Google ScholarGoogle Scholar
  4. B. F. Jones, H. Sthamer, and D. E. Eyres. Automatic test data generation using genetic algorithms. Software Engineering Journal, 11(5):299--306, September 1996.Google ScholarGoogle ScholarCross RefCross Ref
  5. J. Koza. Genetic Programming: On the Programming of Computers by Means of Natural Selection. The MIT Press, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. X. Liu, B. Wang, and H. Liu. Evolutionary search in the context of object-oriented programs. In MIC2005: The Sixth Metaheuristics International Conference, September 2005.Google ScholarGoogle Scholar
  7. P. McMinn and M. Holcombe. Evolutionary testing using an extended chaining approach. Evolutionary Computation, 14(1):41--64, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Parasoft, Inc. Jtest. http://www.parasoft.com.Google ScholarGoogle Scholar
  9. R. P. Pargas, M. J. Harrold, and R. R. Peck. Test-data generation using genetic algorithms. Journal of Software Testing, Verification and Reliability, 9(4):263--282, 1999.Google ScholarGoogle ScholarCross RefCross Ref
  10. K. Sen and G. Agha. Cute and jcute: Concolic unit testing and explicit path model-checking tools. In 18th International Conference on Computer Aided Verification (CAV'06), Lecture Notes in Computer Science. Springer, 2006. (To Appear. Tool Paper). Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. P. Tonella. Evolutionary testing of classes. In ISSTA '04: Proceedings of the 2004 ACM SIGSOFT international symposium on Software testing and analysis, pages 119--128, New York, NY, USA, 2004. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. W. Visser, CS. Pasareanu, and S. Khurshid. Test input generation with Java PathFinder. In ISSTA '04: Proceedings of the 2004 ACM SIGSOFT international symposium on Software testing and analysis, pages 97--107, New York, NY, USA, 2004. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Wappler and F. Lammermann. Using evolutionary algorithms for the unit testing of object-oriented software. In GECCO '05: Proceedings of the 2005 conference on Genetic and evolutionary computation, pages 1053--1060, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Wappler and J. Wegener. Evolutionary unit testing of object-oriented software using a hybrid evolutionary algorithm. In Proceedings of the IEEE World Congress on Computational Intelligence (WCCI-2006), pages 3193--3200, Vancouver, Canada, July 2006. IEEE Press.Google ScholarGoogle ScholarCross RefCross Ref
  15. S. Wappler and J. Wegener. Evolutionary unit testing of object-oriented software using strongly-typed genetic programming. In GECCO '06: Proceedings of the 2006 conference on Genetic and evolutionary computation, pages 1925--1932, New York, NY, USA, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. J. Wegener, A. Baresel, and H. Sthamer. Evolutionary test environment for automatic structural testing. Information and Software Technology, 43(1):841--854, 2001.Google ScholarGoogle ScholarCross RefCross Ref
  17. G. C. Wilson, A. McIntyre, and M. I. Heywood. Resource review: Three open source systems for evolving programs: Lilgp, ecj and grammatical evolution. Genetic Programming and Evolvable Machines, 5(1):103--105, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. T. Xie, D. Marinov, W. Schulte, and D. Notkin. Symstra: A framework for generating object-oriented unit tests using symbolic execution. In Proceedings of the 11th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS 05), pages 365--381, April 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Improving evolutionary class testing in the presence of non-public methods

    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
    • Published in

      cover image ACM Conferences
      ASE '07: Proceedings of the 22nd IEEE/ACM International Conference on Automated Software Engineering
      November 2007
      590 pages
      ISBN:9781595938824
      DOI:10.1145/1321631

      Copyright © 2007 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: 5 November 2007

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • poster

      Acceptance Rates

      Overall Acceptance Rate82of337submissions,24%

      Upcoming Conference

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader