Chapter 22: Software Testing Strategies
Chapter 22: Software Testing Strategies
VERIFICATION
AND
VALIDATION 1
(SQT)
Chapter 22: Software Testing Strategies
Unit testing begins at the vortex of the spiral and
concentrates on each unit (e.g., component or class) of the
software as implemented in source code.
Testing progresses by moving outward along the spiral to
integration testing, where the focus is on design and the
construction of the software architecture.
Taking another turn outward on the spiral, you encounter
validation testing, where client’s requirements are validated
against the software that has been constructed.
Finally, you arrive at system testing, where the software and
other system elements are tested as a whole along with
hardware requirements.
2
Testing within the context of software engineering is actually a
series of four steps that are implemented sequentially. The steps
are shown in Figure 22.2
3
Initially, tests focus on each component individually, ensuring
that it functions properly as a unit. Hence, the name unit
testing.
Integration testing addresses the issues associated with the
dual problems of verification and program construction.
After the software has been integrated (constructed), a set of
high-order tests is conducted. Validation testing provides final
assurance that software meets all functional, behavioral, and
performance requirements given by the client.
Software, once validated, must be combined with other system
elements (e.g., hardware, people, databases). System testing
verifies that all elements mesh properly and that overall
system function/performance is achieved.
4
CRITERIA FOR
5
COMPLETION OF
TESTING AND ITS
STRATEGIC ISSUES
A classic question arises every time software testing is
discussed: “When are we done testing—how do we know that
we’ve tested enough?”
Sadly, there is no definitive answer to this question
Following could be the responses to this question:
“You're never done testing; the burden simply shifts from you (the
software engineer) to the end user.”
“You’re done testing when you run out of time or you run out of
money.”
6
SOFTWARE
TESTING
7
STRATEGY—
THE BIG
PICTURE
Unit Testing
Unit Testing: Unit testing focuses verification effort on the
smallest unit of software design— the software component or
module.
Unit Test Considerations: Unit tests are illustrated
schematically in Figure 22.3
8
Unit-Test Procedures. Unit testing is normally considered as
an adjunct to the coding step. The design of unit tests can
occur before coding begins or after source code has been
generated.
The unit test environment is illustrated in Figure 22.4
9
Stubs are used in top down testing approach, when one has
the major module ready to test, but the sub modules are still
not ready yet. So in a simple language stubs are "called"
programs, which are called in to test the major module's
functionality.
For example, in a situation where one webpage has three
different modules: Login, Home, User. Suppose login module is
ready for test, but the two minor modules Home and User,
which are called by Login module are not ready yet for testing.
At this time, a piece of dummy code is written, which
simulates the called methods of Home and User. These
dummy pieces of code are the stubs.
10
On the other hand, Drivers are the ones, which are the
"calling" programs. Drivers are used in bottom up testing
approach. Drivers are dummy code, which is used when the
sub modules are ready but the main module is still not ready.
Taking the same example. Suppose this time, the User and
Home modules are ready, but the Login module is not ready to
test. Now since Home and User return values from Login
module, so a dummy piece of code is written, which simulates
the Login module. This dummy code is then called Driver.
11
CLASS ACTIVITY 02:
PRACTICE UNIT TESTING
Make a group of 3-4 people.
Tear a page out and your complete ID’s and full name on it.
Statement: Take into consideration any online software
application and identify its at-least five units to perform unit
testing.
Solution: Discussed on the board.
12
BOOK READING
Contents covered so far.
13