Friday, May 1, 2020

Test strategies for Object-Oriented Software

Test strategies for Object-Oriented Software

  • Introduction: The objective of testing, stated simply, is to find the greatest possible number of errors with a manageable amount of effort applied over a realistic time span.
  • Although this fundamental objective remains unchanged for objectoriented software.
  • The nature of object-oriented software changes both testing strategy and testing tactics (Plan).

Unit Testing in the OO Context

  • When object-oriented software is considered, the concept of the unit changes. Encapsulation drives the definition of classes and objects.
  • This means that each class and each instance of a class packages attributes (data) and the operations that manipulate these data.
  • An encapsulated class is usually the focus of unit testing.
  • However, operations (methods) within the class are the smallest testable units. Because a class can contain a number of different operations, and a particular operation may exist as part of a number of different classes.
  • Class testing for OO software is the equivalent of unit testing for conventional software.
  • Unlike unit testing of conventional software, which tends to focus on the algorithmic detail of a module and the data that flow across the module interface,
  • Class testing for OO software is driven by the operations encapsulated by the class and the state behavior of the class.

Integration Testing in the OO Context 

  • Different strategies for integration testing of OO systems.
    • Thread-based testing
    • use-based testing 
    • Cluster testing
  • The first, thread-based testing, integrates the set of classes required to respond to one input or event for the system.
  • Each thread is integrated and tested individually. 
  • Regression testing is applied to ensure that no side effects occur.
  • The second integration approach, use-based testing, begins the construction of the system by testing those classes (called independent classes) that use very few (if any) server classes.
  • After the independent classes are tested, the next layer of classes, called dependent classes, that use the independent classes are tested.
  • This sequence of testing layers of dependent classes continues until the entire system is constructed.

Cluster testing

  • Cluster testing is one step in the integration testing of OO software. 
  • Here, a cluster of collaborating classes is exercised by designing test cases that attempt to uncover errors in the collaborations. 

No comments:

Post a Comment