





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of testing object-oriented software, discussing similarities and differences compared to procedural software, focusing on features such as state-dependent behavior, encapsulation, inheritance, and polymorphism. It also covers testing strategies and techniques for unit and inter-object class testing.
Typology: Study notes
1 / 37
This page cannot be seen from the preview
Don't miss anything!






























Prepared by
Stephen M. Thebaut, Ph.D.
University of Florida
Software Testing and Verification
Lecture 12
Software Test and Analysis: Process, Principles, and Techniques
, by Michal
Young and Mauro Pezze. Projectedpublication Spring 2007 by John Wiley& Sons.(Other sources are readily identifiablevia your favorite Internet searchengine.)
Such features include:^ –
the inherently
state dependent
behavior of methods,
of methods and state,
, and
and
run-time binding
of methods.
The impact of these features lessens astesting level increases, however.
We begin by briefly summarizing theissue(s) and testing related considerationsassociated with each of these features.
Next, we present simple models for unit(object class) and the initial instance ofintegration (inter-object class) testing.
Higher-level testing of object-orientedsystems is basically similar to that of othersystems, and is not considered further.
Thus, when testing object-orientedsoftware, techniques which assumestateless method behavior should beavoided.
How would one extend the input partitionand combinatorial test case designapproaches considered previously to dealwith state-dependent program behavior?
Ad-hoc adaptations of these approachesare straightforward when combined withstandard state machine models ofprogram behavior.
We discuss the use of such models whenconsidering object class testing.
to interpret the results of methods thatresult in hidden state changes, or toaccess methods that are themselvesprivate.
Inheritance is an
abstraction mechanism
that allows object classes to bespecialized or extended from one ormore other object classes.
The resultant child object class
inherits
attributes and methods
from these
ancestor classes, changing some, andadding others.
In general, testers must determine whennew tests must be designed, when oldtests can be re-run, and when re-testingcan be avoided all together.
Many object-oriented languages allow variables types
and
method bindings
to
change dynamically.
For example, when the generic elementsof object class “list” are dynamicallybound to particular types, list operationssuch as “append(value)” will be boundto particular methods.
“Unit testing” of object-oriented softwarenormally focuses on object classes asopposed to individual methods.
Methods often interact in altering objectstate, and their individual behavior can beobscured (due to encapsulation) whenconsidered in isolation.
Therefore, treating individual methods as“units” is usually not practical.
State machine models provide a useful meansfor describing object states and transitions.
States can be inferred from descriptions ofmethods that act differently or return differentresults depending on the state of the object.
Input partition and combinatorial test casedesign approaches may be applied on a state-by-state basis.
With method signatures: New
Stack
Push (Stack, Elem)
Stack
Top (Stack)
Elem
Retract (Stack)
Stack
Is_Empty (Stack)
Boolean