Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
AmiBug.Com, Inc.
Test FundamentalsFor Expert Testers
Robert Sabourin
President
AmiBug.Com, Inc.
Montreal, Canada
[email protected] 5, 2014 © Robert Sabourin, 2014 Slide 1
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 2
• Robert Sabourin ,
Software Evangelist
• President
• AmiBug.Com Inc.
• Montreal, Quebec,
Canada
• www.amibug.com
Test FundamentalsFor Expert Testers
AmiBug.Com, Inc.
Quiz
• Application screens
are selected with
three controls:
(a) has 5 options
(b) has 6 options
(c) has 2 options
• How many screens can a user choose?
June 5, 2014 © Robert Sabourin, 2014 Slide 3
AmiBug.Com, Inc.
Quiz
• Total Combinations
= 6 x 5 x 2 = 60
• To exercise each
combination once a
total of 60 tests
would be required.
June 5, 2014 © Robert Sabourin, 2014 Slide 4
AmiBug.Com, Inc.
• How many tests
would be required to
exercise all possible
screens in every
possible order?.
Quiz
June 5, 2014 © Robert Sabourin, 2014 Slide 5
AmiBug.Com, Inc.
• To exercise all screens in every
possible order would require
60! Test cases
60! = 60 x 59 x 58 x ... 3 x 2 x 1
60! ≈ 8.32 x 10**81
Pop Quiz
June 5, 2014 © Robert Sabourin, 2014 Slide 6
AmiBug.Com, Inc.
Pop Quiz
From 7.0 × 10**79
To 1.5 × 10**82
How many atoms are in
the observable
universe?
June 5, 2014 © Robert Sabourin, 2014 Slide 7
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 8
Fundamental Question
• How do you know when you are finished?
AmiBug.Com, Inc.
What is Quality?
June 5, 2014 © Robert Sabourin, 2014 Slide 9
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 10
Crosby on Quality
• “Quality is defined as conformance to
requirements”
• “Quality is not a measure of
GOODNESS”
– Phil B. Crosby, Quality is Free
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 11
Gerald M. Weinberg
“Quality is value to some person”
Exploring Requirements Quality Before Design
Dorset House
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 12
“Quality is fitness for use”
Joseph Juran
Quality Control Handbook
AmiBug.Com, Inc.
What is Quality?
June 5, 2014 © Robert Sabourin, 2014 Slide 13
Conform to requirements
Value to stakeholders
Suit purpose
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 14
Edsger W. Dijkstra
• “Program testing can be used to show
the presence of bugs, but never to show
their absence”
AmiBug.Com, Inc.
Marcus Vitruvius PollioDe Architectura (25 BCE)
An architect should be ingenious …
… and apt in the
acquisition of
knowledge.
June 5, 2014 © Robert Sabourin, 2014 Slide 15
AmiBug.Com, Inc.
Marcus Vitruvius Pollio
• Skill set of an architect:
– Good writer
– Skilled draftsman
– Versed in geometry and optics
– Expert in figures
– Acquainted with history
– Informed on the principles of
natural and moral philosophy
– Musician
– Not ignorant of the sciencesJune 5, 2014 © Robert Sabourin, 2014 Slide 16
AmiBug.Com, Inc.
Marcus Vitruvius Pollio
• Quality Principles
– Firmatis (Durability) - It should stand
up robustly and remain in good
condition.
– Utilitas (Utility) - It should be useful
and function well for the people using
it.
– Venustatis (Beauty) - It should delight
people and raise their spirits.
June 5, 2014 © Robert Sabourin, 2014 Slide 17
AmiBug.Com, Inc.
Circa 25 BC
June 5, 2014 © Robert Sabourin, 2014 Slide 18
AmiBug.Com, Inc.
Circa 1979
June 5, 2014 © Robert Sabourin, 2014 Slide 19
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 20
"No! Try not, Do. Or do not.
There is no try."
Yoda
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 21
C. Northcote Parkinson
Parkinson’s Law:
“…work expands so as to fill the time available for its completion…”
AmiBug.Com, Inc.
Pareto Principle
• Vilfredo Pareto, 1848 - 1923, Economist
– 80% of the wealth was in the hands of 20%
of the population
June 5, 2014 © Robert Sabourin, 2014 Slide 22
AmiBug.Com, Inc.
Pareto Principle
Joseph Juran, 1904 - 2008
• 1950 Quality Control Handbook
• 20% of the study population accounts for 80% of the measure under consideration
• The critical few and the trivial many
June 5, 2014 © Robert Sabourin, 2014 Slide 23
AmiBug.Com, Inc.
Bugs on Bugs
Some Boolean algebra
June 5, 2014 © Robert Sabourin, 2014 Slide 24
AmiBug.Com, Inc.
Duck Season
• Who is the duck?
• Who is the rabbit?
• Isn’t it obvious?
• Peer rivalry
• Common nemesis
June 5, 2014 © Robert Sabourin, 2014 Slide 25
AmiBug.Com, Inc.
Rabbit Season
• Just because it
was written down
doesn't make it
so!
June 5, 2014 © Robert Sabourin, 2014 Slide 26
AmiBug.Com, Inc.
Duck Season
• Ambiguous
pronouns
• Fallacious
negation
• Role playing
June 5, 2014 © Robert Sabourin, 2014 Slide 27
AmiBug.Com, Inc.
Which Season?
June 5, 2014 © Robert Sabourin, 2014 Slide 28
ME HOME RESULT COMMENT
F F Shoot Rabbit now Probably the opposite the Rabbit Wanted
F T Shoot Rabbit at home Another interesting opposite
T F Shoot me now Funny opposite
T T Shoot me at home Suggested target
SHOOT
AmiBug.Com, Inc.
Boolean Logic
• Conditions– TRUE
– FALSE
• Primary Operators– AND
– OR
– XOR
– NOT
• Composite Operators– NAND
– NOR
June 5, 2014 © Robert Sabourin, 2014 Slide 29
AmiBug.Com, Inc.
Boolean Logic
• Demorgan’s Rule
– NOT ( (A) AND (B) ) = (NOT (A)) OR (NOT (B))
June 5, 2014 © Robert Sabourin, 2014 Slide 30
AmiBug.Com, Inc.
DeMorgan’s Law
A B Not A Not B A and B NOT (A and B) (Not A) or (Not B)
0 0 1 1 0 1 1
0 1 1 0 0 1 1
1 0 0 1 0 1 1
1 1 0 0 1 0 0
June 5, 2014 © Robert Sabourin, 2014 Slide 31
AmiBug.Com, Inc.
Boolean Logic
• Composed Logic
– Minterms
• For “n” logical variables there are 2n Minterms
• Any logical function of “n” variables can be
constructed from the logical OR of one or more
Minterms
June 5, 2014 © Robert Sabourin, 2014 Slide 32
AmiBug.Com, Inc.
Boolean Logic
• Composed Logic
– 2 Variable Minterms
MINTERM A B
M0 F F
M1 F T
M2 T F
M3 T T
June 5, 2014 © Robert Sabourin, 2014 Slide 33
AmiBug.Com, Inc.
Boolean Logic
• Composed Logic
– 3 Variable Minterms
MINTERM A B C
M0 F F F
M1 F F T
M2 F T F
M3 F T T
M4 T F F
M5 T F T
M6 T T F
M7 T T T
June 5, 2014 © Robert Sabourin, 2014 Slide 34
AmiBug.Com, Inc.
Boolean Logic
MINTERM A B C Y
M0 F F F F
M1 F F T T
M2 F T F T
M3 F T T F
M4 T F F T
M5 T F T F
M6 T T F F
M7 T T T T
Y = M1 OR M2 OR M4 OR M7
M1 = (NOT A) AND (NOT B) AND (C)
M2 = (NOT A) AND (B) AND (NOT C)
M4 = (A) AND (NOT B) AND (NOT C)
M7 = (A) AND (B) AND (C)June 5, 2014 © Robert Sabourin, 2014 Slide 35
AmiBug.Com, Inc.
Logic Reduction
• Express a logical relationship with fewer
terms
– Karnaugh (K) mapping
• Visual
– Quine-McCluskey
• Tabular
June 5, 2014 © Robert Sabourin, 2014 Slide 36
AmiBug.Com, Inc.
Ambiguous Requirements
• Is it really perfectly
clear?
• Do not tick off the
stakeholders
• Decision tables?
• Real communications?
June 5, 2014 © Robert Sabourin, 2014 Slide 37
AmiBug.Com, Inc.
Test Design
Decision Tables
June 5, 2014 © Robert Sabourin, 2014 Slide 38
AmiBug.Com, Inc.
• The following instructions are taken from FAFSASM,
the Free Application for Federal Student Aid form:
Step Four: Who is considered a parent in this step? Read these notes to
determine who is considered a parent for purposes of this form. Answer all
questions in Step Four about them, even if you do not live with them. Are you an
orphan, or are you or were you (until age 18) a ward/dependent of the court? If
Yes, skip Step Four. If your parents are both living and married to each other,
answer the questions about them. If your parent is widowed or single, answer the
questions about that parent. If your widowed parent is remarried as of today,
answer the questions about that parent and the person whom your parent
married (your stepparent). If your parents are divorced or separated, answer the
questions about the parent you lived with more during the past 12 months. (If you
did not live with one parent more than the other, give answers about the parent
who provided more financial support during the last 12 months, or during the
most recent year that you actually received support from a parent.) If this parent
is remarried as of today, answer the questions on the rest of this form about that
parent and the person whom your parent married (your stepparent).
System Requirements | Visual Models | Decision Tables
June 5, 2014 © Robert Sabourin, 2014 Slide 39
AmiBug.Com, Inc.
Decision Tables
Construction
1. Identify Conditions
2. Identify Actions
3. Relate Conditions to Actions with Rules
4. Logic Reduction
5. Tests each Rule
June 5, 2014 © Robert Sabourin, 2014 Slide 40
AmiBug.Com, Inc.
Decision Tables
Logic Modeling
Application Logic
Business Rules
Regulations
Multiple Conditions
Multiple Actions
June 5, 2014 © Robert Sabourin, 2014 Slide 41
AmiBug.Com, Inc.
Decision Tables
Conditions
Rules
Actions
June 5, 2014 © Robert Sabourin, 2014 Slide 42
AmiBug.Com, Inc.
Decision Tablesw
ww
.wik
ipedia
.co
m
June 5, 2014 © Robert Sabourin, 2014 Slide 43
AmiBug.Com, Inc.
Fizzbin
• Complex rules
• Conditions?
• Actions?
June 5, 2014 © Robert Sabourin, 2014 Slide 44
AmiBug.Com, Inc.
Fizzbin
• Each player gets six cards, except for the player on the dealer's right,
who gets seven
• The second card is turned up, except on Tuesdays
• Two jacks are a half-fizzbin
• If you have a half-fizzbin
• a third jack is a shralk and results in disqualification
• one wants a king and a deuce, except at night, when one wants a
queen and a four
• if a king had been dealt, the player would get another card, except
when it is dark, in which case he'd have to give it back
• The top hand is a "royal fizzbin", but the odds against getting one are
said to be "astronomical". June 5, 2014 © Robert Sabourin, 2014 Slide 45
AmiBug.Com, Inc.
University Acceptance
Decision Table
June 5, 2014 © Robert Sabourin, 2014 Slide 46
AmiBug.Com, Inc.
Decision TablesExample
Conditions R01 R02 R03 R04 R05 R06 R07 R08 R09 R10
SAT SCORE High High High High High High High High High High
Prerequisites All All All Core Only Core Only Core Only Partial Partial Partial None
Residency In State Out of State Foreign In State Out of State Foreign In State Out of State Foreign *
Actions
Accept x x x
Redirect x x x x
Conditional x x x
Reject
Grant x x x x x x
June 5, 2014 © Robert Sabourin, 2014 Slide 47
AmiBug.Com, Inc.
Decision TablesExample
Conditions R11 R12 R13 R14 R15 R16 R17 R18 R19 R20
SAT SCORE Medium Medium Medium Medium Medium Medium Medium Medium Medium Medium
Prerequisites All All All Core Only Core Only Core Only Partial Partial Partial None
Residency In State Out of State Foreign In State Out of State Foreign In State Out of State Foreign *
Actions
Accept x x x
Redirect x x x
Conditional x x x
Reject x
Grant x x x
June 5, 2014 © Robert Sabourin, 2014 Slide 48
AmiBug.Com, Inc.
Decision TableExample
Conditions R21 R22 R23 R24
SAT SCORE Low Low Low Low
Prerequisites All Core Only Partial None
Residency * * * *
Actions
Accept
Redirect
Conditional x
Reject x x x
Grant
June 5, 2014 © Robert Sabourin, 2014 Slide 49
AmiBug.Com, Inc.
DVD Rental
Decision Table
June 5, 2014 © Robert Sabourin, 2014 Slide 50
AmiBug.Com, Inc.
• The following rules describe how we process
DVDs that are not returned. Create a decision table
that represents these rules:
“When a DVD is “lost” (it has not been returned in 90 days) the following
rules apply: If the customer has not lost any DVDs in the preceding 12
months we do not suspend the account nor do we bill for the lost DVDs. If
the customer has lost 1-2 DVDs in the preceding 12 months and if they
have not filed a complaint with the USPS we do not suspend or bill, If the
customer has lost 1-2 in the preceding 12 months and if they have filed a
complaint with the USPS we do not suspend or bill. If the customer has
lost 3-4 DVDs in the preceding 12 months and if they have not filed a
complaint then we suspend their account but do not bill for the lost DVDs.
If the customer has lost 3-4 DVDs in the preceding 12 months and if they
have filed a complaint then we do not suspend their account nor do we bill
them. If the customer has lost 5 or more DVDs in the preceding 12 months
we suspend their account and bill them for the lost DVDs.”
System Requirements | Visual Models | Decision Tables | Exercise
June 5, 2014 © Robert Sabourin, 2014 Slide 51
AmiBug.Com, Inc.
Decision TableExample
Binary Ranges
Conditions Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6
Lost DVDs in past 12 Months (YES or NO) NO YES YES YES YES YES
Lost 1-2 DVDS in past 12 Months (YES or NO) NO YES YES YES YES YES
Complaint to USPS Dcare NO YES NO YES Dcare
Lost 3-4 DVDs in past 12 Months (YES or NO) NO NO NO YES YES YES
Lost 5 or more DVDs in past 12 Months (YES or NO) NO NO NO NO NO YES
Actions
Suspend account NO NO NO YES NO YES
Bill for lost DVDs NO NO NO NO NO YES
June 5, 2014 © Robert Sabourin, 2014 Slide 52
AmiBug.Com, Inc.
Decision TableExample
Conditions Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6
Number of DVDs lost in past 12 Months 0 1-2 1-2 3-4 3-4 5 +
Filled Complaint with USPS Dcare YES NO YES NO Dcare
Actions
Suspend account NO NO NO NO YES YES
Bill for lost DVDs NO NO NO NO NO YES
Value Ranges
June 5, 2014 © Robert Sabourin, 2014 Slide 53
AmiBug.Com, Inc.
Decision TableExample
Conditions Rule 1 Rule 2 Rule 3 Rule 4
Number of DVDs lost in past 12 Months 0-2 3-4 3-4 5 +
Filled Complaint with USPS * YES NO Dcare
Actions
Suspend account NO NO YES YES
Bill for lost DVDs NO NO NO YES
Reduced
June 5, 2014 © Robert Sabourin, 2014 Slide 54
AmiBug.Com, Inc.
Customer Business Rules
Decision Tables
June 5, 2014 © Robert Sabourin, 2014 Slide 55
AmiBug.Com, Inc.
Decision Tables
Elicited from customer
June 5, 2014 © Robert Sabourin, 2014 Slide 56
AmiBug.Com, Inc.
Decision Tables
Reduced
June 5, 2014 © Robert Sabourin, 2014 Slide 57
AmiBug.Com, Inc.
Monopoly®
House Purchase Rules
Decision Tables
June 5, 2014 © Robert Sabourin, 2014 Slide 58
AmiBug.Com, Inc.
Decision Tables
• House Purchase
Rules
• Property must be in
a color group
• A player must own
all properties of a
color group
• No properties can
be mortgaged
June 5, 2014 © Robert Sabourin, 2014 Slide 59
AmiBug.Com, Inc.
Decision Tables
• House Purchase
Rules
• Houses must be
available for sale
• Houses must be
built progressively
• Each property can
have a maximum of
4 houses
June 5, 2014 © Robert Sabourin, 2014 Slide 60
AmiBug.Com, Inc.
Decision Tables
• House Purchase
Rules
• If multiple players
attempt to purchase
the same house the
highest auction
bidder gets it
June 5, 2014 © Robert Sabourin, 2014 Slide 61
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 62
AmiBug.Com, Inc.
Wrap-O-Matic
Decision Tables
June 5, 2014 © Robert Sabourin, 2014 Slide 63
AmiBug.Com, Inc.
Decision Tables
• Wrapping Rules:• Disallows ribbons applied to unwrapped
chocolates.
• Disallows hollow chocolates tied with metallic
ribbon.
• Uses the gentle wrapping algorithm with tissues
wrappers.
June 5, 2014 © Robert Sabourin, 2014 Slide 64
AmiBug.Com, Inc.
Decision Tables
• Wrapping Rules:• Uses the rapid wrapping algorithm whenever
chocolates do not have ribbons and do not
have tissue wrappers.
• Uses the gentle algorithm whenever hollow
chocolates are tied with ribbons.
• Uses the normal algorithm for all other cases.
June 5, 2014 © Robert Sabourin, 2014 Slide 65
AmiBug.Com, Inc.
Decision Tables
Rules
R01 R02 R03 R04 R05 R06 R07 R08 R09 R10 R11 R12 R13 R14 R15
Co
nd
itio
ns
Viscosity Hollow Not Hollow
Ribbon Metallic Other None Metallic or Other None
WrapperMetallic
or PaperTissue None
Metallic
or PaperTissue None
Metallic
or PaperTissue None
Metallic
or PaperTissue None
Metallic
or PaperTissue None
Act
ions
Disallow x x x . . x . . . . . x . . .
Rapid
Algorithm. . . - . - X . x . . . x . x
Normal
Algorithm. . . . . . . . . x . . . . .
Gentle
Algorithm. - . x x x . x . . x . . x .
Wrapping Rules
June 5, 2014 © Robert Sabourin, 2014 Slide 66
AmiBug.Com, Inc.
Problem Solving
How to solve it?
June 5, 2014 © Robert Sabourin, 2014 Slide 67
AmiBug.Com, Inc.
Amazon Problem
• So what would you do next?
– Give 3 alternatives
June 5, 2014 © Robert Sabourin, 2014 Slide 68
AmiBug.Com, Inc.
Problem Solving
June 5, 2014 © Robert Sabourin, 2014 Slide 69
George Pólya
1945
AmiBug.Com, Inc.
Pólya onProblem Solving
How to solve problems
• Understand it
• Plan it
• Do it
• Review it
June 5, 2014 © Robert Sabourin, 2014 Slide 70
AmiBug.Com, Inc.
Pólya onProblem Solving
Understand it
• What are you asked to find or show?
• Can you restate the problem in your own words?
• Can you make a diagram to help understand the problem?
• Is there enough information to find a solution?
• Do you understand concepts used in stating the problem?
• Do you need to ask a question to get the answer?
June 5, 2014 © Robert Sabourin, 2014 Slide 71
AmiBug.Com, Inc.
Pólya onProblem Solving
Plan it
• Guess and check
• Make an orderly list
• Eliminate possibilities
• Use symmetry
• Consider special cases
• Use direct reasoning
• Solve an equation
June 5, 2014 © Robert Sabourin, 2014 Slide 72
AmiBug.Com, Inc.
Pólya onProblem Solving
Plan it
• Look for a pattern
• Draw a picture
• Solve a simpler problem
• Use a model
• Work backward
• Use a formula
• Be creative
• Use your head
June 5, 2014 © Robert Sabourin, 2014 Slide 73
AmiBug.Com, Inc.
Pólya onProblem Solving
Do it
• Prepare
• Follow plan
• Learn
• Adapt
June 5, 2014 © Robert Sabourin, 2014 Slide 74
AmiBug.Com, Inc.
Pólya onProblem Solving
Review it
• Did we solve it?
• Any partial solution?
• Next step?
• New strategy?
June 5, 2014 © Robert Sabourin, 2014 Slide 75
AmiBug.Com, Inc.
Pólya Heuristics
Analogy
• Can you find a problem analogous to your problem and solve that?
Generalization
• Can you find a problem more general than your problem
Induction
• Can you solve your problem by deriving a generalization from some examples?
Variation of the Problem
• Can you vary or change your problem to create a new problem (or set of problems) whose solution(s) will help you solve your original problem?
Auxiliary Problem
• Can you find a subproblem or side problem whose solution will help you solve your problem?
June 5, 2014 © Robert Sabourin, 2014 Slide 76
AmiBug.Com, Inc.
Pólya Heuristics
Pattern recognition
• Can you find a problem related to yours that has already been solved and use that to solve your problem?
Specialization
• Can you find a problem more specialized?
Decomposing and Recombining
• Can you decompose the problem and "recombine its elements in some new manner"?
Divide and conquer
• Working backward Can you start with the goal and work backwards to something you already know?
Backward chaining
• Draw a Figure Can you draw a picture of the problem
June 5, 2014 © Robert Sabourin, 2014 Slide 77
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 78
Test Design
Variable identification
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 79
Identify Variables
• What is a variable?
– To VARY is to CHANGE
• A variable is something which can
change
– Software behavior depends on the
VALUES of many VARIABLES
• Anything which influences the
behavior of software could be a
variable
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 80
Identify Variables
• Review test basis
• Identify variables– Influencers
– Outcomes
• Potential Sources– Conditions
– Environment
– Rules
– Constraints
– Actions
– States
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 81
Wrap-O-Matic
Variable identification
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 82
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 83
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 84
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 85
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 86
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 87
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 88
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 89
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 90
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 91
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 92
Gmail Image Attachment
Variable identification
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 93
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 94
Examples
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 95
Examples
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 96
Insurance Policy Cancelation
Variable identification
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 97
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 98
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 99
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 100
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 101
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 102
AmiBug.Com, Inc.
Identify Variables
June 5, 2014 © Robert Sabourin, 2014 Slide 103
Act on variables
Ignore
Default values
Specific values
Observe
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 104
Test Design
Equivalence Classes
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 105
• Equivalence class– A subset of all possible test values to a variable
– Each member assumed provide the same info
– Each variable may have many classes
– Equivalence class are not mutually exclusive
– Focus testing
– Reduce the number of test cases
Taking AIM
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 106
Sets – Venn DiagramEquivalence Classes
b
a
c
a
b c
d
a b
c d
e
f
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 107
Equivalence Classes
– Sources• Requirements
– Business logic
– Capabilities
– Ranges
– Constraints
• Code
– Decisions
– Intermediate computations
• Data
– Input fields
– Database
– Internal structures
Equivalence
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 108
AIM - Equivalence Classes
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 109
Square Root Function
AIM - Equivalence Classes
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 110
Example: SQRT XEquivalence Classes
Mind Map
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 111
Date Field
AIM - Equivalence Classes
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 112
Example: Date FieldEquivalence Classes
Mind Map
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 113
Insurance Claim Amount
AIM - Equivalence Classes
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 114
Example: Claim AmountEquivalence Classes
Mind Map
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 115
Gmail “to composed”
AIM - Equivalence Classes
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 116
Example: Gmail To ComposedEquivalence Classes
Mind Map
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 117
Example: Gmail To ComposedEquivalence Classes
Mind Map
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 118
Example: Gmail To ComposedEquivalence Classes
Mind Map
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 119
Example: Gmail To ComposedEquivalence Classes
Mind Map
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 120
Example: Gmail To ComposedEquivalence Classes
Mind Map
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 121
Scenario Based Testing
AmiBug.Com, Inc.
Whiteboarding
June 5, 2014 © Robert Sabourin, 2014 Slide 122
Use
r M
ind
Ma
p
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 123
Buying a Book
Usage Scenarios
AmiBug.Com, Inc.
Whiteboarding
June 5, 2014 © Robert Sabourin, 2014 Slide 124
Sto
ry B
oa
rd
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 125
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 126
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 127
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 128
Social Networking
Usage Scenarios
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 129
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 130
Scenario Based Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 131
Scenario Based Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 132
Scenario Based Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 133
Scenario Based Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 134
Scenario Based Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 135
Scenario Based Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 136
Scenario Based Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 137
Scenario Based Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 138
Test Design
Control Flow Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 139
Control Flow Testing
• Exercise paths through a
system
– Data Flow
– Transaction Flow
– Code Flow
– Process Flow
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 140
Control Flow Testing
• Model flow
– Create control flow diagram
– Find basis paths• Minimal set of transactions
• Exercise at least once
– Each step
– Each decision
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 141
Control Flow Testing
– Process Steps
• A flows to B
• B flow to C
B
A
C
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 142
Control Flow Testing
– Decisions
• A flow to B or C
CB
A
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 143
Control Flow Testing
– Junctions
• A or B flow to C
A
C
B
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 144
Control Flow Testing
– Minimal basis paths
• N – number of nodes
• E – number of edges
• P – number of basis paths
• P = E – N + 2
• McCabe Cyclomatic Complexity
B
A
C D
F G
E
H
I
N=9
E=10
P=10-9+2
P=3
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 145
Control Flow Testing
– A set of basis paths:
• A B D E G H I
• A B C E G H I
• A B D E F H I
B
A
C D
F G
E
H
I
N=9
E=10
P=10-9+2
P=3
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 146
Control Flow Testing
– Finding basis paths:
1. Start with a typical baseline
2. Flip first decision keep rest as similar as possible
3. Continue flipping decisions on baseline
4. After all decisions on baseline have been flipped continue on next path
5. Stop when all paths have been exhausted
B
A
C D
F G
E
H
I
N=9
E=10
P=10-9+2
P=3
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 147
Keyword Optimization
Control Flow Diagram
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 148
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 149
ST A
B
E
C
END
IHG
D
F
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 150
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 151
Control Flow Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 152
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 153
Insurance Workflow
Control Flow Diagram
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 154
Control Flow Testing
• Application screens
are selected with
three controls:
(a) has 5 options
(b) has 6 options
(c) has 2 options
• How many screens can a user choose?
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 155
Control Flow Testing
• Total Combinations
= 6 x 5 x 2 = 60
• To exercise each
combination once a
total of 60 tests
would be required.
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 156
Control Flow Testing
• How many tests
would be required to
exercise all possible
screens in every
possible order?.
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 157
Control Flow Testing
• To exercise all screens in every
possible order would require
60! Test cases
60! = 60 x 59 x 58 x ... 3 x 2 x 1
60! ≈ 8.32 x 10**81
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 158
Control Flow Testing
From 7.0 × 10**79
To 1.5 × 10**82
How many atoms are in
the observable
universe?
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 159
Control Flow Testing
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 160
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 161
Control Flow Diagram to Identify Basis Paths
Basis Paths
p01 Start Dispatch L M N P Q R
p02 Start Dispatch X Y AA AB R
p03 Start Dispatch AC AF AJ AI AK R
p04 Start Dispatch AD AE AF AJ AI AK R
p05 Start Dispatch O P Q R
p06 Start Dispatch K P Q R
p07 Start Dispatch I J C D H P Q R
p08 Start Dispatch A B C D H P Q R
p09 Start Dispatch L M N P S T Q R
p10 Start Dispatch L M N P S T U R
p11 Start Dispatch L M N P S T U V W R
p12 Start Dispatch X Z AA AB R
p13 Start Dispatch X Z AA AM R
p14 Start Dispatch X Z AA AM AN AP AQ R
p15 Start Dispatch X Z AA AM AN AO AQ R
p16 Start Dispatch AC AF AG R
p17 Start Dispatch AC AF AH R
p18 Start Dispatch AC AF AJ AL AM R
p19 Start Dispatch AC AF AJ AL R
p20 Start Dispatch I J C D E F R
p21 Start Dispatch I J C D E G R
p22 Start Dispatch A B R
Nodes 45
Edges 65
Complexity 22 E-N+2
AmiBug.Com, Inc.
Control Flow
• Some interesting
control flow test ideas
– All nodes
– All edges
– All paths
June 5, 2014 © Robert Sabourin, 2014 Slide 162
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 163
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 164
Test Design
State Models
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 165
Gerald M. Weinberg
“A state is a situation which can be
recognized if it occurs again”
An Introduction to General Systems
ThinkingDorset House
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 166
State Models
“Stateful” Systems
Transactions
Embedded Systems
Process
Workflow
User Interface
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 167
State Models
State
A
State
B
Transition i
Transition j
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 168
State Models
Construction
1. Identify: States
2. Identify: Transitions
3. Identify: Triggers and Outcomes
4. Test: Get to Each State
5. Test: Exercise Each Transition
6. Test: Cover Each Path
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 169
San Diego Singles Pattern
State Models
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 170
State ModelsSan Diego Singles Pattern
State
C
Transition k
Transition l
State
B
Transition i
Transition j
State
A
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 171
State ModelsSan Diego Singles Pattern
Non
Existing
Departed
Come to be
Together
Get Together
Separate
Single
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 172
Stack Pattern
State Models
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 173
Loaded
Push
Pop beyond Min
State ModelsStack Pattern
Full
Push beyond Max
Pop
Empty
Attempted
Pop
Attempted
PushPush
Pop
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 174
Embedded Systems
State Models
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 175
State ModelsCoffee Machine
power up
idleinserting
coins
user
choose
make
coffee
service
needed
coin insertedreset button
coin return
right amount
enteredcoin return
button pushed
no cups
OR no coffee
OR sensor jam
cup removed
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 176
Insurance Transactions
State Models
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 177
State ModelsTransaction
Cancel
Null
Warning
Approved ActiveIssued PaidRequest
Ord
er
su
bm
itte
d
Cre
dit a
nd R
isks O
K
Cre
ate
Po
licy
Re
ce
ive
Pa
ym
en
t
Po
licy A
ctiva
ted
Late Pay
No Pay
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 178
Wrap-O-Matic
State Models
AmiBug.Com, Inc.
State Models
June 5, 2014 © Robert Sabourin, 2014 Slide 179
IdleError State
Wrapping
Sta
rt Wra
p-o
-Matic
Pre
ssed S
top o
r
Wra
ppin
g C
om
ple
te
Power Up
Attemp to Start without
Manifest or Insufficient
Materials Needed
Pro
cessin
g E
rror
Recovery
System Reset
Recovery Complete
Inputting ManifestBacking up Reports
Inputting Manifest
Backing up
Reports
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 180
State Models
Tools of the Trade
Baskets
Index Cards
Excel
Visio
Power Point
Case Tools
AmiBug.Com, Inc.
State Models
Model Based Testing
Finite State Machines
Robots
ProbesJune 5, 2014 © Robert Sabourin, 2014 Slide 181
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 182
Test Design
Failure Mode Analysis
AmiBug.Com, Inc.
Failure Mode Analysis
Failure Mode and Effects Analysis
Create block diagram
List classes of users
Find elements which can fail
Create usage/failure table
Rank potential failure impacts
June 5, 2014 © Robert Sabourin, 2014 Slide 183
AmiBug.Com, Inc.
Failure Mode Analysis
Create block diagram
Blocks
• System Elements
• Processes
• Subsystems
Connector
• Logical relationships
• Physical relationships
• Process invocations
June 5, 2014 © Robert Sabourin, 2014 Slide 184
AmiBug.Com, Inc.
Failure Mode Analysis
List classes of usersWho are the users?
What are they doing?
Classes
Personas
Context
June 5, 2014 © Robert Sabourin, 2014 Slide 185
AmiBug.Com, Inc.
Failure Mode Analysis
Find elements which can fail
• Break
• Constrained
• Slow
• ABEND
• Crash
June 5, 2014 © Robert Sabourin, 2014 Slide 186
AmiBug.Com, Inc.
Failure Mode Analysis
Create usage/failure table
•Scenarios
• Interesting blocks
June 5, 2014 © Robert Sabourin, 2014 Slide 187
AmiBug.Com, Inc.
Failure Mode Analysis
June 5, 2014 © Robert Sabourin, 2014 Slide 188
Rank potential failure impacts
S4 –
Cosmetic
• User can accomplish the task with some inconvenience
S3 –
Work around
• User can accomplish task by working around the problem
S2 –
No Work around
• User cannot accomplish some tasks
S1 –
Show stopper
• User cannot accomplish any tasks
S0 –
No Impact
• User can accomplish the task
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 189
Wrap-O-Matic
Failure Mode Analysis
AmiBug.Com, Inc.
Whiteboarding
June 5, 2014 © Robert Sabourin, 2014 Slide 190
Fa
ilure
Mo
de
s
AmiBug.Com, Inc.
Failure Mode Analysis
June 5, 2014 © Robert Sabourin, 2014 Slide 191
AmiBug.Com, Inc.
Failure Mode Analysis
June 5, 2014 © Robert Sabourin, 2014 Slide 192
AmiBug.Com, Inc.
June 5, 2014 © Robert Sabourin, 2014 Slide 193
Prize Server
Failure Mode Analysis
AmiBug.Com, Inc.
Failure Mode Analysis
June 5, 2014 © Robert Sabourin, 2014 Slide 194
Prize
Manageme
nt Interface
Prize TableGame
ServerPrize Server
Prize
Spinner
Prize Status
ReporterGame Server
System Elements
AmiBug.Com, Inc.
Failure Mode Analysis
Users
Prize Administrator
Database Administrator
Auditor
Player
June 5, 2014 © Robert Sabourin, 2014 Slide 195
AmiBug.Com, Inc.
Failure Mode Analysis
June 5, 2014 © Robert Sabourin, 2014 Slide 196
Prize System Failure Modes
Pri
ze
Man
age
me
nt
Inte
rfac
e
Pri
ze S
tatu
s
Re
po
rter
Pri
zeT
ab
le
Pri
zeSe
rve
r
Ga
me
Ser
ver
Pri
zeS
pin
ner
User Scenario What if the process fails?
Prize Administrator Add prize S1 S0 S1 S0 S0 S0
Prize Administrator Change prize dates S3 S0 S1 S0 S0 S0
Prize Administrator Change prize amounts S3 S0 S1 S0 S0 S0
Prize Administrator Stop prizes S3 S0 S1 S0 S0 S0
Prize Administrator Start prizes S3 S0 S1 S0 S0 S0
Database Administrator Report prize statusS0 S0 S1 S0 S0 S0
Database Administrator Modify prize statusS0 S0 S1 S0 S0 S0
Auditor View prize schedule S0 S3 S1 S0 S0 S0
Auditor View prizes awarded S0 S3 S1 S0 S0 S0
Auditor View prizes remaining S0 S3 S1 S0 S0 S0
Player Spin for prize S0 S0 S1 S1 S1 S1
AmiBug.Com, Inc.
Thank You
• Questions?
June 5, 2014 © Robert Sabourin, 2014 Slide 197