Intra-Class Testing of Abstract Class Features

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. Such classes defer the implementation of some features, and are typically used as a specification or design tool. However, since their features are not fully implemented, abstract classes cannot be instantiated, and thus pose challenges for execution-based testing strategies. This paper presents a structured approach that supports the testing of features in abstract classes. Core to the approach is a series of static analysis steps that build a comprehensive view of the inter-class dependencies in the system under test. We then leveraged this information to define a test order for the methods in an abstract class that minimizes the number of stubs required during testing, and clearly identifies the required functionality of these stubs. Our approach is based on a comprehensive taxonomy of object-oriented classes that provides a framework for our analysis. First we describe the algorithms to calculate the inter-class dependencies and the test-order that minimizes stub creation. Then we give an overview of our tool, AbstractTestJ that implements our approach by generating a test order for the methods in an abstract Java class. Finally, we harness this tool to provide an analysis of 12 substantial Java applications that demonstrates both the feasibility of our approach and the importance of this technique.

[1]  Peter J. Clarke,et al.  TaxTOOLJ: A Tool to Catalog Java Classes , 2006, SEKE.

[2]  John D. McGregor,et al.  Incremental testing of object-oriented class structures , 1992, ICSE '92.

[3]  Antero Taivalsaari,et al.  On the notion of inheritance , 1996, CSUR.

[4]  John D. McGregor,et al.  A Practical Guide to Testing Object-Oriented Software , 2001, Addison Wesley object technology series.

[5]  Peter J. Clarke,et al.  A parameterized cost model to order classes for class-based testing of C++ applications , 2003, 14th International Symposium on Software Reliability Engineering, 2003. ISSRE 2003..

[6]  Robert V. Binder,et al.  Testing Object-Oriented Systems: Models, Patterns, and Tools , 1999 .

[7]  Robert C. Martin Agile Software Development, Principles, Patterns, and Practices , 2002 .

[8]  Lionel C. Briand,et al.  Revisiting strategies for ordering class integration testing in the presence of dependency cycles , 2001, Proceedings 12th International Symposium on Software Reliability Engineering.

[9]  Liangliang Kong,et al.  The Extension of the Unit Testing Tool Junit for Special Testings , 2006, First International Multi-Symposiums on Computer and Computational Sciences (IMSCCS'06).

[10]  Jean-Marc Jézéquel,et al.  Efficient object-oriented integration and regression testing , 2000, IEEE Trans. Reliab..

[11]  Peter J. Clarke,et al.  A Taxonomy of OO Classes to Support the Mapping of Testing Techniques to a Class , 2005, J. Object Technol..

[12]  John D. McGregor,et al.  Incremental Testing Of Object-Oriented Class Structures/spl dagger/ , 1992, International Conference on Software Engineering.

[13]  Guy L. Steele,et al.  Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley)) , 2005 .

[14]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[15]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[16]  Peter J. Clarke,et al.  Using a taxonomy to analyze classes during implementation-based testing , 2004, IASTED Conf. on Software Engineering and Applications.