Testing: Instructor: Iqra Javed
Testing: Instructor: Iqra Javed
Testing
INSTRUCTOR: IQRA JAVED
2
Role of Testing
It examines the code and reasons over all behaviors that might
arise during run time
Examples: Code review, inspection, and algorithm analysis
Dynamic analysis
Verification
Evaluation of software system that help in determining whether the product of a
given development phase satisfy the requirements established before the start of
that phase
Building the product correctly
Validation
Evaluation of software system that help in determining whether the product meets
its intended use
Building the correct product
5
Failure, Error, Fault and Defect
Fault
A fault is the adjudged (declared) cause of an error
Error
Defect
It is synonymous of fault
It a.k.a. bug
Error
An error is a state of the system.
An error state could lead to a failure in the absence of any corrective action by the system
Failure
A failure is said to occur whenever the external behavior of a system does not conform to that
prescribed in the system specification
The Objectives of Testing
It does work:
Objective is to test that unit of code or system works
It does not work
Once working, next objective is to find faults in unit or system. The idea is to try to make the unit
(or the system) fail
ATM example:
< check balance, $500.00 >,
< withdraw, “amount?” >,
< $200.00, “$200.00” >,
< check balance, $300.00 >
9
Expected Outcome
The design issues may be too complex to completely test. I.e. Implicit Design
Decisions. Programmer may use a global variable to control program execution
It may not be possible to create all possible execution environments of the system
such as weather, temperature, altitude, pressure
The Central Issue in Testing
Unit testing
Individual program units, such as procedure, methods in isolation
Integration testing
Modules are assembled to construct larger subsystem and tested
System testing
Includes wide spectrum of testing such as functionality, and load
Acceptance testing
Customer’s expectations from the system
Two types of acceptance testing: UAT and BAT
UAT: System satisfies the contractual acceptance criteria
BAT: System will eventually pass the user acceptance test
Testing Level Cont.
Source Code
Input and output Domain
Operational Profile
Fault Model
Source of Information for Test Selection Cont.
Source Code
factorial(0) = 1;
factorial(1) = 1;
Factorial(n) = n * factorial(n-1);
A programmer may wrongly implement the factorial function as
factorial(n) = 1 * 2 * ... * n;
without considering the special case of n = 0.
Source of Information for Test Selection
Operational Profile
Quantitative characterization of how a system will be used
Test engineers select test cases (inputs) using samples of
system usage
This testing help to develop more reliable systems
Test inputs are assigned a probability distribution, or
profile, according to their occurrences in actual operation
Often used to test web applications
Source of Information for Test Selection
Fault Model
Scope
The domain or extent of the test activities