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

  • Authors:
  • Stefan Wappler;Ina Schieferdecker

  • Affiliations:
  • Technical University of Berlin, Berlin, UNK, Germany;Technical University of Berlin, Berlin, UNK, Germany

  • Venue:
  • Proceedings of the twenty-second IEEE/ACM international conference on Automated software engineering
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

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