Professional Documents
Culture Documents
SW Testing Basics 2011 Module 4
SW Testing Basics 2011 Module 4
SW Testing Basics 2011 Module 4
SW Testing Basics
Teresa Sousa (maria.sousa@nsn.com)
FPM26 October 2011
Content
Introduction
Modulo 1 - Why do we need to test
Modulo 2 - Basic concepts
Modulo 3 - An overview in processes
Modulo 4 Testing Techniques
Modulo 5 Best Practices
Agenda
Needs of testing techniques
Five main techniques referred by ISTQB*
Equivalence class partitioning
Boundary value analysis
Decision tables
Coffee Break
Conclusions
macro.
We need to
know how to
start.
We need to be
selective when
the quantity is
huge
We need to
select the best
way
We need to
avoid
redundancy
macro.
10
Orthogonal Arrays
11
12
ATM Withdrawals:
Minimum amount 10
Maximum amount 200.
Valid withdrawals are in
increments of 10 only.
10
Invalid partition
200
Valid partition
210
Invalid partition
Note:
Maybe needed more test cases for invalid special cases
13
macro.
Exercise
14
Exercise
Equivalent Classes:
EC 1: Less than 1 counter
EC 2: Between 1 and 15 counters
EC 3: More than 15 counters
0 counters
1 counter
Invalid partition
15
15 counters
Valid partition
16 counters
Invalid partition
Exercise
Equivalent Classes:
EC 1: Less than 10 cars -invalid
EC 2: Between 10 and 20 cars - valid
EC 3: Between 20 and 30 cars - invalid
EC 4: Between 30 and 40 cars - valid
EC 5: More than 40 cars - invalid
10 cars
Invalid partition
16
20 cars
Valid partition
store 10 cars
The ship can not leave with an odd
nr. of compartments occupied.
The occupied compartments do not
need to be completed
To start filling a new compartment
the previous one should be
completed
30 cars
Invalid partition
40 cars
Valid partition
Invalid partition
17
ATM Withdrawals:
Equivalent Classes:
EC1: Values between 10 and
200 - valid values
EC2: Values minor than 10 invalid values.
EC3: Values greater than 200 invalid values
Test Cases:
TC1: 10- valid
TC2: 200 - valid
TC3: 0 - invalid
TC4: 210 - invalid
http:\\www.caveofknowledge.com
10
Invalid partition
18
200
Valid partition
210
Invalid partition
macro.
Exercise
19
Exercise
Test Cases:
TC1: 0 counters
TC2: 1 counter
TC3: 15 counters
TC4: 16 counters
Equivalent Classes:
EC 1: Less than 1 counter
EC 2: Between 1 and 15 counters
EC 3: More than 15 counters
0 counters
1 counter
Invalid partition
20
15 counters
Valid partition
16 counters
Invalid partition
Exercise
people with tester
instinct, will define the
test cases:
TC10: 9 cars
TC11: 12 cars
TC12: 19 cars
TC13: 22 cars
TC14: 29 cars
TC15: 32 cars
TC16: 39 cars
Test Cases:
TC1: 10 cars
TC2: 11 cars
TC3: 20 cars
TC4: 21 cars
TC5: 30 cars
TC6: 31 cars
TC7: 40 cars
TC8: 41 cars
TC9: 0 cars
10 cars
Invalid partition
21
20 cars
Valid partition
Equivalent Classes:
EC 1: Less than 10 cars - invalid
EC 2: Between 10 and 20 cars - valid
EC 3: Between 20 and 30 cars - invalid
EC 4: Between 30 and 40 cars - valid
EC 5: More than 40 cars - invalid
30 cars
Invalid partition
40 cars
Valid partition
Invalid partition
Decision tables
Description:
List all possible input combinations of
interest, origination test cases.
It is a very mature design technique and
very thorough
It is used to document functionalities
that can be defined by a set of rules:
- Web Browser detection
- Accepting diferent parameters
from object-oriented methods:
setDate(), setDate(dd,mm), or
setDate(dd,mm,yyyy)
Used when there is a feature that needs
a set of inputs, that can change.
This tables can have several formats.
Can have test cases and expected
results in text, or can have almost only
logical keys.
22
Decision tables
Example:
A situation where we have 3 conditions to check, and
several output according to combination of these 3
conditions. It is needed to check if the browser is Firefox, if
the JavaScript is enabled and if Music plug-in is installed.
The actions maybe to redirect the page, to use cookies, and
to play the music.
23
Decision tables
Example:
Customer Oriented
24
Test Case
Expected results
Decision tables
Example:
Development Oriented
Test cases
1
conditions
Yes
Yes
Yes
No
Yes
Yes
Music plug-in
detected
N/A
N/A
No
Yes
Redirect page
Yes
Yes
No
No
Use cookies
N/A
N/A
Yes
Yes
Play music
N/A
N/A
No
Yes
No
Expected Results
actions
25
macro.
Exercise
26
Exercise
Situation:
A page in a reporter tool has 4 inputs:
Date should be valid
A list of counters, that should be between 1 and 15
and the type of report wanted:
chart or
table.
27
Decision tables
Exercise:
Customer Oriented
28
Test Case
Expected results
Decision tables
Exercise:
Development Oriented
Test cases
1
Date Valid
No
Yes
Yes
Yes
Yes
N/A
No
Yes
Yes
Yes
Table Selected
N/A
N/A
No
Yes
No
Chart Selected
N/A
N/A
No
No
Yes
Invalid date
Yes
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
Chart
No
No
No
No
Yes
Table
No
No
No
Yes
No
Expected Results
actions
actions
29
Decision tables
Exercise:
Development Oriented, focusing only on date field:
Start date and end date should be filled
Start date should be valid
End date should be valid
End Date should be greater that Start date
Selected date should not be in the future
30
Decision tables
Exercise:
Customer Oriented, focusing only on date field
31
Test Case
Expected results
Go to next field
Decision tables
Exercise:
Development Oriented, focusing only on date field
Test cases
1
Nr. of Parameters
N/A
N/A
No
Yes
Yes
Yes
Yes
N/A
N/A
N/A
No
Yes
Yes
Yes
N/A
N/A
N/A
N/A
Yes
No
No
N/A
N/A
N/A
N/A
N/A
No
Yes
Invalid date
Yes
Yes
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
Yes
No
Go to next field
No
No
No
No
No
Yes
Expected Results
No
http://www.gearfuse.com
Coffee Break
33
State
Chart
34
Stateevent
table
Transition
Tree
Test
scenarios
State Chart
UnregisterAg
RejectData
No
agent
CreateAgent
FormSetAgentType Window to
to fill
Select
RegAgent
Agent
Registered
StartAg
StopAg
Cancel
Agent
Running
UnregisterAg
RejectData
No
CreateAgentForm
SetAgentType Window to RegAgentAgent
StartAg Agent
agent
to fill
Registered
Running
Select
StopAg
Cancel
States
Transitions
36
No Agent
Form to fill
Window to
Select
Agent
Registered
Agent
Running
CreateAgent
SetAgentTyp
e
Cancel
RejectData
regAgent
StartAg
StopAg
UnregisterAg
UnregisterAg
RejectData
No
agent
Transition Tree
createAgent
Form
to fill
SetAgentType
Window to
Select
RegAgent
Agent
Registered
StartAg
Agent
Running
StopAg
Cancel
No Agent
Form to fill
Window to
Select
Agent
Registered
Agent
Running
createAgent
SetAgentType
Cancel
RejectData
regAgent
StartAg
StopAg
UnregisterAg
No Agent
Re
je c
tD
at
a
TP4
No Agent
createAgent
Form
to fill
TP1
t
Se
pe
tTy
n
e
Ag
Ca
nc
Window to
Select
TP2
reg
Ag
en
Agent
Registered
TP5
el
No Agent
TP3
TP = Test path
37
Agent
Running
tAg
Star
TP6
Un
re
gis
te r
St
o
pA
g
Agent
Registered
Ag
No Agent
TP7
TP8
No Agent
Form to fill
Window to
Select
Agent
Registered
Agent
Running
createAgent
SetAgentType
Cancel
RejectData
regAgent
StartAg
StopAg
UnregisterAg
Window to
Select
TP2
Form
to fill
No Agent
Agent
Registered
TP1
AgentX
Running
TP6
TP5
No Agent
No Agent
TP7
TP3
Test Path
State
Initial transition
Succeeding transition
No Agent
createAgen
t
Form to Fill
SetAgentTy
pe
Window to
Select
No Agent
createAgen
t
Form to Fill
Cancel
No Agent
No Agent
createAgen
t
Form to fill
RejectData
No Agent
Form to Fill
SetAgentTy
pe
Window to
Select
regAgent
Agent
Registered
Window to
Select
RegAgent
Agent
Registered
StartAg
Agent
Running
Window to
Select
RegAgent
Agent
Registered
UnregisterA
g
No Agent
Agent
Registered
StartAg
Agent
Running
StopAg
Agent
Registered
38
Agent
Registered
TP8
Test Scenarios
State
Initial transition
Succeeding transition
No Agent
createAgen
t
Form to Fill
SetAgentTy
pe
Window to
Select
No Agent
createAgen
t
Form to Fill
Cancel
No Agent
No Agent
createAgen
t
Form to fill
RejectData
No Agent
Window to
Select
RegAgent
Agent
Registered
UnregisterA
g
No Agent
Agent
Registered
StartAg
Agent
Running
StopAg
Agent
Registered
No Agent
TP4
Window to
Select
No Agent
Form
to fill
TP2
Agent
Running
Agent
Registered
TP1
TP6
TP5
No Agent
No Agent
TP3
39
TP7
Agent
Registered
TP8
macro.
Exercise
40
Exercise
Situation:
Execution of a report in reporting tool
Close
State Chart
No report
SetDate
Form to fill
SelectCounters
Window to select
counters
SetType
Cancel
Cancel
41
SetType
SetDate
SelectCounters
Cancel
Close
GetChart
Form to
select type
GetTable
RejectDate
SetType
SetDate
SelectCounters
Chart
Table
Exercise
State Event Table
Close
Form
Form to
to fill
fill
SelectCounters
Window
Window to
to select
select
counters
Cancel
SetType
Form
Form to
to
select type
Cancel
Table
Close
No Report
SetDate
Form to fill
RejectDate
SelectCount
ers
8
BSO OSS R&D FPM 26 / Teresa Sousa / October 2011
Chart
Table
10
14
11
15
12
16
GetChart
42
Form to
Select Type
Cancel
SetType
Window for
counters
GetC
hart
SetType
SetDate
SelectCounters
Cancel
GetTable
SetDate
SetType
SelectCounters
SetDate
RejectDate
No
No report
report
Chart
Chart
Close
SelectCo
unters
No
Report
SetDate
Form
to fill
o
C
11
15
12
16
Cancel
Window for
Counters
TP4
9
Ca
nc
No Report
TP5
Form type
ate
GetC
hart
GetTable
Window for
Counters
TP15
Form Type
TP16
Close
No Report
17
TP17
GetCh
art
Chart
TP8
SetDate
Sele
ctC
oun
ter
Se
tTy
pe
el
tD
jec
Re
43
TP14
TP9
No Report
TP2
Cl
o
No Report
TP7
TP = Test path
SetType
Table
TP6
13
el
Form to Fill
e
at
s
ter
un
o
tC
lec
Se
SetType
nc
Ca
TP1
Close
l
Se
t
ec
Table
Table
t
Se
e
yp
tT
Se
GetChart
rs
te 8
n
u
Cancel
Close
GetTable
14
SetType
10
Form to
select type
select
type
Cancel
Ta
bl
e
RejectDa
te
Table
G
et
Chart
SetType
Window to select
counters
counters
Cancel
Form to
Select
Type
Cancel
SelectCounters
SelectCounters
Window
for
counters
Form to fill
SetDate
SetDate
Form to
fill
SetDate
SetType
RejectDate
No report
No
Report
SelectCounters
Transition Tree
SetDate
Chart
se
Form to Fill
TP10
Window for
Counters
TP11
Form Type
TP12
No Report
No Report
TP3
TP13
tD
Se
Test Scenarios
le
Se
cel
No Report
No
Report
SetDate
SetDate
Form
to fill
Cancel
No Report
Form type
No Report
Form to Fill
SelectCounter
s
Window for
Counters
Cancel
No Report
SetType
Form Type
No Report
SetDate
Form to Fill
SelectCounter
s
Form to Fill
SelectCounter
s
Window for
Counters
Window for
Counters
SetType
Form Type
Window for
Counters
SetType
Form Type
GetChart
Chart
Window for
Counters
SetType
Form Type
GetTable
Table
10
Form Type
GetChart
Chart
SetDate
Form to Fill
11
Form Type
GetChart
Chart
SelectCounter
s
Window for
Counters
12
Form Type
GetChart
Chart
SetType
Form type
13
Form Type
GetChart
Chart
Close
No Report
14
Form Type
GetTable
Table
SetDate
Form to Fill
15
Form Type
GetTable
Table
SelectCounter
s
Window for
Counters
16
Form Type
GetTable
Table
SetType
Form type
Form Type
GetTable
Table
Close
No Report
17
44
ate
tD
jec
Re
No Report
TP2
Cancel
No Report
Close
No Report
TP3
Chart
TP6
Form to Fill
TP14
Window for
Counters
TP15
Form Type
TP16
No Report
TP17
TP8
RejectDate
SetDate
Window for
Counters
SetType
TP9
GetCh
art
e
nc
Ca
Ca to Fill
Form
nc
el
No Report
TP1
Ta
bl
e
TP4
TP5
Table
s
t er
un
G
et
s
n
u
o
C
ct
e
l
Se Form to Fill
State
No Report
e
yp
tT
Se
Test Path
Can
Window for
CountersSucceeding transition
o
ctC
e
at
No Report
TP7
SetDate
Sele
ctC
oun
ters
Se
tTy
pe
Cl
os
e
Form to Fill
TP10
Window for
Counters
TP11
Form Type
TP12
No Report
TP13
State
Initial transition
Succeeding transition
No Report
SetDate
Form to Fill
Cancel
No Report
No Report
SetDate
Form to Fill
RejectDate
No Report
No Report
SetDate
Form to Fill
SelectCounter
s
Window for
Counters
Form to Fill
SelectCounter
s
Window for
Counters
Cancel
No Report
Form to Fill
SelectCounter
s
Window for
Counters
SetType
Form Type
Window for
Counters
SetType
Form Type
Cancel
No Report
Window for
Counters
SetType
Form Type
GetChart
Chart
Window for
Counters
SetType
Form Type
GetTable
Table
10
Form Type
GetChart
Chart
SetDate
Form to Fill
11
Form Type
GetChart
Chart
SelectCounter
s
Window for
Counters
12
Form Type
GetChart
Chart
SetType
Form type
13
Form Type
GetChart
Chart
Close
No Report
14
Form Type
GetTable
Table
SetDate
Form to Fill
15
Form Type
GetTable
Table
SelectCounter
s
Window for
Counters
16
Form Type
GetTable
Table
SetType
Form type
17
Form Type
GetTable
Table
Close
No Report
45
State
Initial transition
Succeeding transition
No Report
SetDate
Form to Fill
RejectDate
No Report
Form to Fill
SelectCounter
s
Window for
Counters
Cancel
No Report
Window for
Counters
SetType
Form Type
GetChart
Chart
Form Type
GetTable
17
Table
Close
Form to Fill
te
Da
t
Se
No Report
TP14
Window for
Counters
rs
nte
SetDate
Form
to fill
No Report
Form type
Ca
n
ce
G
et
Ta
bl
e
TP5
Table
TP8
ctD
ate
No Report
TP2
TP3
46
SetDate
Sele
ctCo
unte
r
Se
tTy
pe
Cl
o
No Report
TP7
No Report
TP16
Close
el
je
Re
Form Type
No Report
TP17
Chart
TP6
TP15
TP9
GetCh
art
nc
Ca
TP1
TP4
Cancel
e
yp
tT
Se
No
Report
c
le
Se
n
ou
tC
rs
te
Window for
Counters
ou
tC
c
e
l
Se
SetType
se
Form to Fill
TP10
Window for
Counters
TP11
Form Type
TP12
No Report
TP13
Test Path
Exercise
State Chart with selected test
scenarios
State
Initial transition
Succeeding transition
No Report
SetDate
Form to Fill
RejectDate
No Report
Form to Fill
SelectCounter
s
Window for
Counters
Cancel
No Report
Window for
Counters
SetType
Form Type
GetChart
Chart
17
Form Type
GetTable
Table
Close
No Report
Close
No report
SetDate
Form to fill
SelectCounters
Window to select
counters
SetType
Cancel
Cancel
47
SetType
SetDate
SelectCounters
Cancel
Close
GetChart
Form to
select type
GetTable
RejectDate
SetType
SetDate
SelectCounters
Chart
Table
Orthogonal Arrays
Description:
Is a mathematical approach to select subsets of tests, when it is impossible to test all
test cases, due to too much combinations.
This technique expose pair-wise defects.
Allows to detect compatibility problems because select pairs.
Reduce the number of test cases.
48
Orthogonal Arrays
Example:
WebBrowser: Internet Explorer, Firefox, Opera
Client Operation System: Windows2000, WindowsXP, windows2003
DataBase Management System: SQL Server, SyBase, Oracle
Language: English, Portuguese, Finnish
49
Test Case
Browser
Operation
System
DataBase
Language
IE
2000
SQL
English
IE
XP
SyBase
Finnish
IE
2003
Oracle
Portuguese
Firefox
2000
SyBase
English
Firefox
XP
Oracle
Finnish
Firefox
2003
SQL
Portuguese
Opera
2000
Oracle
English
Opera
XP
SQL
Finnish
Opera
2003
SyBase
Portuguese
It is possible to
reduce from 81
test cases to 9
test cases!
macro.
Exercise
50
Exercise
Situation:
Magic is a system running in Linux and can use for webservices TomCat
or Websphere, user can run web browser in Windows XP, Windows 7 and
Linux, the web browser can be Internet Explorer, Firefox or Opera, and
can export for csv, xml or HTML.
a) How many test cases do we have for all combinations?
b) Find out how many test cases can we have using orthogonal arrays, by
building the table.
Solution:
a) How many test cases do we have for all combinations?
2 x 3 x 3 x 3 = 54
b) Find out how many test cases can we have using orthogonal arrays, by
building the table.
51
Exercise
Test Case
Operation
System
Browser
Export
WebServer
WindowsXP
IE
csv
Tomcat
Windows7
IE
xml
Tomcat
Linux
IE
HTML
Tomcat
WindowsXP
Firefox
csv
Websphere
Windows7
Firefox
xml
Websphere
Linux
Firefox
HTML
Websphere
WindowsXP
Opera
csv
Tomcat
Windows7
Opera
xml
Websphere
Linux
Opera
HTML
Tomcat
Solution:
a) How many test cases do we have for all combinations?
2 x 3 x 3 x 3 = 54
b) Find out how many test cases can we have using orthogonal arrays, by
building the table.
It is possible to reduce from 54 test cases to 9 test cases!
52
macro.
Conclusions
53
Conclusions
Five main techniques referred by ISTQB
Equivalence class partitioning
Reduce number of tests
Decision tables
List all possible conditions
Orthogonal Arrays
Expose pair-wise defects
54
Useful Links
Link to ISTQB:
http://www.istqb.org/
Interesting Link:
http://www.testingstandards.co.uk/
55