Contextual Integration Testing of Classes
This paper tackles the problem of structural integration testing of stateful classes. Previous work on structural testing of object-oriented software exploits data flow analysis to derive test requirements for class testing and defines contextual def-use
- PDF / 532,717 Bytes
- 15 Pages / 430 x 660 pts Page_size
- 72 Downloads / 186 Views
University of Milano-Bicocca, Dipartimento di Informatica, Sistemistica e Comunicazione, Via Bicocca degli Arcimboldi 8, 20126, Milano, Italy [email protected] 2 University of Lugano, Faculty of Informatics, via Buffi 13, 6900, Lugano, Switzerland [email protected], [email protected]
Abstract. This paper tackles the problem of structural integration testing of stateful classes. Previous work on structural testing of objectoriented software exploits data flow analysis to derive test requirements for class testing and defines contextual def-use associations to characterize inter-method relations. Non-contextual data flow testing of classes works well for unit testing, but not for integration testing, since it misses definitions and uses when properly encapsulated. Contextual data flow analysis approaches investigated so far either do not focus on state dependent behavior, or have limited applicability due to high complexity. This paper proposes an efficient structural technique based on contextual data flow analysis to test state-dependent behavior of classes that aggregate other classes as part of their state.
1
Introduction
Object-oriented programs are characterized by classes and objects, which enforce encapsulation and behave according to their internal state. Object-oriented features discipline programming practice, and reduce the impact of some critical classes of faults, for instance those that derive from excessive use of non-local information or from unexpected access to hidden details. However, they introduce new behaviors that cannot be checked satisfactorily with classic testing techniques, which assume procedural models of software [1]. In this paper, we focus on structural testing of state-based behavior, which impacts on both unit and integration testing of classes. The most promising structural approaches to testing object oriented software exploit data flow analysis to implicitly capture state-based interactions. Harrold and Rothermel proposed data flow analysis for structural testing of classes in 1994 [2]. In their early work, Harrold and Rothermel define a class control flow graph to model data flow interactions within classes, and apply data flow analysis to characterize such interactions in terms of flow relations of class state
This work has been partially funded by the European Commission through the project SHADOWS, by the Italian Government through the project COMMUTA and by the Swiss National Fund through the project PerSeoS.
J. Fiadeiro and P. Inverardi (Eds.): FASE 2008, LNCS 4961, pp. 246–260, 2008. c Springer-Verlag Berlin Heidelberg 2008
Contextual Integration Testing of Classes
247
variables. This analysis supports well unit testing, but does not apply satisfactorily to integration testing of classes. In fact, when accesses to state variables are properly encapsulated, standard data flow analysis does not distinguish chains of interactions that flow through different methods, thus missing several integration dependencies, and in particular dependencies of classes that agg
Data Loading...