SlideShare a Scribd company logo
OBJECT-ORIENTED
SOFTWARE ENGINEERING
UNIT 07 : Software Testing Techniques
© 2018, PRAMOD PARAJULI
OOSE UNIT 07 – Software Testing Techniques 2
Disclaimer
These slides are part of teaching materials for Object Oriented
Software Engineering (OOSE). These slides do not cover all
aspect of learning OOSE, nor are these be taken as primary
source of information. As the core textbooks and reference books
for learning the subject has already been specified and provided
to the students, students are encouraged to learn from the original
sources.
Contents in these slides are copyrighted to the instructor and
authors of original texts where applicable.
OOSE UNIT 07 – Software Testing Techniques 3
SOFTWARE TESTING

Process of executing a program with the intent of
finding an error

Good test case has high probability of finding an as-
yet undiscovered error

A successful test is one that uncovers an as-yet
undiscovered error
OOSE UNIT 07 – Software Testing Techniques 4
TESTING PRINCIPLE

All test should be traceable to customer requirements

Test should be planned long before testing begins

Pareto principle applies to S/W testing

Testing should begin ‘in the small’ and progress
towards testing ‘in large’

Exhaustive testing is not possible
OOSE UNIT 07 – Software Testing Techniques 5
TESTING TYPES

Unit/component/defect testing

Mutation testing

Integration testing

System testing
●
Alpha testing
●
Beta testing
●
Acceptance testing
Compone
nt
te
sting
Syste
m
te
sting
Softwa
rede
ve
lope
r Inde
pe
nde
nt te
sting te
a
m
OOSE UNIT 07 – Software Testing Techniques 6
TESTING PRIORITIES

Only exhaustive testing can show a program is free from
defects. However, exhaustive testing is impossible

Tests should exercise a system's capabilities rather than its
components

Testing old capabilities is more important than testing new
capabilities

Testing typical situations is more important than boundary
value cases
OOSE UNIT 07 – Software Testing Techniques 7
TEST DATA AND TEST CASES

Test data Inputs which have been devised to test
the system

Test cases Inputs to test the system and the
predicted outputs from these inputs if the system
operates according to its specification
OOSE UNIT 07 – Software Testing Techniques 8
DEFECT (UNIT) TESTING PROCESS
De
sign te
st
ca
se
s
Pre
pa
r ete
st
data
R
un pr ogra
m
with te
st da ta
Compa
r ere
sults
to te
st ca
se
s
T
e
st
ca
se
s
T
e
st
data
T
e
st
re
sults
T
e
st
re
por ts
OOSE UNIT 07 – Software Testing Techniques 9
BLACK-BOX TESTING

An approach to testing where the program is considered as a
‘black-box’

The program test cases are based on the system specification

Test planning can begin early in the software process
1. Equivalence class partitioning
2. Boundary value analysis
OOSE UNIT 07 – Software Testing Techniques 10
EQUIVALENCE CLASS PARTITIONING

Input data and output results often
fall into different classes where
all members of a class are related

Each of these classes is an
equivalence partition where the
program behaves in an
equivalent way for each class
member

Test cases should be chosen from
each partition
Syste
m
Outputs
Inva
lid inputs V
a
lid inputs
OOSE UNIT 07 – Software Testing Techniques 11
EQUIVALENCE CLASS PARTITIONING

Partition system inputs and outputs into ‘equivalence sets’
If input is a 5-digit integer
between 10,000 and 99,999,
equivalence partitions are
<10,000, 10,000-99, 999 and
> 10, 000

Choose test cases at the boundary of these sets
00000, 09999, 10000, 99999, 10001
Be
twe
e
n 1 0000 a
nd 99999
Le
ss tha
n 1 0000 Moretha
n 99999
9999
10000 50000
100000
99999
Input va
lue
s
Be
twe
e
n 4 a
nd 1 0
Le
ss tha
n 4 Moretha
n 1 0
3
4 7
11
10
Numbe
r of input va
lue
s
OOSE UNIT 07 – Software Testing Techniques 12
EXAMPLE: SEARCH ROUTINE
OOSE UNIT 07 – Software Testing Techniques 13
STRUCTURAL TESTING

