0% found this document useful (0 votes)
43 views1 page

The Test Case Design Implications of OO Concepts

1. Testing object-oriented systems presents some challenges due to encapsulation and inheritance. Encapsulation makes it difficult to obtain the state of an object, and inheritance means that subclasses may need to be retested even when code is reused. 2. Different testing techniques can be applied to object-oriented systems, including basis path testing, data flow testing, and black-box testing. However, the concise structure of class operations means white-box testing efforts may be better spent on class-level tests. 3. Fault-based testing of object-oriented systems involves designing tests that have a high likelihood of finding plausible faults, based on an analysis of requirements and the system design. Test cases are created to

Uploaded by

Hardik Patel
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views1 page

The Test Case Design Implications of OO Concepts

1. Testing object-oriented systems presents some challenges due to encapsulation and inheritance. Encapsulation makes it difficult to obtain the state of an object, and inheritance means that subclasses may need to be retested even when code is reused. 2. Different testing techniques can be applied to object-oriented systems, including basis path testing, data flow testing, and black-box testing. However, the concise structure of class operations means white-box testing efforts may be better spent on class-level tests. 3. Fault-based testing of object-oriented systems involves designing tests that have a high likelihood of finding plausible faults, based on an analysis of requirements and the system design. Test cases are created to

Uploaded by

Hardik Patel
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1 The Test Case Design Implications of OO Concepts

As we have already seen, the OO class is the target for test case design. Because attributes and operations are encapsulated, testing operations outside of the class is generally unproductive. Although encapsulation is an essential design concept for OO, it can create a minor obstacle when testing. As Binder [BIN94a] notes, Testing requires reporting on the concrete and abstract state of an object. Yet, encapsulation can make this information somewhat difficult to obtain. Unless built-in operations are provided to report the values for class attributes, a snapshot of the state of an object may be difficult to acquire. Inheritance also leads to additional challenges for the test case designer. We have already noted that each new context of usage requires retesting, even though reuse has been achieved. In addition, multiple inheritance3 complicates testing further by increasing the number of contexts for which testing is required [BIN94a]. If subclasses instantiated from a superclass are used within the same problem domain, it is likely that the set of test cases derived for the superclass can be used when testing the subclass. However, if the subclass is used in an entirely different context, the superclass test cases will have little applicability and a new set of tests must be designed. 2. Basis path, loop testing, or data flow techniques can help to ensure that every statement in an operation has been tested. However, the concise structure of many class operations causes some to argue that the effort applied to white-box testing might be better redirected to tests at a class level. Black-box testing methods are as appropriate for OO systems as they are for systems developed using conventional software engineering methods. As we noted earlier in this chapter, use-cases can provide useful input in the design of black-box and state-based tests

3. Fault-Based Testing4
The object of fault-based testing within an OO system is to design tests that have a high likelihood of uncovering plausible faults. Because the product or system must conform to customer requirements, the preliminary planning required to perform faultbased testing begins with the analysis model. The tester looks for plausible faults (i.e., aspects of the implementation of the system that may result in defects). To determine whether these faults exist, test cases are designed to exercise the design or code. 4.

You might also like