Tải bản đầy đủ (.pdf) (55 trang)

Dynamic Testing Techniques

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (219.63 KB, 55 trang )

Dynamic Testing Techniques
Software Testing
ISEB Foundation Certificate Course
1 Principles 2 Lifecycle
4 Dynamic test
techniques
3 Static testing
5 Management 6 Tools
1
Contents
What is a testing technique?
Black and White box testing
Black box test techniques
White box test techniques
Error Guessing
ISEB Foundation Certificate Course
Dynamic Testing Techniques
1 2 3
4 5 6
2
Why dynamic test techniques?
n Exhaustive testing (use of all possible inputs
and conditions) is impractical
must use a subset of all possible test casesmust use a subset of all possible test cases
must have high probability of detecting faultsmust have high probability of detecting faults
n Need thought processes that help us select
test cases more intelligently
test case design techniques are such thought test case design techniques are such thought
processesprocesses
3
What is a testing technique?


n a procedure for selecting or designing tests
n based on a structural or functional model of
the software
n successful at finding faults
n 'best' practice
n a way of deriving good test cases
n a way of objectively measuring a test effort
Testing should be rigorous, thorough and systematic
4
Using techniques makes testing much more effective
Advantages of techniques
n Different people: similar probability find faults
gain some independence of thoughtgain some independence of thought
n Effective testing: find more faults
focus attention on specific types of faultfocus attention on specific types of fault
know you're testing the right thing know you're testing the right thing
n Efficient testing: find faults with less effort
avoid duplicationavoid duplication
systematic techniques are measurablesystematic techniques are measurable
5
Measurement
n Objective assessment of thoroughness of
testing (with respect to use of each technique)
useful for comparison of one test effort to anotheruseful for comparison of one test effort to another
n E.g.
Project A
60% Equivalence
partitions
50% Boundaries
75% Branches

Project B
40% Equivalence
partitions
45% Boundaries
60% Branches
6
Contents
What is a testing technique?
Black and White box testing
Black box test techniques
White box test techniques
Error Guessing
ISEB Foundation Certificate Course
Dynamic Testing Techniques
1 2 3
4 5 6
7
Three types of systematic technique
Static (non-execution)
•• examination of documentation,examination of documentation,
source code listings, etc.source code listings, etc.
Functional (Black Box)
•• based on behaviour /based on behaviour /
functionality of softwarefunctionality of software
Structural (White Box)
•• based on structurebased on structure
of softwareof software
8
Some test techniques
Static

Dynamic
Structural
Behavioural
FunctionalNon-functional
ReviewsReviews
WalkthroughsWalkthroughs
Desk-checkingDesk-checking
Data
Flow
Symbolic
Execution
Symbolic
Execution
Definition
-Use
Definition
-Use
StatementStatement
Branch/DecisionBranch/Decision
Branch ConditionBranch Condition
Branch Condition
Combination
Branch Condition
Combination
LCSAJLCSAJ
ArcsArcs
Equivalence
Partitioning
Equivalence
Partitioning

Boundary
Value Analysis
Boundary
Value Analysis
Cause-Effect GraphingCause-Effect Graphing
RandomRandom
UsabilityUsability
PerformancePerformance
Static AnalysisStatic Analysis
InspectionInspection
Control
Flow
etc.etc.
etc.etc.
etc.etc.
etc.etc.
etc.etc.
State TransitionState Transition
9
Black box versus white box?
Integration
Component
Acceptance
System
Black box appropriate
at all levels but
dominates higher
levels of testing
White box used
predominately

at lower levels
to compliment
black box
10
Contents
What is a testing technique?
Black and White box testing
Black box test techniques
White box test techniques
Error Guessing
ISEB Foundation Certificate Course
Dynamic Testing Techniques
1 2 3
4 5 6
11
Black Box test design and
measurement techniques
n Techniques defined in BS 7925-2
Equivalence partitioningEquivalence partitioning
Boundary value analysisBoundary value analysis
State transition testingState transition testing
CauseCause effect graphingeffect graphing
Syntax testingSyntax testing
Random testingRandom testing
n Also defines how to specify other techniques
= Yes
= No
Also a measurement
technique?
12

Equivalence partitioning (EP)
divide (partition) the inputs, outputs, etc. into areas divide (partition) the inputs, outputs, etc. into areas
which are the same (equivalent)which are the same (equivalent)
assumption: if one value works, all will workassumption: if one value works, all will work
one from each partition better than all from oneone from each partition better than all from one
1 100 1010
valid invalidinvalid
13
Boundary value analysis (BVA)
faults tend to lurk near boundariesfaults tend to lurk near boundaries
good place to look for faultsgood place to look for faults
test values on both sides of boundariestest values on both sides of boundaries
1 100 1010
valid invalidinvalid
14
Example: Loan application
Customer Name
Account number
Loan amount requested
Term of loan
Monthly repayment
Term:
Repayment:
Interest rate:
Total paid back:
6 digits, 1st
non-zero
£500 to £9000
1 to 30 years
Minimum £10

