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
- Agitar Software, Inc. Agitator. http://www.agitar.com, 2006.Google Scholar
- 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 ScholarDigital Library
- Instantiations, Inc. CodePro. http://www.instantiations.com, March 2007.Google Scholar
- 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 ScholarCross Ref
- J. Koza. Genetic Programming: On the Programming of Computers by Means of Natural Selection. The MIT Press, 1992. Google ScholarDigital Library
- 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 Scholar
- P. McMinn and M. Holcombe. Evolutionary testing using an extended chaining approach. Evolutionary Computation, 14(1):41--64, 2006. Google ScholarDigital Library
- Parasoft, Inc. Jtest. http://www.parasoft.com.Google Scholar
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- J. Wegener, A. Baresel, and H. Sthamer. Evolutionary test environment for automatic structural testing. Information and Software Technology, 43(1):841--854, 2001.Google ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
Index Terms
Improving evolutionary class testing in the presence of non-public methods
Recommendations
Evolutionary unit testing of object-oriented software using strongly-typed genetic programming
GECCO '06: Proceedings of the 8th annual conference on Genetic and evolutionary computationEvolutionary algorithms have successfully been applied to software testing. Not only approaches that search for numeric test data for procedural test objects have been investigated, but also techniques for automatically generating test programs that ...
Object-Oriented Evolutionary Testing: A Review of Evolutionary Approaches to the Generation of Test Data for Object-Oriented Software
In Object-Oriented Evolutionary Testing, metaheuristics are employed to select or generate Test Data for Object-Oriented software. The application of search-based strategies to the Software Testing of Object-Oriented Software is fairly recent and is yet ...
A strategy for evaluating feasible and unfeasible test cases for the evolutionary testing of object-oriented software
AST '08: Proceedings of the 3rd international workshop on Automation of software testEvolutionary Testing is an emerging methodology for automatically producing high quality test data. The focus of our on-going work is precisely on generating test data for the structural unit-testing of object-oriented Java programs. The primary ...
Comments