Académique Documents
Professionnel Documents
Culture Documents
Software
Testing
Strategies
Unit III
Software Testing
Testing is the process of exercising
a program with the specific intent of
finding errors prior to delivery to the
end user.
Unit III
Easy Language : :
Unit III
Unit III
This isChinaAirlines Airbus A300 crashing due to a software bug on April 26,
1994 killing 264 innocent lives.
Software bugs can potentially cause monetary and human loss, history is full
of such examples.
In 1985,Canada's Therac-25 radiation therapy machine malfunctioned due to
software bug and delivered lethal radiation doses to patients ,leaving 3 people
dead and critically injuring 3 others.
In April of 1999 ,a software bug caused the failure of a $1.2 billion military
satellite launch, the costliest accident in history.
In may of 1996, a software bug caused the bank accounts of 823 customers of
a major U.S. bank to be credited with 920 million US dollars.
As you see, testing is important because software bugs could be expensive or
even dangerous.
As Paul Elrich puts it - "To err is human, but to really foul things up you need a
computer.
an indication
of quality
Unit III
Example:
Unit III
Strategic Approach
Unit III
V&V
Unit III
developer
Understands the system
but, will test "gently"
and, is driven by "delivery"
Unit III
independent tester
Must learn about the system,
but, will attempt to break it
and, is driven by quality
9
Unit III
10
Unit III
11
Testing Strategy
For OO software
Unit III
Strategic Issues
Unit III
Unit III
14
The goal of unit testing is to isolate each part of the program and show that the
individual parts are correct. Unit testing is usually performed by the developer.
Unit Testing
module
to be
tested
results
software
engineer
Unit III
test cases
15
Unit III
16
Unit Testing
module
to be
tested
interface
local data structures
boundary conditions
independent paths
error handling paths
test cases
Unit III
17
Module
boundary conditions
independent paths
error handling paths
stub
stub
test cases
RESULTS
Unit III
18
looking to learn what functionality is provided by a unit and how to use it can look
at the unit tests to gain a basic understanding of the unit API.
Unit testing allows the programmer to refactor code at a later date, and make sure the module
still works correctly (i.e. Regression testing). The procedure is to write test cases for all
functions and methods so that whenever a change causes a fault, it can be quickly identified
and fixed.
Due to the modular nature of the unit testing, we can tests parts of project without waiting for
others to be completed.
testing can't be expected to catch every error in a program. It is not possible to evaluate
all execution paths even in the most trivial programs
Unit testing by its very nature focuses on a unit of code. Hence it can't catch integration errors
or broad system level errors.
Unit III
19
Unit III
20
Unit III
21
Example
Integration Test case differs from other test cases in the sense it focuses mainly on the
interfaces & flow of data/information between the modules. Here priority is to be given for
the integrating links rather than the unit functions which are already tested.
Sample Integration Test Cases for the following scenario: Application has 3 modules say
'Login Page', 'Mail box' and 'Delete mails' and each of them are integrated logically.
Here do not concentrate much on the Login Page testing as it's already been done in Unit
Testing. But check how it's linked to the Mail Box Page.
Similarly Mail Box: Check its integration to the Delete Mails Module.
Unit III
22
Disadvantages:
Fault
Localization is difficult.
Given the sheer number of interfaces that need to be tested in this approach, some
interfaces links to be tested could be missed easily.
Since the integration testing can commence only after "all" the modules are designed, testing
team will have less time for execution in the testing phase.
Since all modules are tested at once, high risk critical modules are not isolated and tested on
priority. Peripheral modules which deal with user interfaces are also not isolated and tested on
priority.
Unit III
23
Bottom Up Integration
In the bottom up strategy, each module at lower levels is
tested with higher modules until all modules are tested. It
takes help of Drivers for testing
Diagrammatic Representation:
Unit III
24
In
Incremental Approach:
this approach, testing is done by joining two or more modules that are logically
related. Then the other related modules are added and tested for the proper functioning.
Process continues until all of the modules are joined and tested successfully.
This
process is carried out by using dummy programs called Stubs and Drivers. Stubs
and Drivers do not implement the entire programming logic of the software module but
just simulate data communication with the calling module.
Stub:
Driver:
Incremental
Bottom Up
Top Down
Unit III
25
Bottom Up Integration
Advantages:
Fault
localization is easier.
No time is wasted waiting for all modules to be developed unlike Bigbang approach
Disadvantages:
Critical
Unit III
26
In Top to down approach, testing takes place from top to down following the
control flow of the software system.
Takes help of stubs for testing.
Unit III
27
Disadvantages:
Unit III
28
Regression Testing
Unit III
29
Smoke Testing
A build includes all data files, libraries, reusable modules, and engineered
components that are required to implement one or more product
functions.
A series of tests is designed to expose errors that will keep the build
from properly performing its function.
The intent should be to uncover show stopper errors that have the
highest likelihood of throwing the software project behind schedule.
The build is integrated with other builds and the entire product (in its
current form) is smoke tested daily.
The integration approach may be top down or bottom up.
Unit III
30
Object-Oriented Testing
Unit III
31
32
Unit III
33
OO Testing Strategy
Unit III
34
WebApp Testing - I
Unit III
35
WebApp Testing - II
Unit III
36
Validation testing
System testing
Performance Testing
Unit III
verifies that protection mechanisms built into a system will, in fact, protect it
from improper penetration
Stress testing
forces the software to fail in a variety of ways and verifies that recovery is
properly performed
Security testing
Recovery testing
Alpha/Beta testing
37
Unit III
38
Unit III
39
Debugging Effort
time required
to correct the error
and conduct
regression tests
Unit III
time required
to diagnose the
symptom and
determine the
cause
40
symptom
cause
Unit III
41
Consequences of Bugs
infectious
damage
catastrophic
extreme
serious
disturbing
mild
annoying
Bug Type
42
Debugging Techniques
brute force / testing
backtracking
induction
deduction
Unit III
43
Unit III
44
Final Thoughts
Unit III
45