Sie sind auf Seite 1von 47

Software Quality Assurance

Software Testing Strategies


Outline
■ Testing Strategy
■ W-Model
■ Unit testing
■ Integration Testing
■ System Testing
■ Acceptance Testing

Software Testing Techniques 2


Testing Strategy 1

 Testing Strategy outlines in broad terms


how to use testing to assess the extent
to which the goal for a product has
been met.

Software Testing Techniques 3


Testing Strategy 2

 Testing Strategy integrates software


test case designing methods into a well
planned series of steps that results in
the successful development of a
software.

Software Testing Techniques 4


Testing Strategy Characteristics
 Testing begins at component level and works
towards the integration of the entire system.
 Different testing techniques at different
points of time.
 Testing and debugging are different, but
debugging is accommodated in any testing
strategy.

Software Testing Techniques 5


Why Testing Strategy? 1

 Testing often takes more project effort


than any other software engineering
activity.
 If it is conducted haphazardly, time is
wasted, unnecessary effort is
expended, and even worse, errors
sneak through undetected.

Software Testing Techniques 6


Why Testing Strategy? 2

Testing Cost
Testing Cost
% of TotaL Project Cost

100
80
60
Testing Cost
40
20
0
Common Medium Involving human
life risk
Software Criticality

Software Testing Techniques 7


V&V
 Verification
 “Are we building the product right?”
 A set of activities that ensure that software
correctly implements a specific function.
 Validation
 “Are we building the right product?”
 A set of activities that ensure that the
software is traceable to customer
requirements.
Software Testing Techniques 8
Outline
■ Testing Strategy
■ V-Model
■ Unit testing
■ Integration Testing
■ System Testing
■ Acceptance Testing

Software Testing Techniques 9


Unit Testing 1

 Testing of the smallest unit of software


design i.e.; a module or a component.
 It is white-box oriented as well as
black-box.
 Unit Testing is normally done by the
developer of the unit.

Software Testing Techniques 10


Unit Testing 2

module
to be
tested

results
software
engineer test cases

Software Testing Techniques 11


Unit Testing: Driver and Stub
 The developer cannot test the module,
he/she is building independently.
 Module may interact with other modules that
are not yet developed.
 So, programmer uses the dummy
subprograms to test his module/ component
and these are stubs or driver.
 Driver and stubs are overhead.

Software Testing Techniques 12


Driver
 A driver is nothing more than a “Main
program” that,
 accepts test data,
 passes it to the component to be tested,
 and prints relevant results

Software Testing Techniques 13


Stub or Dummy Subprogram
 It serves to replace modules that are
subordinate (called by) the component
to be tested.
 It uses the subordinate module’s interface,
 may do little data manipulation,
 prints verification of entry,
 and returns control to the module
undergoing testing.
Software Testing Techniques 14
Driver and Stub
driver
interface
local data structures

module boundary conditions


independent paths
error handling paths

stub stub

test cases

RESULTS
Software Testing Techniques 15
Outline
■ Testing Strategy
■ V-Model and W-Model
■ Unit testing
■ Integration Testing
■ System Testing
■ Acceptance Testing

Software Testing Techniques 16


Integration 1

 Building a system or sub-system from


unit-tested components is called
integration.
 There are two approaches to integrate
a system:
1. Big-bang Approach
2. Incremental Approach

Software Testing Techniques 17


Integration 2

 Big-bang Approach
 Put all the components together at once,
at the same time.
 Incremental Approach
 Add components one by one.
 Two approaches are:
1. Top-down Integration
2. Bottom-up Integration

Software Testing Techniques 18


Integration Testing
 It is a systematic technique for
constructing the program structure
while at the same time conducting tests
to uncover errors associated with
interfacing.
 Integration testing should be black-box
testing with tests derived from the
specification.
Software Testing Techniques 19
Top-down Integration Testing
 Start with high-level system and
integrate from the top-down replacing
individual components by stubs where
appropriate.
 As Modules/ Components subordinate to the
main control module are incorporated into the
structure in either a depth-first or breadth-
first manner.

Software Testing Techniques 20


Top-down Integration Testing

Software Testing Techniques 21


Top-down Integration Process
1. The main control module is used as a test driver
and stubs are substituted for all components
directly subordinate to the main control module.
2. Depending on the integration approach selected
(depth-first or depth-first), subordinate modules
are replaced one at a time with actual components.
3. Tests are conducted as each component is
integrated.
4. On completion of each set of tests , another stub is
replaced with the real component.
5. Regression testing may be conducted to ensure
that new errors have not been introduced

Software Testing Techniques 22


Top-down Integration Testing
Component 1

Component 3 Component 4
Component 2

Component 5 Component 6 Component 7 Component 8


Order of testing interfaces
Step Interfaces tested
1 1-2
2 1-3
3 1-4
4 1-2-5
5 1-3-6
6 1-3-6-(3-7)
7 (1-2-5)-(1-3-6-(3-7))
8 1-4-8
9 (1-2-5)-(1-3-6-(3-7))-(1-4-8)
Top-down Integration:
Pros & Cons
 Pros
 Major decision points are verified early in the test
process.
 Using depth-first integration, a complete function of
the software may be implemented.
 Cons
 Stubs are required which are overhead.
 Problems occur when processing at low levels in the
hierarchy is required to test upper levels.
 No significant data flow upward in the program
