Title: Developing an ObjectOriented Software Testing and Maintenance Environment
1Developing an Object-Oriented Software Testing
and Maintenance Environment
2Summary of Problems In OO Testing
- The Understanding Problem
- The Complex Independency Problem
- The Object state Behavior Problem
- The tool support Problem
3The Understanding Problem
- Problem introduced by encapsulation and
information-hiding features. - This feature results in delocalized plan
- A delocalized plan have several member functions
from possibly several object classes invoked to
achieve an intended functionality. - Let us show this by an example ? InterViews
Library - Rectangles ? Member functions
- Edges ? Function invocations from left to
right
4- Table summarizes the number of invocation chains
of different lengths for InterViews library.
By a chain of member functions calling in
sequence we mean that the first function calls
the second, which calls the third and so
forth. Strategy The tester has to understand
the sequences of member functions and semantics
of the classes prior to preparing any test cases
or modifying the intended functionality.
5The complex Dependency Problem
- Caused by complex relationships(
inheritance,aggregation etc) that exist in an OO
program. - It is difficult to understand that a given class
in a large OO program if that class depends upon
many other classes. - A tested may not know where to start testing an
OO library. - It is extremely costly to construct test-stubs
- It is impossible to predict and test all
possible used of a template class. - It is difficult to identify and test the effect
of polymorphism and dynamic binding. - It is difficult to identify the changes impact in
OO maintenance since the impact may be ripple
throughout the program.
6The State Behavior Testing Program
- Effect of an operation on an object depends upon
the state of object and may change the state of
an object. - Let us try to understand this problem with an
example of a coin box of a vending machine
implemented in C. - It accepts only quarters and allows vending when
two quarters are received. - It keeps track of total quarters received,
current quarters received and whether vending
machine is enabled or not. - Functions mainly consists of
- Adding a quarter
- Returning the current quarters
- Resetting the coin box to initial state
- Vending
7(No Transcript)
8- Check the errors in the code? If a customer
requests that two quarters be returned after
inserting two quarters , he gets a free drink. - This error is only located if we apply object
state behavior testing method. - Approach
- From the source code , we derive the
state-dependent behavior of the objects. - Represent this information on OSD, object state
diagram. - Generate the test cases and test data from OSD
- Observe the output
9The Tool Support Problem
- CASE tools to support OO testing and maintenance
are still using conventional testing and
maintenance methods. - Tool support is crucial in the maintenance phase.
- OO testing is tedious process. Ripple effects are
common in OO programming. - Identification of changes and impact of changes
- Generation and / or reuse of test cases and test
data sets - Retesting only the parts that are changed and/ or
affected.
10Results of Efforts to Solve The Problems
- An OO test model and Reverse Engineering approach
to recover the designs of C programs - A three level schema and algorithm for data flow
testing of OO programs - Definition and identification of class firewalls
and test strategy for regression testing of C
programs - A program based method for object state behavior
testing - A scenario based method for integration and
acceptance testing - Part of these Results are implemented in an
integrated object-oriented testing and
maintenance (OOTM) environment
11OOTM
- Three Diagrams are extracted from code using
reverse engineering approach. - Object Relation Diagram ( ORD )
- Block Branch Diagram ( BBD )
- Object State Diagram (OSD )
- An ORD represents the inheritance, aggregation,
association, instantiations, uses, and nested
relationships. - A BBD represents the control structure of a
member functions so that tester know which data
is used and or updated. It can be used to prepare
functional test cases, structural test cases, and
test harness in member functions.
12- An OSD is like a state chart and represents the
state behavior of the objects. To reduce
complexity , we construct the a state machine for
each state-dependent data member of a class. The
state behavior of a class is represented by the
aggregation of the data members state machines.
13Fig ORD for a subset of InterViews Library
14Fig Class firewall for subset of Interviews
Library
15Use of Firewall tool
- Before making actual changes, a developer can use
the tool to identify the impact of the planned
changes and estimate the efforts in terms of
number of test stubs and test cases needed to
retest the affected classes. - After making the changes, a regression tester can
use the tool to identify the actual changes and
their impact. The tool can also compute the
optimal test order to retest the affected classes
16A nonflat state machine for the incorrect coin
Box class
17Test Tree showing the execution sequence of a
COSD.
18Usefulness of OO Test Model
- It helps the tester and maintainer understand the
structure of and relations between the components
of an OO program. - It provides the tester and maintainer a
systematic method to perform OOTM. - It facilitates the definition and analysis of OO
testing criteria. - It facilitates the development of various
algorithm and capabilities for OOTM