Professional Documents
Culture Documents
11system Testing
11system Testing
15-413
Bernd Bruegge
School of Computer Science
Carnegie Mellon University
Pittsburgh PA 15213
17 November 1998
v November 24
v Purpose
w Sanity Check with Project Agreement
w Review of Analysis, System Design
w Presentation of Object Design
w Publication of APIs
A
Layer I
B C D Layer II
E F G Layer III
Unit Test
Authentication
Unit Test
System Test
Event Service PAID
Unit Test
Network
Unit Test
Learning
Unit Test
Database
Bernd Bruegge 15-413 Software Engineering 13
Bottom-up Testing Strategy
B C D Layer II
Test E G
E F Layer III
Test B, E, F
Test F
Test C Test
A, B, C, D,
E, F, G
Test D,G
Test G
DB Database
Stub Code Ingo’s IOU
(EPC, …)
B C D Layer II
E F G
Layer III
Test
Test A Test A, B, C, D A, B, C, D,
E, F, G
Layer I
Layer I + II
All Layers
v Top Layer:
w User Interface, Authentication, Learning
v Middle Layer:
w Network, Event Service
v Bottom Layer
w Database
B C D Layer II
E F G
Test E Layer III
Bottom Test B, E, F
Layer Test F
Tests
Test
A, B, C, D,
Test D,G E, F, G
Test G
Top Test A
Layer
Tests
Bernd Bruegge 15-413 Software Engineering 23
Pros and Cons of Sandwich Testing
v Test in parallel:
w Middle layer with drivers and stubs
w Top layer with stubs
w Bottom layer with drivers
v Test in parallel:
w Top layer accessing middle layer (top layer replaces
drivers)
w Bottom accessed by middle layer (bottom layer
replaces stubs)
B C D Layer II
Test E
Triple
Triple E F G
Layer III
Triple Test
Triple
Test B, E, F TestII
Test
TestII Double
Double
Test F Test
TestIIII
Test
Test D A, B, C, D,
Double
Double Test D,G E, F, G
Test
TestIIII
Test G
Test A
Test C Double
Double
Test
TestII
Bernd Bruegge 15-413 Software Engineering 26
Scheduling Sandwich Tests: 15-413 Fall 95
vv Factors
Factorsto
toconsider
consider vv Bottom
Bottomup upapproach
approachctd ctd
wwAmount
Amountof oftest
testharness
harness LTop-level
LTop-levelmodules
modulesare are
(stubs
(stubs&drivers)
&drivers) usually
usuallyimportant
importantand andcannot
cannot
wwLocation be
beneglected
neglectedup uptotothe
theend
endof
of
Locationofofcritical
criticalparts
partsin
in testing
the
thesystem
system testing
wwAvailability LLDetection
Detectionof ofuser
userinterface
interface
Availabilityofofhardware
hardware design
wwAvailability designerrors
errorspostponed
postponeduntil
until
Availabilityofofsubsystems
subsystems end
endofoftesting
testing
wwScheduling
Schedulingconcerns
concerns vv Top
Topdown
downapproach
approach
vv Bottom
Bottomupupapproach
approach JTest
JTestcases
casescancanbebedefined
definedin in
Jgood
Jgoodforforobject
objectoriented
oriented terms
termsofoffunctions
functionsexamined
examined
design
designmethodologies
methodologies LNeed
LNeedto tomaintain
maintaincorrectness
correctness
LTest
LTestdriver
driverinterfaces
interfacesmust
must of
oftest
teststubs
stubs
match
matchmodule
moduleinterfaces
interfaces LWriting
LWritingstubsstubscan
canbebedifficult
difficult
v Structure Testing
v Functional Testing
v Performance Testing
v Acceptance Testing
v Installation Testing
Subsystem
Subsystem Unit System
System Requirements
Code
Code Test Decomposition Requirements
Tested
Decomposition (from
(fromRAD)
RAD)
(from
(fromSDD)
SDD)
Subsystem User
User
Subsystem
Subsystem Unit Manual
Code Manual
Code Test
Tested Integration
Subsystem Functional
Test Test
Integrated Functioning
Tested Subsystems System
Subsystem
Integration
Integration
Strategy
Strategy
Subsystem
Subsystem Unit (from
Code (fromTest
TestManual)
Manual)
Code Test
All
Alltests
testsby
bydeveloper
developer
Validated Accepted
Functioning
System
System PerformanceSystem Acceptance Installation
Test Test Test
Usable
Tests
Testsby
byclient
client System
Tests
Testsby
bydeveloper
developer
User’s
User’sunderstanding
understanding
(from
(fromUser
UserManual?)
Manual?)
System in
Use
Tests
Tests(?)
(?) by
byuser
user
Bernd Bruegge 15-413 Software Engineering 31
Structure Testing
.
Essentially the same as black box testing
v Goal: Test functionality of system
v Test cases are designed from the requirements analysis
document (better: user manual) and centered around
requirements and key functions (use cases)
v The system is treated as black box.
v Unit test .cases can be reused, but in general new test
cases have to be developed.
v Security testing
w Ensures security requirements are met
v Timing testing
w Evaluates response times and time to perform a function
v Environmental test
w Tests tolerances for heat, humidity, motion, portability
v Quality testing
w Tests reliability, maintainability and availability of the system
v Recovery testing
w Tests system’s response to presense of errors or loss of data.
v Documentation testing
w Insures the required documents are written and are consistent,
accurate and easy to use
w Functions described but not implemented
w Functions implemented but not described
w Inconsistencies between requirements and user manual
v Human factors testing
w Tests user interface to system
vv 1.1.Based
Basedon
onthe
theintegration
integration vv 4.4.Do
Dostructural testing:Define
structuraltesting: Define
strategy,
strategy,select subsystemto
selectaasubsystem tobe
be test
testcases
casesthatthatexercise
exercisethe
the
tested.
tested.Unit
Unittest
testall
allthe
theclasses
classes selected
selectedsubsystems
subsystems
in the subsystem.
in the subsystem. vv 5.
. 2. Put selected subsystem 5.Execute
Executeperformance
performancetests
tests
vv 2. Put selected subsystem vv 6.
together; 6.Keep recordsof
Keeprecords ofthe
thetest
testcases
cases
together;dodoany
anypreliminary
preliminaryfix-
fix- and
andtesting
testingactivities.
activities.
up necessary to make
up necessary to make the the
integration vv 7.
7.Based
Basedon onthe
theintegration
integration
integrationtest
testoperational
operational strategy,
(drivers,
(drivers,stubs)
stubs) strategy,integrate
integratethe
thenext setof
nextset of
subsystems
subsystemsand andrepeat
repeatsteps
steps11
vv 3.
3.DoDofunctional testing:Define
functionaltesting: Define to
test to7.7.
testcases
casesthat
thatexercise
exerciseallalluses
uses
cases
caseswith
withthe
theselected
selected
subsystems
subsystems The
Theprimary
primarygoal goalofofintegration
integration
testing
testingisistotoidentify errorsin
identifyerrors inthe
the
(current)
(current)subsystem
subsystem
configuration.
configuration.
vv Goal:
Goal:Demonstrate
Demonstratesystem
systemisis vv Alpha
Alphatest:
test:
ready
readyfor
foroperational
operationaluse
use wwSponsor
Sponsoruses
usesthe
thesoftware
softwareatat
wwChoice
Choiceof oftests
testsisismade
madeby by thedeveloper’s
the developer’ssite.
site.
client/sponsor
client/sponsor wwSoftware
Softwareused
usedininaa
wwMany controlled
controlledsetting,
setting,with
withthe
Manytests
testscan
canbebetaken
taken the
from developer
developeralways
alwaysready
readyto
fromintegration
integrationtesting
testing to
fix
fixbugs.
bugs.
wwAcceptance
Acceptancetesttestisis
performed
performedby bythe
theclient,
client, vv Beta
Betatest:
test:
not
notbybythe
thedeveloper.
developer. wwConducted
Conductedat atsponsor’s
sponsor’ssite
site
vv Majority
Majorityof ofall
allbugs
bugsin insoftware
software (developer
(developerisisnot
notpresent)
present)
isistypically
typicallyfound
foundby bythe
theclient
client wwSoftware
after Softwaregets
getsaarealistic
realistic
afterthe
thesystem
systemisisin
inuse,
use,not
not workout in target
workout in target
bybythe
thedevelopers
developersor ortesters.
testers. environment
Therefore environment
Thereforetwotwokinds
kindsof of wwPotential
additional
additionaltests:
tests: Potentialcustomer
customermight
mightgetget
discouraged
discouraged
Bernd Bruegge 15-413 Software Engineering 39
Test Life Cycle
Test System
User Team Designer
Configuration
Management
Specialist
Bernd Bruegge 15-413 Software Engineering 41
Summary
vv Testing
Testingisisstill
stillaablack
blackart,
art,but
butmany
manyrules
rulesand
andheuristics
heuristics
are
areavailable
available
vv Testing
Testingconsists
consistsof
of unit
unittesting,
testing,integration
integrationtesting
testingand
and
system
systemtesting
testing
vv Testing
Testinghas
hasits
itsown
ownlifecycle
lifecycle
vv Test
Testdocumentation
documentationisiscrucial
crucial
vv Test
Testteam:
team:Different
Differentmembers
memberswithwithdifferent
differentbackgrounds
backgrounds
are
areimportant
important
vv Issues
Issuesnot
notcovered:
covered:
wwTesting
Testingofofparallel
parallelprograms
programs
wwTesting
Testing& &configuration
configurationmanagement
management
wwTesting
Testingmultiple
multipleplatforms
platforms
Bernd Bruegge 15-413 Software Engineering 42