2-64 chars.
15
Customer name
Number of characters:
2 64 65
invalid valid invalid
1
Conditions
Valid
Partitions
Invalid
Partitions
Valid
Boundaries
Invalid
Boundaries
Customer
name
2 to 64 chars
valid chars
< 2 chars
> 64 chars
invalid chars
2 chars
64 chars
1 chars
65 chars
0 chars
Valid characters:
Any

other
A-Z
a-z
-’
space
16
Account number
5 6 7
invalid
valid
invalid
number of digits:
first character:
invalid: zero
valid: non-zero
Conditions
Valid
Partitions
Invalid
Partitions
Valid
Boundaries
Invalid
Boundaries
Account
number
6 digits
1
st
non-zero

< 6 digits
> 6 digits
1
st
digit = 0
non-digit
100000
999999
5 digits
7 digits
0 digits
17
Loan amount
500 9000 9001
invalid valid invalid
499
Conditions
Valid
Partitions
Invalid
Partitions
Valid
Boundaries
Invalid
Boundaries
Loan
amount
500 - 9000 < 500
>9000
0

non-numeric
null
500
9000
499
9001
18
Condition template
Conditions
Valid
Partitions
Tag
Invalid
Partitions
Tag
Valid
Boundaries
Tag
Invalid
Boundaries
Tag
Customer
name
2 - 64 chars
valid chars
V1
V2
< 2 chars
> 64 chars
invalid char

X1
X2
X3
2 chars
64 chars
B1
B2
1 char
65 chars
0 chars
D1
D2
D3
Account
number
6 digits
1
st
non-zero
V3
V4
< 6 digits
> 6 digits
1
st
digit = 0
non-digit
X4
X5
X6

X7
100000
999999
B3
B4
5 digits
7 digits
0 digits
D4
D5
D6
Loan
amount
500 - 9000
V5
< 500
>9000
0
non-integer
null
X8
X9
X10
X11
X12
500
9000
B5
B6
499

9001
D7
D8
19
Design test cases
Test
Case
Description Expected Outcome New Tags
Covered
1
2
Name: John Smith
Acc no: 123456
Loan: 2500
Term: 3 years
Name: AB
Acc no: 100000
Loan: 500
Term: 1 year
Term: 3 years
Repayment: 79.86
Interest rate: 10%
Total paid: 2874.96
Term: 1 year
Repayment: 44.80
Interest rate: 7.5%
Total paid: 537.60
V1, V2,
V3, V4,
V5

B1, B3,
B5,
20
Why do both EP and BVA?
n If you do boundaries only, you have covered
all the partitions as well
technically correct and may be OK if everything technically correct and may be OK if everything
works correctly!works correctly!
if the test fails, is the whole partition wrong, or is a if the test fails, is the whole partition wrong, or is a
boundary in the wrong place boundary in the wrong place have to test midhave to test mid
partition anywaypartition anyway
testing only extremes may not give confidence for testing only extremes may not give confidence for
typical use scenarios (especially for users)typical use scenarios (especially for users)
boundaries may be harder (more costly) to set upboundaries may be harder (more costly) to set up
21
Test objectives?
n For a thorough approach: VP, IP, VB, IB
n Under time pressure, depends on your test objective
minimal userminimal user confidence: VP only?confidence: VP only?
maximum fault finding: VB first (plus IB?)maximum fault finding: VB first (plus IB?)
Condition Valid
Partition
Tag Invalid
Partition
Tag Valid
Boundary
Tag Invalid
Boundary
Tag
22

Decision tables
n explore combinations of inputs, situations or
events,
n it is very easy to overlook specific
combinations of input
n start by expressing the input conditions of
interest so that they are either TRUE or FALSE
– record found
– file exists
– code valid
– policy expired
– account in credit
– due date > current date
23
Example: student access
A university computer system allows students
an allocation of disc space depending on their
projects.
If they have used all their allotted space, they
are only allowed restricted access, i.e. to
delete files, not to create them. This is
assuming they have logged on with a valid
username and password.
What are the input and output conditions?
24
List the input and output conditions
• list the ‘output
conditions’ under the
input conditions
Input Conditions

Valid username
Valid password
Account in credit
Output Conditions
Login accepted
Restricted access
• list the ‘input
conditions’ in the first
column of the table
25

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×