Lect 16
Lect 16
04/19/25 1
Test Levels
• Unit testing
Test each module (unit, or component) independently
• Acceptance testing
Validation of system functions by the customer
04/19/25 2
Types of System Testing
Performance test
Beta
Acceptance test
04/19/25 3
Performance test
• Determines whether a system or subsystem
meets its non-functional requirements:
• Response times
• Throughput
• Usability
• Stress
• Recovery
• Configuration,
• Safety etc.
04/19/25 4
04/19/25 5
Overview of Testing Activities
Subsystem Unit
Code Test
Tested
Subsystem
Subsystem Unit
Code Test
Tested Integration Functional
Subsystem
Test Test Functioning
Integrated System
Subsystems
Tested Subsystem
Module Unit
Spec Test
04/19/25 6
User Acceptance Testing
04/19/25 7
Who Tests Software?
• Programmers:
Unit testing
Test their own or other programmers’ code
• Users:
Usability and acceptance testing
Volunteers atypically test beta versions
• Correct errors.
Develope
r
04/19/25 9
Perspectives of Different Testers
Ack www.zelger.org
04/19/25 10
Verification versus Validation
04/19/25 12
Verification and Validation Techniques
• Simulation
• Unit testing
• Integration
testing
04/19/25 13
Verification Validation
Are you building it Have you built the right
right? thing?
Checks whether an Checks the final product
artifact conforms to its against the specification.
previous artifact.
04/19/25 15
Test How Long?
One way:
#
Bugs
Time
• Another way:
Seed bugs… run test cases
04/19/25 17
3 Test Types
Actual output
compared
… requirements Black box with
required output
White
box Confirmation
…Code of expected
behavior
04/19/25 18
Why Thorough Testing is Hard?
F F F F
I I I I
L L L L
T T T T
E E E E
R R R R
04/19/25 22
Capers Jones Rule of Thumb
Capers Jones
04/19/25 23
Pesticide Effect: Example
Design
Coding
Testing
Maintenance
04/19/25 27
Quiz: Solution
1. When are verification undertaken in waterfall model?
Feasibility Study
Verification
Req. Analysis
Design
Validation
Coding
Testing
Maintenance
04/19/25 28
How Many Latent Errors?
“Relax, our
engineers found
and have
corrected
85% of the
flaws.”
04/19/25 30
Testing Strategy
04/19/25 31
Test Plan Document: Overall Structure
32
Testing Strategy
• Part of any Test Strategy is to decide on
which tests to deploy:
1. Collect information to address and choose a test
model:
• Usage–based testing (based on customers’ actual usage
patterns)
• White-box testing (guided by black box testing results)
• Mutation testing (programming language, past
experience, etc.)
15%
10%
10%
10% 10%
04/19/25 F1 F2 F3 F4 F5 F6 36
Test Document: Recording the Test suite
04/19/25 39
When and Why of Unit Testing?
04/19/25 40
Why unit test?
Debugging costs
increase substantially…
PROCEDURE
STUB CALL DRIVER
CALL UNDER TEST
04/19/25 42
Quiz
Validation?
04/19/25 43
Design of Unit Test Cases
Grey-box approach
04/19/25 44
Black-Box Testing
04/19/25 46
Black-Box Testing
Combinatorial testing
04/19/25 47
White-Box Testing
• Several white-box testing strategies have
become very popular :
Statement coverage
Branch coverage
Path coverage
Condition coverage
MC/DC coverage
Mutation testing
Data flow-based testing
04/19/25 48
Evolution of Testing Tools
1960- 1990-2000 2000-
1990
AI-Based
Testing
Solutions
Scripting
Capture and
Replay
Persistence
Junit/SQLUnit/XMLUnit
Layer
04/19/25 50
04/19/25 51
Capture/Playback Tools
• Automated test tools mimic the actions of the
tester.
• During testing, the tester uses the keyboard and
mouse to perform specific tests or actions.
• Testing tool captures all keystrokes and results:
Baselined in a test script.
• 2 Open a test:
To create a new test,
click on New
To open an existing test,
click on Open
Sprint\zXC
abcde
04/19/25 54
Design of Test Cases
04/19/25 55
Design of Test Cases
04/19/25 56
Design of Test Cases
04/19/25 57
Design of Test Cases
04/19/25 58
Design of Test Cases
04/19/25 59
Design of Test Cases
Grey-box testing
04/19/25 60
Black-box
Testing
03/08/10
04/19/25 61 61
Black Box Testing
04/19/25 63
Back Box Testing:
Equivalence Class Testing
03/08/10
04/19/25 64 64
Why Define Equivalence Classes?
E2 E3
E1
• Premise:
Testing code with any one
representative value from an
equivalence class is:
04/19/25 65
Equivalence Class Partitioning
04/19/25 66
Equivalence Class Partitioning
04/19/25 67
Equivalence Partitioning
• First-level partitioning:
Valid vs. Invalid test cases
Valid Invalid
68
04/19/25
Equivalence Partitioning
Invalid
Valid
69
04/19/25
Equivalence Partitioning
Invalid
Valid
70
04/19/25
Equivalence Class Partitioning
71
04/19/25
Equivalence Class Partitioning
• Define:
One equivalence class for valid input values.
04/19/25
Single Multiple volume 73
volume
Multiple Input Parameters: Weak
Equivalence Class Testing
age
>30
5-30
Education
School UG PG
04/19/25 74
Strong Equivalence Class Testing
age
>30
5-30
Education
School UG PG
04/19/25 75
Strong Robust Equivalence Class
Testing
age
>30
5-30
Education.
76
School UG PG
04/19/25
Quiz
• Design Equivalence class test cases:
• A bank pays different interest rates on
deposits depending on the deposit period.
3% for deposit up to 15 days
4% for deposit over 15days and up to 180 days
6% for deposits over 180 days up to 1 year
7% for deposits over 1 year but less than 3
years
8% for deposits 3 years and above
04/19/25 77
Quiz: Handling Multiple Equivalence Classes