Documente Academic
Documente Profesional
Documente Cultură
Written by
Adam Carmi
Outline
• Goal of testing
• Test cases, test suites and test data
• What is functional system testing?
• Coverage
• Functional testing techniques:
– Functional analysis
– Equivalence partitioning
– Boundary value analysis
2 Black Box Testing
The goal of software testing
• The process of uncovering evidence of defects in
software systems
– Does not include efforts associated with tracking down
bugs and fixing them
• No amount of testing will improve the quality of a
computer program
– The more testing we do of a system, the more
convinced we might be of its correctness
– Testing cannot in general prove a system works 100%
correctly
… … … …
Use
UseCase:
Case:Remove
RemoveTraffic
TrafficViolation
Violation
1.1. Supervisor
Supervisorcalls
callsfor
fordeletion
deletionofofthe
thechosen
chosenTraffic
TrafficViolation
Violation
2.2. TVRS
TVRSprompts
promptsSupervisor
Supervisorforforconfirmation
confirmation
3.3. Supervisor
Supervisorconfirms
confirms
4.4. TVRS
TVRSrequests
requestsOffendersDB
OffendersDBtotodelete
deletethe
theTraffic
TrafficViolation
Violation
from
fromthe
theoffender’s
offender’srecord
record
5.5. OffendersDB
OffendersDBapproves
approvesthat
thatthe
theTraffic
TrafficViolation
Violationhas
hasbeen
been
deleted
deleted
6.6. TVRS
TVRSallows
allowsSupervisor
Supervisortotolook
lookupupaanew
newTraffic
TrafficViolation
Violationasas
described
describedininthe
the“Lookup
“LookupTraffic
TrafficViolation”
Violation”UCUC
13 Black Box Testing
Example: Functional Analysis II
Test case ID: 134543
Pre-conditions: 1. TVRS initialized with test1.db database
2. Violation 243567 displayed in the “Lookup Violation” dialog
Related use cases: “Lookup Traffic Violation”, “Remove Traffic Violation”
Expected result Action
Confirmation dialog is displayed Press “Delete” button
“Lookup Violation” dialog is displayed Press the “Yes” button
A message dialog stating that violation Enter “243567” at “Violation ID” text field
“243567” is not stored in TVRS and press the “Search” button
Test results
Actual results: Passed
Failed
Defect diagnosis:
In
Inaddition,
addition,aaquery
query
could
couldbe
berun
runon
onthe
the
Offenders database
Offenders database
Verify effects
of change
Filled when
Can
Canaatester
tester the test case
diagnose
diagnosethe thecause
cause is executed
of
ofaadefect?
defect?
15 Black Box Testing
Technique: Equivalence
Partitioning
• Identifies ranges of input and initial conditions
that are expected to produce the same result
• A group of test cases form an equivalence class if:
– They test the same feature/scenario
– If one test reveals a fault, the other ones (probably) will
too
– If a test does not reveal a fault, the other ones
(probably) will not either
• It is adequate to use only a single representative of
the equivalence class
16 Black Box Testing
Example: Equivalence Partitioning I
Input
Inputvalue
valuespecification
specificationfor
for“Lookup
“LookupViolation”
Violation”form:
form:
“” Empty
Hasalongname Character# > 10 David Unknown violation Offender’s
first name
ad0@am Invalid character Rachel Single known
violation
Dan Many known
violations
“” Empty
… … … …
1.1. While
Whiletest
testcases
casescan
canbebeadded
added
•• Each
Each new test caseshould
new test case shouldinclude
includeasasmany
manyun-included
un-includedvalid
validnon-boundary
non-boundary
equivalence class representatives as possible
equivalence class representatives as possible
2.2. While
Whiletest
testcases
casescan
canbebeadded
added
•• Each
Each new test caseshould
new test case shouldinclude
includeasasmany
manyun-included
un-includedvalid
validboundary
boundary
equivalence class representatives as possible
equivalence class representatives as possible
3.3. While
Whiletest
testcases
casescan
canbebeadded
added
•• Each
Eachnew
newtest
testcase
caseshould
shouldinclude
includeaasingle
singleinvalid
invalidequivalence
equivalenceclass
class
representative
representativethat
thathas
hasnot
notbeen
beenincluded
includedbefore
before
4.4. Manually
Manually replace/remove redundant or infeasibletest-cases
replace/remove redundant or infeasible test-cases
65 25 70 45 25 50 [16, 60)
45 15 50 30 15 35 [60, 120]