|
QW2000 Paper 2T1
Mr. Michael Silverstein (SilverMark, Inc.) Automating Testing of Object-Oriented Components Using Intelligent Test Artifacts
|
|
BACK TO QW2000 PROGRAM
Key Points
- Common patterns of component/object test automation
- How intelligent test artifacts as an architectural foundation can address common patterns of component/object testing,
speeding test development and reducing test maintenance
- Implementing intelligent test artifacts in Java
Abstract
Component
testing is the act of subdividing an object-oriented software system into units
of particular granularity, applying stimuli to the component’s interface and
validating the correct responses to those stimuli, in the form of either a state
change or reaction in the component, or elsewhere in the system.
In
the last few years, design patterns have become a currency for communicating
common problems and their solutions within a context. Testing is no exception.
Several publications have endeavored to document common design solutions to
component test automation problems in terms of design patterns.
This
article presents a set of design patterns commonly encountered when creating
automated test frameworks and application domain specific test cases, and
introduces the notion of test
artifacts as an abstract test component implementation model.
For
most types of component testing, the component test developer must eventually
find answers to one or more of the following questions, and possibly the
questions that their answers pose:
- How
do I create a specifically configured instance of a component under test?
- How
to I manage the application of a stimulus to the component under test?
- How
do I organize stimuli into reusable groups?
- How
to I validate the state of the component and system under test after one or
more stimuli?
- How
do I manage reference objects?
- How
do I compare references objects to target objects, so that just the
states that are important are compared?
- How
do I intelligently traverse the state of my object under test
- How
do I manage variations on test inputs in order to drive different paths with
the same test stimuli?
- How
do I verify that expected exceptions are raised?
- How
do I map development activities to the tests that validate their
correctness?
The
presentation describes several patterns for automated component test framework
and test case design, some familiar and some not, and introduces the notion of test
artifacts as a component architecture for implementing tests. Examples
use the Javaä programming language. These patterns include:
- Test
Component - Implement a reusable component model to represent
aspects of automated testing.
- Test
Sequence - Present a complete or commonly implemented subset of a test as a
discrete, reusable unit.
- Configured
Instance - Provide an instance of
an object configured to a particular state
- Test
Stimulus - Encapsulate a stimulus/response validation operation for a
component under test for singly or multiply threaded systems.
- State
Validation - Assert that a
component is in the expected state. Define this assertion as a reusable
component.
- Impression - Express a particular view of the state of a component in a
compact, but human readable form
- Nested
State - Provide a mechanism for specifying and traversing a chain of
object references to extract a specific state
- Aggregate
State - Represent the state of a
component in terms of an aggregate set or subset of the states of its
subcomponents.
- Object
Variation - Organize configured
object variations
About the Author
Michael
Silverstein is Lead Architect at SilverMark, Inc. (www.silvermark.com)
with responsibility for technical direction for SilverMark's Test Mentor™ line
of object-oriented automated testing tools for Java and Smalltalk. Michael
frequently advises customers on how to design automated tests, and has been
developing software for twenty years, the last eight of which using
object-oriented architectures and languages, including Smalltalk and Java™.
Before SilverMark, Michael worked on a variety of software development projects
at IBM, including the VisualAge development team. Michael can be reached at msilverstein@silvermark.com
(919) 858-8300 x29
BACK TO QW2000 PROGRAM