Software Testing Notes
Software Testing Notes
Software Testing Notes
Tested Subsystem
Subsystem Unit
Code Test
All tests by developer
levels of testing
TESTING ACTIVITIES CONTINUED
Client’s
Global Understanding User
Requirements of Requirements Environment
Validated Accepted
Functioning
System
System PerformanceSystem Acceptance Installation
Test Test Test
Usable
Tests by client System
Tests by developer
User’s understanding
System in
Use
Tests (?) by user
Level of abstraction LEVELS OF TESTING IN V MODEL
system system
requirements integration
software acceptance
requirements test
preliminary software
design integration
detailed component
design test
Time
N.B.: component test vs. unit test; acceptance test vs. system integration
TEST PLANS
The goal of test planning is to establish the list of tasks
which, if performed, will identify all of the requirements
that have not been met in the software. The main work
product is the test plan.
The test plan documents the overall approach to the test. In
many ways, the test plan serves as a summary of the test
activities that will be performed.
It shows how the tests will be organized, and outlines all of the
testers’ needs which must be met in order to properly carry out
the test.
The test plan should be inspected by members of the
engineering team and senior managers.
TEST PLANNING
A Test Plan:
covers all types and phases of testing
guides the entire testing process
who, why, when, what
developed as requirements, functional specification, and high-
level design are developed
should be done before implementation starts
A test plan includes:
test objectives
schedule and logistics
test strategies
test cases
procedure
data
expected result
procedures for handling problems
FAULT HANDLING TECHNIQUES
Fault Handling
Fault Tolerance
Fault Avoidance Fault Detection
Configuration
Verification
Management
Testing Debugging
Usability Testing
Atomic Modular
Configuration Transactions Redundancy
Verification
Management
Fault Detection
Reviews
Debugging
Walkthrough Inspection
Testing
Correctness Performance
Unit Integration System Debugging Debugging
Testing Testing Testing
CATEGORIES OF TESTING
Typically Testing is classified into three categories.
Functional Testing
•Regression
Maintenance
•Maintenance
TYPES OF TESTING
Unit Testing:
Individual subsystem
Carried out by developers
Goal: Confirm that subsystems is correctly coded and
carries out the intended functionality
Integration Testing:
Groups of subsystems (collection of classes) and eventually
the entire system
Carried out by developers
Goal: Test the interface among the subsystem
SYSTEM TESTING
System Testing:
The entire system
Carried out by developers
Goal: Determine if the system meets the requirements
(functional and global)
Acceptance Testing:
Evaluates the system delivered by developers
Carried out by the client. May involve executing typical
transactions on site on a trial basis
Goal: Demonstrate that the system meets customer
requirements and is ready to use
Dynamic Analysis:
Black-box testing (Test the input/output behavior)
White-box testing (Test the internal logic of the subsystem
or object)
Data-structure based testing (Data types determine test
cases)
LOOP TESTING
Simple
loop
Nested
Loops
Concatenated
Loops Unstructured
Loops
Question: Why is loop testing important? Discuss
CONSTRUCTING THE LOGIC FLOW DIAGRAM
Start
F
2
T
3
T F
4 5
7
T F
8 9
Exit
FINDING THE TEST CASES
Start
1
a (Covered by any data)
2
b (Data set must contain at least one value)
(Positive score) d 3
e (Negative score)
c 4 5
(Data set must h (Reached if either f or
be empty) f g
6 e is reached)
Next module
GUIDANCE FOR TEST CASE SELECTION
Use analysis knowledge Use implementation
about functional knowledge about
requirements (black-box algorithms:
testing):
Use cases Examples:
Expected input data Force division by zero
Invalid input data Use sequence of test cases
Use design knowledge for interrupt handler
about system structure,
algorithms, data
structures (white-box
testing):
Control structures
Test branches, loops, ...
Data structures
Test records fields, arrays,
...
UNIT-TESTING HEURISTICS
1. Create unit tests as soon as 4. Desk check your source code
object design is completed: Reduces testing time
A failure?
An error?
A fault?
Need to specify
the desired behavior first!
ERRONEOUS STATE (―ERROR‖)
ALGORITHMIC FAULT
MECHANICAL FAULT
HOW DO WE DEAL WITH ERRORS AND
FAULTS?
VERIFICATION?
MODULAR REDUNDANCY?
DECLARING THE BUG
AS A FEATURE?
PATCHING?
TESTING?
TESTING TAKES CREATIVITY
Testing often viewed as dirty work.
To develop an effective test, one must have:
Detailed understanding of the system
Knowledge of the testing techniques
Skill to apply these techniques in an effective and efficient manner
Testing is done best by independent testers
We often develop a certain mental attitude that the program
should in a certain way when in fact it does not.
Programmer often stick to the data set that makes the
program work
"Don’t mess up my code!"
A program often does not work when tried by somebody
else.
Don't let this be the end-user.
EXAMPLES OF TEST CASES