structure until all the stubs are replaced by the actual
components.

Software Testing Techniques 25


Bottom-up Integration Testing
 Integrate individual components in levels until
the complete system is created.

Software Testing Techniques 26


Bottom-up Integration Process
 Low-level modules are combined into
clusters that perform a specific software
function.
 A driver is written to co-ordinate test case
input and output.
 The cluster is tested.
 Drivers are removed and clusters are
combined moving upwards in the program
structure.

Software Testing Techniques 27


Bottom-up Integration

Software Testing Techniques 28


Bottom-up Integration Testing
Component 8

Component 6 Component 7
Component 5

Component 1 Component 2 Component 3 Component 4


Order of testing interfaces
Step Interfaces tested
1 1-5
2 2-6, 3-6
3 2-6-(3-6)
4 4-7
5 1-5-8
6 2-6-(3-6)-8
7 4-7-8
8 (1-5-8)-(2-6-(3-6)-8)-(4-7-8)
Bottom-up Integration:
Pros & Cons
 Pros
 Processing required for components to a given
level is always available.
 The need for stubs is eliminated.
 As integration moves upward, the need for
separate test drivers lessens.
 Cons
 The program as an entity does not exist until the
last module is added.

Software Testing Techniques 31


Sandwich Testing
 In practice, most integration involves a
combination of bottom-up and top-down
integration testing approaches, called
Sandwich Testing.
 Top-down for upper levels.
 Bottom-up for lower levels.

Software Testing Techniques 32


A Final Picture
Bottom - Up Top - Down Big Bang Sandwich

Integration Early Early Early

Time to get Late Early Late Early


working
program

Drivers Yes No Yes Yes

Stub No Yes Yes Yes

Parallelism Medium Low High Medium

Test Easy Hard Easy Medium


specification

Product Easy Hard Easy Hard


control seq.

Software Testing Techniques 33


Regression Testing
 Each time a new module is added as part of
integration testing, or a bug is fixed in the
software, the software changes.
 These changes may introduce some new
defects.
 Regression testing is the re-execution of
some subset of tests that have already been
conducted to ensure that changes have not
generated unintended side effects.
Software Testing Techniques 34
Smoke Testing
 An integration testing approach used for
“shrink-wrapped” Softwares.
 Software components that have been translated into
code are integrated into a “build”.
 A series of tests is designed to expose errors that will
keep the build for properly performing its function. The
intent should be to uncover “show stopper” errors.
 The build is integrated with other builds and the entire
product is smoke tested daily.
 The integration approach may be top-down or bottom-
up.

Software Testing Techniques 35


Smoke Testing
 An integration testing approach used for
“shrink-wrapped” Softwares.
 Software components that have been translated into
code are integrated into a “build”.
 A series of tests is designed to expose errors that will
keep the build for properly performing its function. The
Synchronize
intent should be toand Stabilize
uncover approach
“show stopper” errors.
 The build is integrated with other builds and the entire
product is smoke tested daily.
 The integration approach may be top-down or bottom-
up.

Software Testing Techniques 36


Benefits of Smoke Testing
 Integration risk is minimized.
 The quality of the end-product is
improved.
 Error diagnosis and correction are
simplified.
 Progress is easier to assess.

Software Testing Techniques 37


Outline
■ Testing Strategy
■ V-Model and W-Model
■ Unit testing
■ Integration Testing
■ System Testing
■ Acceptance Testing

Software Testing Techniques 38


System Testing
 A series of tests to verify that all system
elements have been properly
integrated.
 A series of different tests whose
primary purpose is to fully exercise the
computer-based system.

Software Testing Techniques 39


System Testing Types 1

 Recovery Testing
 Forces software to fail in a variety of ways and
verifies that recovery is properly performed.
 Security Testing
 Attempts to verify the software’s protection
mechanisms. The software designer tries to
make penetration cost more than the value of
information obtained by breaking in.

Software Testing Techniques 40


System Testing Types 2

 Stress Testing
 Executes the system in a manner that demands
resources in abnormal quantity, frequency or
volume.
 Exercises the system beyond its maximum design
load.
 Sensitivity Testing
 Attempts to uncover data combination within valid
input classes that may cause instability or
improper processing.

Software Testing Techniques 41


System Testing Types 3

 Performance Testing
 To test the run time performance of a
system within the context of an integrated
system.
 Occurs throughout all steps in testing
process, means during unit testing and
integration testing etc.

Software Testing Techniques 42


Outline
■ Testing Strategy
■ V-Model and W-Model
■ Unit testing
■ Integration Testing
■ System Testing
■ Acceptance Testing

Software Testing Techniques 43


Acceptance Testing
 It provides final assurance that software
meets all functional, behavioral, and
performance requirements.
 Whether the software under test
functions in a manner that can
reasonably be expected by the
customer.
 Does it conforms to the specification?

Software Testing Techniques 44


Acceptance Testing Types
 Alpha Testing
 At developer’s site by customer.
 Beta Testing
 At customer’s site in a “live” environment.

Software Testing Techniques 45


References
 Sommerville, Ian “Software Engineering 6th
edition.”
 Pressman, Roger “Software Engineering, A
Practitioner’s Approach6th edition.”
 Mayer “The Art of Software Testing 2nd
edition.”
 …

Software Testing Techniques 46


Software Quality Assurance

Feel free to ask!

Thanks!

Das könnte Ihnen auch gefallen