Sometime called white-box
testing (glass-box testing)

Derivation of test cases
according to program
structure. Knowledge of the
program is used to identify
additional test cases

Objective is to exercise all
program statements (not all
path combinations)
1)statement coverage
2)branch coverage
3)condition coverage
4)path coverage
OOSE UNIT 07 – Software Testing Techniques 14
PATH TESTING

The objective of path
testing is to ensure
that the set of test
cases is such that
each path through
the program is
executed at least
once
1
2
3
4
6
5
7
while bottom <= top
if (elemArray [mid] == key
(if (elemArray [mid]< key
8
9
bottom > top
OOSE UNIT 07 – Software Testing Techniques 15
INTEGRATION TESTING

Tests complete systems or subsystems
composed of integrated components

Integration testing should be black-box testing
with tests derived from the specification

Main difficulty is localising errors

Incremental integration testing reduces this
problem
OOSE UNIT 07 – Software Testing Techniques 16
INTEGRATION TESTING
T3
T2
T1
T4
T5
A
B
C
D
T2
T1
T3
T4
A
B
C
T1
T2
T3
A
B
T
e
st se
que
nce1 T
e
st se
que
nce2 T
e
st se
que
nce3
OOSE UNIT 07 – Software Testing Techniques 17
APPROACHES TO INTEGRATION TESTING

Big-bang integration testing

Top-down testing
●
Start with high-level system and integrate from the top-
down replacing individual components by stubs where
appropriate

Bottom-up testing
●
Integrate individual components in levels until the
complete system is created

In practice, most integration involves a combination
of these strategies
OOSE UNIT 07 – Software Testing Techniques 18
TOP-DOWN APPROACH
Level 2
Level 2
Level 2
Level 2
Level 1 Level 1
Testing
sequence
Level 2
stubs
Level 3
stubs
. . .
OOSE UNIT 07 – Software Testing Techniques 19
BOTTOM-UP APPROACH
Level N
Level N
Level N
Level N
Level N
Level N–1 Level N–1
Level N–1
Testing
sequence
Test
drivers
Test
drivers
OOSE UNIT 07 – Software Testing Techniques 20
TESTING APPROACHES

Architectural validation
●
Top-down integration testing is better at discovering errors
in the system architecture

System demonstration
●
Top-down integration testing allows a limited
demonstration at an early stage in the development

Test implementation
●
Often easier with bottom-up integration testing

Test observation

Problems with both approaches. Extra code may be
required to observe tests
OOSE UNIT 07 – Software Testing Techniques 21
SYSTEM TESTING

Alpha testing – test carried by test team within the
organization

Beta testing – testing performed by a selected group
of friendly customers

Acceptance testing – performed by customer to
determine whether or not to accept the delivery of
the system

Stress testing – test systems beyond its maximum
design load
OOSE UNIT 07 – Software Testing Techniques 22
TESTING WORKBENCHES
Dyna
mic
a
na
l yse
r
Progra
m
be
ing te
ste
d
T
e
st r e
sults
T
e
st
pre
dictions
File
compa
ra
tor
Exe
cution
re
por t
Sim
ulator
Source
code
T
e
st
ma
na ge
r
T
e
st da ta Ora
cle
T
e
st da ta
ge
ne
r ator
Spe
cification
Re
por t
ge
ne
r ator
T
e
st re
sults
re
por t
OOSE UNIT 07 – Software Testing Techniques 23
OBJECT-ORIENTED TESTING

The components to be tested are object classes that are
instantiated as objects

Larger grain than individual functions so approaches
to white-box testing have to be extended

No obvious ‘top’ to the system for top-down
integration and testing
OOSE UNIT 07 – Software Testing Techniques 24
OOT LEVELS

Testing operations associated with objects

Testing object classes

Testing clusters of cooperating objects

Testing the complete OO system
OOSE UNIT 07 – Software Testing Techniques 25
OBJECT CLASS TESTING

Complete test coverage of a class involves
●
Testing all operations associated with an object
●
Setting and interrogating all object attributes
●
Exercising the object in all possible states

Inheritance makes it more difficult to design
object class tests as the information to be
tested is not localised
OOSE UNIT 07 – Software Testing Techniques 26
INTERFACE TESTING

Takes place when modules or
sub-systems are integrated to
create larger systems

Objectives are to detect faults due
to interface errors or invalid
assumptions about interfaces

Particularly important for object-
oriented development as objects
are defined by their interface
B
C
T
e
st
ca
se
s
A
OOSE UNIT 07 – Software Testing Techniques 27
INTERFACE TYPES

Parameter interfaces
●
Data passed from one procedure to another

Shared memory interfaces
●
Block of memory is shared between procedures

Procedural interfaces
●
Sub-system encapsulates a set of procedures to be called by
other sub-systems

Message passing interfaces
●
Sub-systems request services from other sub-systems
OOSE UNIT 07 – Software Testing Techniques 28
INTERFACE ERRORS

Interface misuse
●
A calling component calls another component and makes an
error in its use of its interface e.g. parameters in the wrong
order

Interface misunderstanding
●
A calling component embeds assumptions about the behaviour of
the called component which are incorrect

Timing errors
●
The called and the calling component operate at different speeds
and out-of-date information is accessed
OOSE UNIT 07 – Software Testing Techniques 29
INTERFACE TESTING GUIDELINES

Design tests so that parameters to a called procedure are at
the extreme ends of their ranges

Always test pointer parameters with null pointers

Design tests which cause the component to fail

Use stress testing in message passing systems

In shared memory systems, vary the order in which
components are activated
OOSE UNIT 07 – Software Testing Techniques 30
WEATHER STATION INTERFACE

Use a state model to
identify state transitions
for testing

Examples of testing
sequences
●
Shutdown -> Waiting -> Shutdown
●
Waiting -> Calibrating -> Testing -> Transmitting -
> Waiting
●
Waiting -> Collecting -> Waiting -> Summarising -
> Transmitting -> Waiting
ide
ntifie
r
re
por tWe
a
the
r ()
ca
libra
te(instrume
nts)
te
st ()
sta
rtup (instrume
nts)
shutdown (instrume
nts)
WeatherStation
OOSE UNIT 07 – Software Testing Techniques 31
OBJECT INTEGRATION

Levels of integration are less distinct in object-
oriented systems

Cluster testing is concerned with integrating
and testing clusters of cooperating objects

Identify clusters using knowledge of the
operation of objects and the system features
that are implemented by these clusters
OOSE UNIT 07 – Software Testing Techniques 32
APPROACHES TO CLUSTER TESTING

Use-case or scenario testing
●
Testing is based on a user interactions with the system
●
Has the advantage that it tests system features as
experienced by users

Thread testing
●
Tests the systems response to events as processing threads
through the system

Object interaction testing
●
Tests sequences of object interactions that stop when an
object operation does not call on services from another
object
OOSE UNIT 07 – Software Testing Techniques 33
SCENARIO-BASED TESTING

Identify scenarios from use-cases and
supplement these with interaction diagrams
that show the objects involved in the scenario

Consider the scenario in the weather station
system where a report is generated
OOSE UNIT 07 – Software Testing Techniques 34
SCENARIO-BASED TESTING - EXAMPLE
:CommsController
request (report)
acknowledge ()
report ()
summarise ()
reply (report)
acknowledge ()
send (report)
:WeatherStation :WeatherData
OOSE UNIT 07 – Software Testing Techniques 35
SCENARIO-BASED TESTING - EXAMPLE

Thread of methods executed
●
CommsController:request -> WeatherStation:report ->
WeatherData:summarise

Inputs and outputs
●
Input of report request with associated acknowledge and a
final output of a report
●
Can be tested by creating raw data and ensuring that it is
summarised properly
●
Use the same raw data to test the WeatherData object
OOSE UNIT 07 – Software Testing Techniques 36
End of Unit 07 : Software Testing Techniques

More Related Content

What's hot (19)

PPTX
Software testing methods
Homa Pourmohammadi
 
PPTX
Software testing introduction
GaneshKumarKanthiah
 
PPTX
SOFTWARE TESTING UNIT-4
Mohammad Faizan
 
PPTX
Software testing
balamurugan.k Kalibalamurugan
 
PDF
Seminar on Software Testing
Beat Fluri
 
PDF
Testing artifacts test cases
Petro Chernii
 
PPT
Software testing strategies
Krishna Sujeer
 
PPTX
Object Oriented Analysis
AMITJain879
 
PPTX
Software testing ppt
Poonkodi Jayakumar
 
PPTX
Object Oriented Testing(OOT) presentation slides
Punjab University
 
PPTX
Software testing
Bhagyashree pathak
 
PPTX
Research issues in object oriented software testing
Anshul Vinayak
 
PPTX
Software testing
Ahmed Moawad
 
DOC
Testing terms & definitions
Sachin MK
 
PPTX
Software testing
Kunal Prajapati
 
PPTX
Software testing
mkn3009
 
PPT
Software testing definition
Hiro Mia
 
PPTX
Testing and types of Testing
Munaam Munawar
 
PDF
Types of software testing
Testbytes
 
Software testing methods
Homa Pourmohammadi
 
Software testing introduction
GaneshKumarKanthiah
 
SOFTWARE TESTING UNIT-4
Mohammad Faizan
 
Seminar on Software Testing
Beat Fluri
 
Testing artifacts test cases
Petro Chernii
 
Software testing strategies
Krishna Sujeer
 
Object Oriented Analysis
AMITJain879
 
Software testing ppt
Poonkodi Jayakumar
 
Object Oriented Testing(OOT) presentation slides
Punjab University
 
Software testing
Bhagyashree pathak
 
Research issues in object oriented software testing
Anshul Vinayak
 
Software testing
Ahmed Moawad
 
Testing terms & definitions
Sachin MK
 
Software testing
Kunal Prajapati
 
Software testing
mkn3009
 
Software testing definition
Hiro Mia
 
Testing and types of Testing
Munaam Munawar
 
Types of software testing
Testbytes
 

Similar to Software Testing Techniques (20)

PPTX
Software Testing
SKumar11384
 
PPTX
Object Oriented Testing
AMITJain879
 
PPT
software-testing-strategies888888888.ppt
sameera abu-ghalyoon
 
PPTX
UNIT-III 19CS408T - Software Testing Notes
CRohiniAsstProfCSE
 
PPT
Software Testing
Kiran Kumar
 
PPT
Testing chapter updated (1)
abdullah619
 
PPTX
Top 15 Interview Questions for Manual Testers
Sarah Elson
 
PPTX
Testing ppt
kiran theja
 
PPT
Basic software-testing-concepts
medsherb
 
DOC
Testing
poojadatt
 
PPT
Testing
salinisudesh
 
PPT
Lecture18- Testing Strategy.ppt by aiman
AIMANFATIMA866050
 
PDF
st-notes-13-26-software-testing-is-the-act-of-examining-the-artifacts-and-the...
mwpeexdvjgtqujwhog
 
PPTX
Unit testing & TDD concepts with best practice guidelines.
Mohamed Taman
 
DOCX
Software engg unit 4
Vivek Kumar Sinha
 
PPT
Slides chapters 13-14
Priyanka Shetty
 
PPTX
Software testing
Eng Ibrahem
 
PDF
4. The Software Development Process - Testing
Forrester High School
 
Software Testing
SKumar11384
 
Object Oriented Testing
AMITJain879
 
software-testing-strategies888888888.ppt
sameera abu-ghalyoon
 
UNIT-III 19CS408T - Software Testing Notes
CRohiniAsstProfCSE
 
Software Testing
Kiran Kumar
 
Testing chapter updated (1)
abdullah619
 
Top 15 Interview Questions for Manual Testers
Sarah Elson
 
Testing ppt
kiran theja
 
Basic software-testing-concepts
medsherb
 
Testing
poojadatt
 
Testing
salinisudesh
 
Lecture18- Testing Strategy.ppt by aiman
AIMANFATIMA866050
 
st-notes-13-26-software-testing-is-the-act-of-examining-the-artifacts-and-the...
mwpeexdvjgtqujwhog
 
Unit testing & TDD concepts with best practice guidelines.
Mohamed Taman
 
Software engg unit 4
Vivek Kumar Sinha
 
Slides chapters 13-14
Priyanka Shetty
 
Software testing
Eng Ibrahem
 
4. The Software Development Process - Testing
Forrester High School
 
Ad

More from Pramod Parajuli (9)

PDF
Software Quality Assurance
Pramod Parajuli
 
PDF
Object Oriented Design
Pramod Parajuli
 
PDF
Object Oriented Analysis
Pramod Parajuli
 
PDF
Object Orientation Fundamentals
Pramod Parajuli
 
PDF
Project Mangement Planning and Risk Analysis
Pramod Parajuli
 
PDF
COCOMO methods for software size estimation
Pramod Parajuli
 
PDF
Introduction to Software Engineering
Pramod Parajuli
 
PDF
Object Oriented Implementation
Pramod Parajuli
 
Software Quality Assurance
Pramod Parajuli
 
Object Oriented Design
Pramod Parajuli
 
Object Oriented Analysis
Pramod Parajuli
 
Object Orientation Fundamentals
Pramod Parajuli
 
Project Mangement Planning and Risk Analysis
Pramod Parajuli
 
COCOMO methods for software size estimation
Pramod Parajuli
 
Introduction to Software Engineering
Pramod Parajuli
 
Object Oriented Implementation
Pramod Parajuli
 
Ad

Recently uploaded (20)

PDF
Alpha Altcoin Setup : TIA - 19th July 2025
CIFDAQ
 
PPTX
The Yotta x CloudStack Advantage: Scalable, India-First Cloud
ShapeBlue
 
PDF
How a Code Plagiarism Checker Protects Originality in Programming
Code Quiry
 
PDF
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PDF
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PPTX
Earn Agentblazer Status with Slack Community Patna.pptx
SanjeetMishra29
 
PDF
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
PDF
Bitcoin+ Escalando sin concesiones - Parte 1
Fernando Paredes García
 
PDF
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
PPTX
Top Managed Service Providers in Los Angeles
Captain IT
 
PDF
Integrating IIoT with SCADA in Oil & Gas A Technical Perspective.pdf
Rejig Digital
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
Rethinking Security Operations - Modern SOC.pdf
Haris Chughtai
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PPTX
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
Alpha Altcoin Setup : TIA - 19th July 2025
CIFDAQ
 
The Yotta x CloudStack Advantage: Scalable, India-First Cloud
ShapeBlue
 
How a Code Plagiarism Checker Protects Originality in Programming
Code Quiry
 
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Earn Agentblazer Status with Slack Community Patna.pptx
SanjeetMishra29
 
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
Bitcoin+ Escalando sin concesiones - Parte 1
Fernando Paredes García
 
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
Top Managed Service Providers in Los Angeles
Captain IT
 
Integrating IIoT with SCADA in Oil & Gas A Technical Perspective.pdf
Rejig Digital
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
Rethinking Security Operations - Modern SOC.pdf
Haris Chughtai
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 

Software Testing Techniques

  • 1. OBJECT-ORIENTED SOFTWARE ENGINEERING UNIT 07 : Software Testing Techniques © 2018, PRAMOD PARAJULI
  • 2. OOSE UNIT 07 – Software Testing Techniques 2 Disclaimer These slides are part of teaching materials for Object Oriented Software Engineering (OOSE). These slides do not cover all aspect of learning OOSE, nor are these be taken as primary source of information. As the core textbooks and reference books for learning the subject has already been specified and provided to the students, students are encouraged to learn from the original sources. Contents in these slides are copyrighted to the instructor and authors of original texts where applicable.
  • 3. OOSE UNIT 07 – Software Testing Techniques 3 SOFTWARE TESTING  Process of executing a program with the intent of finding an error  Good test case has high probability of finding an as- yet undiscovered error  A successful test is one that uncovers an as-yet undiscovered error
  • 4. OOSE UNIT 07 – Software Testing Techniques 4 TESTING PRINCIPLE  All test should be traceable to customer requirements  Test should be planned long before testing begins  Pareto principle applies to S/W testing  Testing should begin ‘in the small’ and progress towards testing ‘in large’  Exhaustive testing is not possible
  • 5. OOSE UNIT 07 – Software Testing Techniques 5 TESTING TYPES  Unit/component/defect testing  Mutation testing  Integration testing  System testing ● Alpha testing ● Beta testing ● Acceptance testing Compone nt te sting Syste m te sting Softwa rede ve lope r Inde pe nde nt te sting te a m
  • 6. OOSE UNIT 07 – Software Testing Techniques 6 TESTING PRIORITIES  Only exhaustive testing can show a program is free from defects. However, exhaustive testing is impossible  Tests should exercise a system's capabilities rather than its components  Testing old capabilities is more important than testing new capabilities  Testing typical situations is more important than boundary value cases
  • 7. OOSE UNIT 07 – Software Testing Techniques 7 TEST DATA AND TEST CASES  Test data Inputs which have been devised to test the system  Test cases Inputs to test the system and the predicted outputs from these inputs if the system operates according to its specification
  • 8. OOSE UNIT 07 – Software Testing Techniques 8 DEFECT (UNIT) TESTING PROCESS De sign te st ca se s Pre pa r ete st data R un pr ogra m with te st da ta Compa r ere sults to te st ca se s T e st ca se s T e st data T e st re sults T e st re por ts
  • 9. OOSE UNIT 07 – Software Testing Techniques 9 BLACK-BOX TESTING  An approach to testing where the program is considered as a ‘black-box’  The program test cases are based on the system specification  Test planning can begin early in the software process 1. Equivalence class partitioning 2. Boundary value analysis
  • 10. OOSE UNIT 07 – Software Testing Techniques 10 EQUIVALENCE CLASS PARTITIONING  Input data and output results often fall into different classes where all members of a class are related  Each of these classes is an equivalence partition where the program behaves in an equivalent way for each class member  Test cases should be chosen from each partition Syste m Outputs Inva lid inputs V a lid inputs
  • 11. OOSE UNIT 07 – Software Testing Techniques 11 EQUIVALENCE CLASS PARTITIONING  Partition system inputs and outputs into ‘equivalence sets’ If input is a 5-digit integer between 10,000 and 99,999, equivalence partitions are <10,000, 10,000-99, 999 and > 10, 000  Choose test cases at the boundary of these sets 00000, 09999, 10000, 99999, 10001 Be twe e n 1 0000 a nd 99999 Le ss tha n 1 0000 Moretha n 99999 9999 10000 50000 100000 99999 Input va lue s Be twe e n 4 a nd 1 0 Le ss tha n 4 Moretha n 1 0 3 4 7 11 10 Numbe r of input va lue s
  • 12. OOSE UNIT 07 – Software Testing Techniques 12 EXAMPLE: SEARCH ROUTINE
  • 13. OOSE UNIT 07 – Software Testing Techniques 13 STRUCTURAL TESTING  Sometime called white-box testing (glass-box testing)  Derivation of test cases according to program structure. Knowledge of the program is used to identify additional test cases  Objective is to exercise all program statements (not all path combinations) 1)statement coverage 2)branch coverage 3)condition coverage 4)path coverage
  • 14. OOSE UNIT 07 – Software Testing Techniques 14 PATH TESTING  The objective of path testing is to ensure that the set of test cases is such that each path through the program is executed at least once 1 2 3 4 6 5 7 while bottom <= top if (elemArray [mid] == key (if (elemArray [mid]< key 8 9 bottom > top
  • 15. OOSE UNIT 07 – Software Testing Techniques 15 INTEGRATION TESTING  Tests complete systems or subsystems composed of integrated components  Integration testing should be black-box testing with tests derived from the specification  Main difficulty is localising errors  Incremental integration testing reduces this problem
  • 16. OOSE UNIT 07 – Software Testing Techniques 16 INTEGRATION TESTING T3 T2 T1 T4 T5 A B C D T2 T1 T3 T4 A B C T1 T2 T3 A B T e st se que nce1 T e st se que nce2 T e st se que nce3
  • 17. OOSE UNIT 07 – Software Testing Techniques 17 APPROACHES TO INTEGRATION TESTING  Big-bang integration testing  Top-down testing ● Start with high-level system and integrate from the top- down replacing individual components by stubs where appropriate  Bottom-up testing ● Integrate individual components in levels until the complete system is created  In practice, most integration involves a combination of these strategies
  • 18. OOSE UNIT 07 – Software Testing Techniques 18 TOP-DOWN APPROACH Level 2 Level 2 Level 2 Level 2 Level 1 Level 1 Testing sequence Level 2 stubs Level 3 stubs . . .
  • 19. OOSE UNIT 07 – Software Testing Techniques 19 BOTTOM-UP APPROACH Level N Level N Level N Level N Level N Level N–1 Level N–1 Level N–1 Testing sequence Test drivers Test drivers
  • 20. OOSE UNIT 07 – Software Testing Techniques 20 TESTING APPROACHES  Architectural validation ● Top-down integration testing is better at discovering errors in the system architecture  System demonstration ● Top-down integration testing allows a limited demonstration at an early stage in the development  Test implementation ● Often easier with bottom-up integration testing  Test observation  Problems with both approaches. Extra code may be required to observe tests
  • 21. OOSE UNIT 07 – Software Testing Techniques 21 SYSTEM TESTING  Alpha testing – test carried by test team within the organization  Beta testing – testing performed by a selected group of friendly customers  Acceptance testing – performed by customer to determine whether or not to accept the delivery of the system  Stress testing – test systems beyond its maximum design load
  • 22. OOSE UNIT 07 – Software Testing Techniques 22 TESTING WORKBENCHES Dyna mic a na l yse r Progra m be ing te ste d T e st r e sults T e st pre dictions File compa ra tor Exe cution re por t Sim ulator Source code T e st ma na ge r T e st da ta Ora cle T e st da ta ge ne r ator Spe cification Re por t ge ne r ator T e st re sults re por t
  • 23. OOSE UNIT 07 – Software Testing Techniques 23 OBJECT-ORIENTED TESTING  The components to be tested are object classes that are instantiated as objects  Larger grain than individual functions so approaches to white-box testing have to be extended  No obvious ‘top’ to the system for top-down integration and testing
  • 24. OOSE UNIT 07 – Software Testing Techniques 24 OOT LEVELS  Testing operations associated with objects  Testing object classes  Testing clusters of cooperating objects  Testing the complete OO system
  • 25. OOSE UNIT 07 – Software Testing Techniques 25 OBJECT CLASS TESTING  Complete test coverage of a class involves ● Testing all operations associated with an object ● Setting and interrogating all object attributes ● Exercising the object in all possible states  Inheritance makes it more difficult to design object class tests as the information to be tested is not localised
  • 26. OOSE UNIT 07 – Software Testing Techniques 26 INTERFACE TESTING  Takes place when modules or sub-systems are integrated to create larger systems  Objectives are to detect faults due to interface errors or invalid assumptions about interfaces  Particularly important for object- oriented development as objects are defined by their interface B C T e st ca se s A
  • 27. OOSE UNIT 07 – Software Testing Techniques 27 INTERFACE TYPES  Parameter interfaces ● Data passed from one procedure to another  Shared memory interfaces ● Block of memory is shared between procedures  Procedural interfaces ● Sub-system encapsulates a set of procedures to be called by other sub-systems  Message passing interfaces ● Sub-systems request services from other sub-systems
  • 28. OOSE UNIT 07 – Software Testing Techniques 28 INTERFACE ERRORS  Interface misuse ● A calling component calls another component and makes an error in its use of its interface e.g. parameters in the wrong order  Interface misunderstanding ● A calling component embeds assumptions about the behaviour of the called component which are incorrect  Timing errors ● The called and the calling component operate at different speeds and out-of-date information is accessed
  • 29. OOSE UNIT 07 – Software Testing Techniques 29 INTERFACE TESTING GUIDELINES  Design tests so that parameters to a called procedure are at the extreme ends of their ranges  Always test pointer parameters with null pointers  Design tests which cause the component to fail  Use stress testing in message passing systems  In shared memory systems, vary the order in which components are activated
  • 30. OOSE UNIT 07 – Software Testing Techniques 30 WEATHER STATION INTERFACE  Use a state model to identify state transitions for testing  Examples of testing sequences ● Shutdown -> Waiting -> Shutdown ● Waiting -> Calibrating -> Testing -> Transmitting - > Waiting ● Waiting -> Collecting -> Waiting -> Summarising - > Transmitting -> Waiting ide ntifie r re por tWe a the r () ca libra te(instrume nts) te st () sta rtup (instrume nts) shutdown (instrume nts) WeatherStation
  • 31. OOSE UNIT 07 – Software Testing Techniques 31 OBJECT INTEGRATION  Levels of integration are less distinct in object- oriented systems  Cluster testing is concerned with integrating and testing clusters of cooperating objects  Identify clusters using knowledge of the operation of objects and the system features that are implemented by these clusters
  • 32. OOSE UNIT 07 – Software Testing Techniques 32 APPROACHES TO CLUSTER TESTING  Use-case or scenario testing ● Testing is based on a user interactions with the system ● Has the advantage that it tests system features as experienced by users  Thread testing ● Tests the systems response to events as processing threads through the system  Object interaction testing ● Tests sequences of object interactions that stop when an object operation does not call on services from another object
  • 33. OOSE UNIT 07 – Software Testing Techniques 33 SCENARIO-BASED TESTING  Identify scenarios from use-cases and supplement these with interaction diagrams that show the objects involved in the scenario  Consider the scenario in the weather station system where a report is generated
  • 34. OOSE UNIT 07 – Software Testing Techniques 34 SCENARIO-BASED TESTING - EXAMPLE :CommsController request (report) acknowledge () report () summarise () reply (report) acknowledge () send (report) :WeatherStation :WeatherData
  • 35. OOSE UNIT 07 – Software Testing Techniques 35 SCENARIO-BASED TESTING - EXAMPLE  Thread of methods executed ● CommsController:request -> WeatherStation:report -> WeatherData:summarise  Inputs and outputs ● Input of report request with associated acknowledge and a final output of a report ● Can be tested by creating raw data and ensuring that it is summarised properly ● Use the same raw data to test the WeatherData object
  • 36. OOSE UNIT 07 – Software Testing Techniques 36 End of Unit 07 : Software Testing Techniques