Beruflich Dokumente
Kultur Dokumente
Guidant Corporation
Minneapolis/St Paul, MN
Learning objectives1
SoftwareTestingand
References
1
SoftwareTestingand
Software Reliability
Reliabilityisonequalitymetric.Othersinclude
performance,maintainability,portability,and
interoperability
SoftwareTestingand
Operating Environment
Hardware:Machineandconfiguration
Software:OS,libraries,etc.
Usage(Operationalprofile)
SoftwareTestingand
Uncertainty
Uncertaintyisacommonphenomenainourdailylives.
Insoftwareengineering,uncertaintyoccursinallphasesofthe
softwarelifecycle.
Examples:
Willtheschedulebemet?
Howmanymonthswillittaketocompletethedesign?
Howmanytesterstodeploy?
Whatisthenumberoffaultsremainingfaults?
SoftwareTestingand
Uncertaintycanbequantifiedandmanagedusingprobability
theoryandstatisticalinference.
Probabilitytheoryassistswithquantificationandcombinationof
uncertainties.
Statisticalinferenceassistswithrevisionofuncertaintiesin
lightoftheavailabledata.
SoftwareTestingand
Probability Theory
Inanysoftwareprocessthereareknownandunknown
quantities.
TheknownquantitiesconstitutehistoryandisdenotedbyH.
Theunknownquantitiesarereferredtoasrandom
quantities.
Eachunknownquantityisdenotedbyacapitallettersuch
asTorX.
SoftwareTestingand
Random Variables
SpecificvaluesofTandXaredenotedbylowercaseletterst
andxandareknownasrealizationsofthecorresponding
randomquantities.
Whenarandomquantitycanassumenumericalvaluesitis
knownasarandomvariable.
Example:IfXdenotestheoutcomeofacointoss,thenX
canassumeavalue0(forhead)and1(fortail).Xisa
randomvariableundertheassumptionthatoneachtossthe
outcomeisnotknownwithcertainty.
SoftwareTestingand
Probability
in light of
history H is given by
P (E |H)
P (E )
SoftwareTestingand
10
Random Events
Arandomquantitythatmayassumeoneoftwovalues,say
e1ande2,isarandomeventoftendenotedbyE.
Examples:
ProgramPwillfailonthenextrun.
ApplicationAcontainsnoerrors.
ThetimetonextfailureofapplicationAwillbegreaterthant.
ThedesignforapplicationAwillbecompletedinlessthan3months.
SoftwareTestingand
11
Whene1ande2arenumericalvalues,suchas0and1,thenEis
knownasabinaryrandomvariable.
Adiscreterandomvariableisonewhoserealizationsare
countable.
Example:Numberoffailuresencounteredoverfourhoursofapplication
use.
Acontinuousrandomvariableisonewhoserealizationsarenot
countable.
Example:Timetonextfailure.
SoftwareTestingand
12
P( X
If E is the event that X <=x then
the distribution function of X and is denoted as
x)
is known as
F X (x)
Note that
1.
F X (x)
SoftwareTestingand
13
f X(xand
) is
F X (x) at x is denoted by
The derivative of
known as the probability density function of X.
f X(x )dx is the approximate probability that the random
SoftwareTestingand
14
e x ,forbothxand>0.
f (x | )
P ( X x | ) e x
0
x
SoftwareTestingand
15
Binomial Distribution
SoftwareTestingand
16
N x
P ( X x | p ) ( ) p (1 p ) N x , x 0,..., N
x
Here p is the probability that Xi = 1 for i=1,,N. In other words, p is the probability of failure of any single run.
N
( ) N ! /( x!( N x)!)
x
SoftwareTestingand
17
Poisson Distribution
P( X x | ) e
SoftwareTestingand
x
, x 0,1,2.....
x!
18
SoftwareTestingand
19
20
SoftwareTestingand
21
Failure Process
SoftwareTestingand
22
SoftwareTestingand
23
Each time the application fails the defect that caused the failure is
removed.
Debugging is perfect.
Ti is proportional to (N-I+1).
SoftwareTestingand
24
Thus, given 0=S0<=S1<=.<=Si, i=1, 2 and some constant c, we obtain the following
failure intensity, where S0,S1,,Si are supposed software failure times, failure rate r Ti is
given by:
r Ti (t S i 1) c( N i 1) for t S i 1
r (t )
Notethatthefailurerate
dropsbyaconstantamount.
S0=0
S1
SoftwareTestingand
S2
S3
time t
25
Execution time:
SoftwareTestingand
0 / 0= B
26
SoftwareTestingand
27
() 0 1
0
( ) 0e
0
0
R( '| ) e
SoftwareTestingand
{[ 0 e
0
0
][1e
0 '
0
]}
28
() 0e
0
()
0 1
0 1 1/
R( '| ) [
]
0 ( ' ) 1
SoftwareTestingand
29
Failureintensity()
LogarithmicPoissonmodel
0
Basicmodel
Averagenumberoffailuresexperienced
SoftwareTestingand
30
Failureintensity()
LogarithmicPoissonmodel
0
Basicmodel
Executiontime
SoftwareTestingand
31
Uniformoperationalprofile:Usethebasicmodel
Nonuniformoperationalprofile:UsethelogarithmicPoisson
model
SoftwareTestingand
32
Other issues
Countingfailures
Whenisadefectrepaired
Impactofimperfectrepair
SoftwareTestingand
33
CL RH
Unreliableestimate
CH RH
Reliableestimate
CH RL
Reliableestimate
RH
RL
CL
CH
Codecoverage
CL RL
Unreliableestimate
SoftwareTestingand
34
Operational Profile
Aquantitativecharacterizationofhowanapplicationwillbeused.This
characterizationrequiresaknowledgeofinputvariables.
Inputstateisavectorofvaluesofallinputvariables.
Inputvariables:Aninterruptisaninputvariableandsoareall
environmentvariablesandvariableswhosevaluesareinputbytheuser
viathekeyboardorfromafileinresponsetoaprompt.
Internalvariables,computedfromoneormoreinput
variablesarenotinputvariables.
Intermediateresultsandinterruptsgeneratedduringtheexecutionasa
resultoftheexecutionshouldnotbeconsideredasinputvariables.
SoftwareTestingand
35
Runsofanapplicationthatbeginwithidenticalinputstatesbelongtothesamerun
type.
Example1:Twowithdrawalsfromthesamepersonfromthesame
accountandofthesamedollaramount.
Example2:Reservationsmadefortwodifferentpeopleonthesame
flightbelongtodifferentruntypes.
Function:Groupingofdifferentruntypes.Afunctionisconceivedat
thetimeofrequirementsanalysis.
SoftwareTestingand
36
Function:Asetofdifferentruntypes.Afunctionisconceivedatthe
timeofrequirementsanalysis.Afunctionisanalogoustoausecase.
Operation:Asetofruntypesfortheapplicationthatisbuilt.
SoftwareTestingand
37
Inputstate
Inputstate
Inputstate
Inputstate
Inputstate
Inputstate
Function2
Function3
Function4
SoftwareTestingand
Functionk
38
Functional Profile
Function
Probability of occurrence
F1
0.6
F2
0.35
F3
0.05
SoftwareTestingand
39
Operational Profile
Function
Operation
Probability of occurrence
F1
O11
0.4
O12
0.1
O13
0.1
O21
0.05
O22
0.15
O31
0.15
O33
0.05
F2
F3
SoftwareTestingand
40
Function
Operation
Probability of occurrence
Normal
F1
O11
0.4
O12
0.1
O13
0.1
O21
0.05
O22
0.15
O31
0.15
O33
0.05
F2
F3
SoftwareTestingand
41
Function
Operation
Probability of occurrence
Administrative
AF1
AO11
0.4
AO12
0.1
AO21
0.5
AF2
SoftwareTestingand
42
No
Objective met?
Yes
43
Risk Assessment
Probabilityofmalfunction
Consequenceofmalfunction
Complex modules that need more attention
Potential trouble spots
Estimating test effort
Dynamic complexity and coupling metrics can be used to account for the
probability of a fault manifesting itself into a failure.
SoftwareTestingand
44
Question of interest
Given the architecture of an application, how does one quantify the risk
associated with the given architecture?
SoftwareTestingand
45
46
L2
L3
A:Atrium
A:Atrium
I:Inhibited
V:Ventricle
V:Ventricle
T:Triggered
D:Dual;(both)
D:Dual;(both)
D:Dualpacing
Whatispaced?
Whichchamberis
beingmonitored?
Whatisthemodetype?
Example:VVI:VentricleispacedwhenVentricularsensedoes
notoccur,paceisInhibitedifasensedoesoccur
SoftwareTestingand
47
magnet
Reed
Switch
enables
Communication
Gnome
enables
Coil
Driver
Atrial
Model
Ventricular
Model
programming
SoftwareTestingand
heart
48
Component Description
SoftwareTestingand
49
Scenarios
AVI: VT monitors the heart. When a heart beat is not sensed the
AR paces the heart and a refractory period is in effect.
VVI: VT component paces the heart when it does not sense any
pulse.
AAI: The AR component paces the heart when it does not sense any pulse.
SoftwareTestingand
50
SoftwareTestingand
51
SoftwareTestingand
52
I
init
t11
s21
t12
s11
s2
init
t13
s22
Cyclomaticcomplexityforthes11tos22transition:
SoftwareTestingand
53
For each execution scenario these variables are updated with the
complexity measure of the thread that is triggered for that particular
scenario.
PS k istheprobabilityofscenariok, S
SoftwareTestingand
isthetotalnumberofscenarios
54
Component Complexity
SoftwareTestingand
55
Connector Complexity
The export coupling metric for a pair of components for a given scenario
is extended for an operational profile by averaging over all scenarios
using the probabilities of occurrences of the scenarios considered.
|S|
SoftwareTestingand
56
Connector Complexity
SoftwareTestingand
57
VT
AVI (0.29)
53.2
46.8
AAT (0.15)
100
AAI (0.20)
100
Programming (0.01)
RS
CD
CG
8.3
67.4
24.3
VVI (0.15)
100
VVT (0.20)
100
% of architecture
complexity
.083
Normalized
.0.002 0.013
SoftwareTestingand
.674
.243
50.248
48.572
0.005
0.963
58
Coupling Matrix
RS
RS
CD
CG
.0014
.0014
CD
AR
VT
.003
CG
.002
.0014
.0014
.25
.27
Programmer
.0014
Heart
.011
AR
VT
Prog.
1
.873
.006
Heart
SoftwareTestingand
.123
.307
59
Severity Analysis
The effect of each fault, and the resulting failure, is studied. Domain experts can
rank severity of failures, thus ranking the effect of a component or connector failure
SoftwareTestingand
60
Severity Ranking
Marginal (0.5): Failure may cause minor injury, property damage, system damage,
delay or loss of production.
Minor (0.25): Failure not serious enough to cause injury, property damage,
or system damage but will result in unscheduled maintenance or repair.
SoftwareTestingand
61
62
Cause
Effect
Criticality
RS
Communication
not enabled
Error in
translating
magnet
command
Unable to
program the
pacemaker,
schedule
maintenance
task.
Minor
VT
No heart pulses
are sensed
though heart is
working fine.
SoftwareTestingand
63
Cause
Effect
AR-Heart
Failed to pace
the heart in AVI
mode.
Pacing h/w
device
malfunction.
CG-VT
Send incorrect
command (e.g.
ToOff instead of
ToIdle)
Incorrect
interpretation
of program
bytes
Incorrect
operation mode
and pacing of the
heart. Device still
monitored by the
physician,
immediate
maintenance
required.
SoftwareTestingand
Criticality
Marginal
64
RS
CD
CG
AR
VT
Dynamic complexity
.002
.013
.005
.963
Severity
.25
.25
.5
.95
.95
Risk factor
.0005
.00325 .0025
.95
.91485
SoftwareTestingand
65
RS
CD
CG
RS
.00035 .00035
CD
.00075
CG
.0005
AR
.0007
Heart
.0007
.2375
VT
Prog.
.00275
AR
Prog.
VT
.2565
.95
.82935
.00035 .0015
Heart
.11685
SoftwareTestingand
.2916
66
RS
CD
CG
AR
VT
CBC
0.47
0.8
0.6
0.6
Severity
0.25
0.25
0.5
0.95
0.95
0.119
0.2
0.5
0.57
0.57
SoftwareTestingand
67
DynamicmetricsbetterdistinguishARandVTcomponentsashigh
riskwhencomparedwithRS,CD,andCG.
Usingstaticmetrics,CGisconsideredatthesamerisklevelasARand
VT.
Inpacemaker,ARandVTcontroltheheartandhencearethehighest
riskcomponentswhichisconfirmedwhenonecomputestherisk
factorsusingdynamicmetrics.
SoftwareTestingand
68
ACDGisdescribedbysetsNandEwhereNisasetofofnodesandEisaset
ofedges.sandtaredesignatedasthestartandterminationnodesandbelongto
N.
EachnodeninN:<Ci,RCi,ECi>,whereCiisthecomponent
correspondington,RCiisthereliabilityofCi,andECiistheaverage
executiontimeofCi.
EachedgeeinE:<Tij,RTij,PTij>,whereTijisthetransitionfromnode
CitoCj,RTijisthereliabilityofthistransition,andPTijisthetransition
probability.
Inthemethodologydescribedhere,riskfactorsreplacethereliabilities
ofcomponentsandtransitions.
SoftwareTestingand
69
Generation of CDGs
Estimatetheexecutionprobabilityofeachscenario.
Foreachscenarioestimatetheexecutiontimeofeachcomponentand
then,usingtheprobabilityofeachscenario,computetheaverage
executiontimeofeachcomponent.
Estimatethetransitionprobabilityofeachtransition.
Estimatethecomplexityfactorofeachcomponent.
Estimatethecomplexityfactorofeachconnector..
SoftwareTestingand
70
<Prog,0,5>
<,3.5x104,0.002>
<AR,0.95,40>
<VT,0.95,40>
<RS,0.0005,5>
<,0.29,0.64>
<CD,0.003,5>
SoftwareTestingand
<CG,0.0025,5>
t
<,0,0.34>
<Heart,0,5>
71
HRF 1 (1 hrf i )
i 1
wherehrfiistheriskfactorassociatedwiththeithcomponent,or
connector,inthesequence.
SoftwareTestingand
72
e1:<(s,n1),0,0.3>
e1
e2:<(s,n2),0,0.7>
n1:<(C1,0.5,5>
n2:<(C2,0.6,12>
n1
e2
n2
HRF=1-[(1-0.5)0.3+(1-0.6)0.7].
SoftwareTestingand
73
s
e1
n1
e2
n2
SoftwareTestingand
74
Pacemaker Risk
Risk analysis tells us that the VT and AR components are the highest risk components
Risk analysis also tells us that the connectors between VT, AR and heart components are the highest risk
components
SoftwareTestingand
75
As the analysis is being done, most likely, prior to coding, one might
consider revising the architecture or use the same architecture but
allocate resources for coding and testing based on individual risk
factors.
SoftwareTestingand
76
Summary
SoftwareTestingand
77