State, State Graphs and Transition testing: state graphs, good & bad state graphs, state testing, Testability tips.

162 views 58 slides Apr 22, 2025
Slide 1
Slide 1 of 58
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58

About This Presentation

State, State Graphs and Transition testing: state graphs, good & bad state graphs, state testing, Testability tips.


Slide Content

Presented by:
Dr. B.Rajalingam
Associate Professor & HOD
Department of Artificial Intelligence and Data Science (AI&DS)
St. Martin's Engineering College
UNIT 4
State, State Graphs and Transition Testing

SOFTWARE TESTING METHODOLOGIES
Prerequisites
1.Acourseon―SoftwareEngineering‖
CourseObjectives
Toprovideknowledgeoftheconceptsinsoftwaretestingsuchastestingprocess,criteria,
strategies,andmethodologies.
Todevelopskillsinsoftwaretestautomationandmanagementusinglatesttools.
CourseOutcomes:
Designanddevelopthebestteststrategiesinaccordancetothedevelopmentmodel.

Syllabus
UNIT-I
Introduction:Purposeoftesting,Dichotomies,modelfortesting,consequencesofbugs,taxonomy
ofbugs:FlowgraphsandPathtesting:Basicsconceptsofpathtesting,predicates,pathpredicates
andachievablepaths,pathsensitizing,pathinstrumentation,applicationofpathtesting.
UNIT-II
TransactionFlowTesting:transactionflows,transactionflowtestingtechniques.Dataflowtesting:
Basicsofdataflowtesting,strategiesindataflowtesting,applicationofdataflowtesting.:domains
andpaths,Nice&uglydomains,domaintesting,domainsandinterfacestesting,domainand
interfacetesting,domainsandtestability.

Syllabus
UNIT-III
Paths,PathproductsandRegularexpressions:pathproducts&pathexpression,reduction
procedure,applications,regularexpressions&flowanomalydetection.
LogicBasedTesting:overview,decisiontables,pathexpressions,kvcharts,specifications.
UNIT-IV
State,StateGraphsandTransitiontesting:stategraphs,good&badstategraphs,statetesting,
Testabilitytips.
UNIT-V
GraphMatricesandApplication:Motivationaloverview,matrixofgraph,relations,powerofa
matrix,nodereductionalgorithm,buildingtools.(Studentshouldbegivenanexposuretoatoollike
JMeterorWin-runner).

TEXTBOOKS:
1.SoftwareTestingtechniques–BarisBeizer,Dreamtech,secondedition.
2.SoftwareTestingTools–Dr.K.V.K.K.Prasad,Dreamtech.
REFERENCEBOOKS:
1.Thecraftofsoftwaretesting–BrianMarick,PearsonEducation.
2.SoftwareTestingTechniques–SPD(Oreille)
3.SoftwareTestingintheRealWorld–EdwardKit,Pearson.
4.EffectivemethodsofSoftwareTesting,Perry,JohnWiley.
5.ArtofSoftwareTesting–Meyers,JohnWiley.

States,StateGraphsandTransition
Testing

•Thestategraphanditsassociatedstatetableareusefulmodelsfor
describingsoftwarebehavior.
•Thefinite-statemachineisafunctionaltestingtoolandtestabledesign
programmingtool
SYNOPSIS

•Thefinite-statemachineisasfundamentaltosoftwareengineeringasBoolean
algebra.
•Statetestingstrategiesarebasedontheuseoffinite-statemachinemodelsfor
softwarestructure,softwarebehavior,orspecificationsofsoftwarebehavior.
•Finite-statemachinescanalsobeimplementedastable-drivensoftware,in
whichcasetheyareapowerfuldesignoption.
•Independenttestersarelikeliesttouseafinite-statemachinemodelasaguideto
thedesignoffunctionaltests—especiallysystemtests.
MOTIVATIONAL OVERVIEW

STATEGRAPHS

1.States
2.InputsandTransitions
3.Outputs
4.StateTables
5.TimeVersus Sequence
6.SoftwareImplementation
I.ImplementationandOperation
II.InputEncodingandInputAlphabet
III.OutputEncodingandOutputAlphabet
IV.StateCodesandState-SymbolProducts
V.ApplicationCommentsfor Designers
VI.ApplicationCommentsforTesters
STATEGRAPHS

•Theword―state‖isusedinmuchthesamewayit’susedinordinaryEnglish,as
in―stateoftheunion,‖or―stateofhealth.‖
•TheOxfordEnglishDictionarydefines―state‖as:―Acombinationofcircumstancesor
attributesbelongingforthetimebeingtoapersonorthing.‖
•Aprogramthatdetectsthecharactersequence―ZCZC‖canbeinthefollowingstates:
I.NeitherZCZCnoranypartofithasbeendetected.
II.Zhasbeendetected
III.ZChasbeendetected
IV.ZCZhasbeendetected
V.ZCZChasbeendetected
1.States

•Amoving automobilewhoseengineis runningcanhavethefollowingstates
withrespecttoitstransmission:
Reversegear
Neutralgear
Firstgear
Secondgear
Thirdgear
Fourthgear
•Like,Aperson’scheckbookcan havethewhatstateswithrespecttothebank
balance?(Equal,Lessthan,Greaterthan)
•A word processing program menu can be in the what states with respect to file
manipulation?(Copy,Delete, Rename,Create,Compress)
1.States(Cont’d)

•Whatever is being modeled is subjected to inputs. As a result of those inputs,
thestate changes,oris said tohavemadeaTransition.
•Transitionaredenotedbylinksthatjointhe states.
•Theinput thatcausesthetransitionaremarkedon thelink;that is, theinputs
arelinkweights.
•Thereis oneoutlinkfromeverystateforeveryinput.
•Ifseveralinputsinastatecauseatransitiontothesamesubsequentstate,
instead of drawing a bunch of parallel links we can abbreviate the notation by
listingtheseveralinputs asin:―input1, input2,input3………‖.
•A finite state machine is an abstract device that can be represented by a state
graphhavingafinitenumber ofstatesandafinitenumberoftransitions
betweenstates
2.InputsandTransitions

ThestategraphofFigureisinterpretedas follows:
1.Ifthesystemis inthe―NONE‖state,anyinputotherthanaZwillkeepitinthatstate.
2.IfaZ is received,thesystem transitionstothe―Z‖state.
3.Ifthesystemis inthe―Z‖stateandaZisreceived,itwillremaininthe―Z‖state.IfaCis
received,itwillgotothe―ZC‖ state;if anyother characteris received,itwillgobacktothe
―NONE‖statebecausethe sequencehas beenbroken.
4.AZ receivedinthe―ZC‖stateprogressestothe―ZCZ‖state,butanyothercharacterbreaks
the sequenceandcausesareturntothe―NONE‖state.
5.ACreceivedinthe―ZCZ‖statecompletesthesequenceandthesystementersthe―ZCZC‖
state. AZbreaksthesequenceandcausesatransitionbacktothe―Z‖state;anyother
character causesareturntothe―NONE‖state.
6.Thesystemstaysinthe―ZCZC‖stateno matterwhatisreceived.
2.InputsandTransitions(Cont’d)

•Anoutputcanbeassociatedwithanylink.
•Outputs aredenotedbylettersor wordsandareseparatedfrominputsby a
slashasfollows:―input/output‖.
•As always,outputdenotesanythingofinterest that’sobservableandisnot
restrictedtoexplicitoutputsbydevices.
•Outputsare alsolinkweights.
•If every input associated with a transition causes the same output, then
denoteditas:―input1, input2,input3…………../output‖
3.Outputs

•ThestategraphisshowninFigurebelow.
•Asinthepreviousexample,theinputsandactionshavebeensimplified.There
areonlytwokindsofinputs(OK,ERROR)andfourkindsofoutputs
(REWRITE,ERASE,NONE,OUT-OF-SERVICE).
3.Outputs(Cont’d)

•Bigstategraphsareclutteredandhardtofollow.
•It’smoreconvenienttorepresentthestategraphasatable(thestatetableor
statetransitiontable)thatspecifiesthestates,theinputs,thetransitionsand
theoutputs.
•Thefollowingconventionsareused:
Eachrow of thetablecorrespondstoastate.
Eachcolumncorrespondsto aninputcondition.
The box at the intersection of a row and a
column specifies the next state (the transition)
andtheoutput,if any.
4.State Tables
STATE OKAY ERROR
1 1/NONE 2/REWRITE
2 1/NONE 4/REWRITE
3 1/NONE 2/REWRITE
4 3/NONE 5/ERASE
5 1/NONE 6/ERASE
6 1/NONE 7/OUT
7 ... ...

•Stategraphs don’trepresenttime-theyrepresentsequence.
•Atransitionmighttake microsecondsor centuries;
•Asystemcouldbe inonestateformillisecondsand anotherforyears-thestate
•graphwould bethesamebecause ithasnonotion oftime.
•Although the finite state machines model can be elaborated to include notions
oftimein additiontosequence,such astimePetriNets.
5.TimeVersusSequence

•Theroutineoperatesasfollows,where# meansconcatenation:
•BEGIN
•PRESENT_STATE:=DEVICE_TABLE(DEVICE_NAME)
•ACCEPTINPUT_VALUE
•INPUT_CODE:=
INPUT_CODE_TABLE(INPUT_VALUE)
•POINTER:=INPUT_CODE#PRESENT STATE
•NEW_STATE:=TRANSITION_TABLE(POINTER)
•OUTPUT_CODE:=OUTPUT_TABLE(POINTER)
•CALLOUTPUT_HANDLER(OUTPUT_CODE)
•DEVICE_TABLE(DEVICE_NAME) :=NEW_STATE
•END
6.SoftwareImplementation

6.1 Implementation andOperation
•Thepresentstateisfetchedfrommemory.
•The present input value is fetched. If it is already numerical, it can be used
directly;otherwise,itmayhavetobe encodedintoanumericalvalue,sayby
use ofacasestatement,a table,orsomeotherprocess.
•Thepresentstateand theinputcodearecombined (e.g.,concatenated) toyield a
pointer (row and column) of the transition table and its logical image (the output
table).
•Theoutputtable,eitherdirectlyorviaacasestatement,containsapointerto
theroutinetobeexecuted(theoutput)forthatstate-inputcombination.The
routineisinvoked(possiblyatrivialroutineifnooutputisrequired).
•Thesamepointerisusedtofetchthenewstatevalue,whichisthenstored.

•Thealternativetoinputencodingisahugestategraphandtablebecausethere
mustbeoneoutlinkineverystateforeverypossibledifferentinput.
•Inputencodingcompressesthecasesandthereforethestategraph.
•Anotheradvantageofinputencodingisthatwecanrunthemachinefroma
mixtureofotherwiseincompatibleinputevents,suchascharacters,device
responsecodes,thermostatsettings,orgearshiftleverpositions.
•Thesetofdifferentencodedinputvaluesiscalledtheinputalphabet.
6.2InputEncodingandInputAlphabet

•There are only a finite number of such distinct actions, which we can encode
into aconvenientoutputalphabet.
6.3OutputEncodingandOutputAlphabet

•State-tableimplementationisadvantageouswheneitherthecontrolfunctionis
likelytochangeinthefutureorwhenthesystemhasmanysimilar,butslightly
different,controlfunctions.
•Thistechniquecanprovidefastresponsetime—onepassthroughtheabove
programcanbedoneintentofifteenmachineinstructionexecutiontimes.
•Itisnotaneffectivetechniqueforverysmall(fourstatesorless)orbig(256
statesormore)stategraphs.
6.4ApplicationComments forDesigners

•Independenttestersarenotusuallyconcernedwitheitherimplementation
detailsortheeconomicsofthisapproachbutwithhowastate-tableorstate-
graphrepresentationofthebehaviorofaprogramorsystemcanhelpusto
designeffectivetests.
•Thereisaninterestingcorrelation,though:whenafinite-statemachinemodel
isappropriate,soisafinite-statemachineimplementation.
6.5ApplicationComments for Testers

GOODSTATEGRAPHSANDBAD

OBJECTIVE:findoutstategraphswhicharereachableandnonreachablestates
accordingtothegivenspecificationsornot.tocheckhow
equivalentstatesarepossiblewithsetofinputsandoutputs
•Whatconstitutesagoodorabadstategraphistosomeextentbiasedbythe
kindsofstategraphsthatarelikelytobeusedinasoftwaretestdesigncontext.
GOODSTATEGRAPHSANDBAD

Here are someprinciplesforjudging.
•The total number of states is equal to the product of the possibilities of factors
thatmake upthestate.
•For every state and input, there is a unique transition to exactly one state and
may be the samestateitself.
•Foreverytransitionthereisoneoutputactionspecified.Theoutputcouldbe
trivial,butatleastoneoutputdoessomethingsensible.
•Foreverystate thereis asequenceofinputs thatwilldrivethe systembackto
thesamestate.

Badstategraphscanexhibitcertainpropertieslikethefollowing:

•Thenumberofstatesinastategraphisthenumberofstateswechooseto
recognizeormodel.
•Inpractice,thestateisdirectlyorindirectlyrecordedasacombinationof
valuesofvariablesthatappearinthedatabase.
•Findthenumberofstatesasfollows:
•Identifyallthecomponentfactorsofthestate.
•Identifyalltheallowablevaluesforeachfactor.
•Thenumberofstatesistheproductofthenumberofallowablevaluesofall
thefactors.
StateBugs -NumberofStates

GEAR R,N,1,2,3,4 =6factors
DIRECTION Forward,reverse,
stopped
=3factors
ENGINE Running,stopped =2factors
TRANSMISSIONOkay,broken =2factors
ENGINE Okay,broken =2factors
TOTAL =(6*3*2*2*
2)
=144states
StateBugs-ImpossibleStates
•Sometimessomecombinationsoffactorsmayappeartobeimpossible.
•Thediscrepancybetweentheprogrammer’sstatecountandthetester’sstate
countisoftenduetoadifferenceofopinionconcerning―impossiblestates‖.
•Arobustpieceofsoftwarewillnot
ignoreimpossiblestatesbutwill
recognizethemandinvokean
illogicalconditionhandlerwhen
theyappeartohaveoccurred.

StateBugs-EquivalentStates
•Twostatesareequivalentifeverysequenceofinputsstartingfromonestate
producesexactlythesamesequenceofoutputswhenstartedfromtheother
state.

RecognizingEquivalentStates
•Therowscorrespondingtothe
twostatesareidenticalwith
respecttoinput/output/next
statebutthenameofthenext
statecoulddiffer.
Fig.EquivalentStates

RecognizingEquivalentStates
•There are two sets of rows
which, except for the state
names, have identical state
graphs with respect to
transitions and outputs.
The two sets can be
merged
Fig.MergedEquivalentStates

Fig.Unmergableprocedure
Input:abbbb
Output:uxuyy
Input:bbbbb
Output:uxuyu

TransitionBugs–Unspecified andcontradictoryTransitions
•Everyinput-statecombinationmusthavea specifiedtransition.
•If the transition is impossible, then there must be a mechanism that prevents
theinput fromoccurringin thatstate.
•Exactlyonetransitionmust bespecifiedforeverycombinationofinputand
state.
•Aprogram canthavecontradictionsorambiguities.
•Ambiguities are impossible because the program will do something for every
input.
•Eventhe statedoes notchange,by definitionthisis atransitiontothesame
state.

TransitionBugs–UnreachableStates
•Anunreachablestateislikeunreachablecode.
•Astatethatnoinputsequencecanreach.
•Anunreachablestateisnotimpossible,justasunreachablecodeisnotimpossible
•Theremaybetransitionsfromunreachablestatetootherstates;thereusuallybecausethe
statebecameunreachableasaresultofincorrecttransition.
•Therearetwopossibilitiesforunreachablestates:
•Thereisabug;thatissometransitionsaremissing.
•Thetransitionsarethere,butyoudon’tknowaboutit.

TransitionBugs–DeadStates
•Adead stateis astatethatonceenteredcannot be left.
•This is not necessarilya bug but itissuspicious.
TransitionBugs–OutputErrors
•Thestates,transitions,andtheinputscouldbecorrect, therecouldbeno
dead orunreachablestates, buttheoutputforthe transitioncouldbe
incorrect.
•Outputactionsmustbe verifiedindependently of statesandtransitions
TransitionBugs–EncodingBugs
•Thebehaviorofafinite-statemachineisinvariantunderallencodings. That
is, saythatthestatesarenumbered1ton.

StateTesting–ImpactofBugs
•If a routine is specified as a state graph that has been verified as correct in all
details. Program code or table or a combination of both must still be
implemented.
•Abugcan manifestitselfasoneofthefollowingsymptoms:
•Wrongnumberofstates.
•Wrongtransitionsforagivenstate-inputcombination.
•Wrong outputforagiventransition.
•Pairs of statesor setsofstatesthat areinadvertently madeequivalent.
•Statesor setofstatesthataresplittocreateinequivalentduplicates.
•Statesor setsof statesthathavebecomedead.
•Statesor setsof statesthathavebecomeunreachable

StateTesting

What is State Transition Testing?
•StateTransitionTestingisapowerfultechniqueusedinblack-boxtestingtoensurethat
softwarebehavesasexpectedwhiletransitioningbetweendifferentstatesofasystem.
•First,itidentifiesafinitesetofstatesthatthesoftwarecanoccupy.
•Thenittestshowthesoftwaretransitionsbetweenthembasedondifferentinputconditions.
•Thistechniquecanbeappliedtovarioussystems,suchasvendingmachines,trafficlights,and
evenwebapplications,aslongastheirbehaviorcanbedefinedasafinitestatemachine.
•StateTransitionTestinginsoftwaretestinghelpstoensurethesoftware’sreliabilityand
robustness,especiallywhenthesoftwareisexpectedtohandlecomplexstatetransitions.
•Itcanalsobeusedtodetecterrorsthatmayoccurwhenthesystemmovesfromonestateto
another.
•Theapproachisusefulinreducingthenumberoftestcasesrequired,optimizingtestingtime,
andimprovingsoftwarequality.

What is State Transition Testing?
ThereareafewStateTransitionTestingTechniques.Theyareasbelow.
•StateTransitionDiagram:Itisagraphicalrepresentationofthesystem’sstatesandtheevents
thatcausethesystemtotransitionfromonestatetoanother.
•StateTransitionTable:Itisatabularrepresentationofthesystem’sstates,theeventsthat
causestatetransitions,andtheresultingactionsoroutputs.
•DecisionTableTesting:Itisatechniquethatusesatabletomapdifferentcombinationsof
inputstotheircorrespondingoutputs,makingiteasiertotestvariousscenarios.
•Cause-EffectGraphing:Itisatechniqueusedtoidentifyandtestdifferentinputcombinations
thatcancausespecificoutputsoreventstooccur.
•Stateflow:Itisagraphicaltoolusedtomodelandsimulatestate-basedsystems.
•Stateflowdiagramscanbeusedtodevelopandverifystate-basedalgorithmsandcontrollogic.

Use of State Transition?
•Whentestingasequenceofeventsthatoccurintheapplicationundertest.
•Whentheapplicationundertesthasadependencyontheevents/valuesinthepast.
•Whenasoftwareapplicationcanbedefinedbyafinitenumberofstates/inputvalues.
•Whentestinguserinterfaces.
•Userinterfacesmaytakedifferentformsdependingontheinputandtheymaytransition
betweenscreensi.e.states.
•Whentestingwebapplications.
•Webapplicationscanhavedifferentstatessuchaslogin/logout,addtocart,checkout,etc.,and
statetransitiontestingcantestthesestatestomakesurethattheapplicationbehavesas
intended.
•Whentestingmobileapplicationstotestonline/offlinestates,workflow,etc.

Four Parts of State Transition Diagram
1. Statesthe software can be.
•Represented by rectangles with rounded corners.
•A state is a situation or condition of a system.
•It is represented by a node in a state transition diagram.
•Each node represents a different state of the system.
2. Transitionsfrom one state to another
•Represented by arrows.
•A transition is a change in a state of a system that occurs when it responds to an event.
3. Eventsthat result in transitions
•Labeled above the applicable transition arrow.
•An event is an action or occurrence that triggers a change in the state of a system.
4. Actionsthat result from a transition from an event
•Could be represented by a message box.
•An action is a behavior that the system exhibits when it changes its state.

State Transition Diagram and State Transition Table
•Statetransitionscanberepresentedbyadiagramor/andatable.
•Astatetransitiondiagramisanillustrationofboxedtextsandarrows.
•Itisavisualrepresentationofthestatesandtheflowofthetransitions.

Change Mode:
When this mode is activated then the display mode moves from TIME to DATE.
Reset:
When the display mode is TIME or DATE, then reset mode sets them to ALTER TIME or
ALTER DATE respectively.
Time Set:
When this mode is activated, display mode changes from ALTER TIME to TIME.
Date Set:
When this mode is activated, display mode changes from ALTER DATE to DATE.
Transition States:

State Transition Diagram shows how the state of the system changes on
certain inputs.
It has four main components:
1. States
2. Transition
3. Events
4. Actions
State Transition Diagram

StateTesting–Principles
•The state transition table represents the states and transitions using a table where all the states
are listed on the left side and the events are described on the top.
•The state of the system after an event is represented by the rest of the table cells.
Start Event 1 Event 2
State 1 Action 1 State 2
State 2 Action 1 State 3
State 3 Action 1 Action 2
Action 1 – –
Action 2 – –

StateTesting–Principles
•Thestartingpointof statetestingis:
1.Defineasetofcoveringinputsequencesthatgetbacktothe initial
state whenstartingfromtheinitialstate.
2.For each step in each input sequence, define the expected next state, theexpected
transition,andthe expectedoutputcode.
•Aset oftests,then,consistsofthreesets ofsequences:
1.Inputsequences.
2.Correspondingtransitionsornext-state names.
3.Outputsequences.

StateTesting–LimitationsandExtensions
1.Simplyidentifyingthefactorsthatcontributetothestate,calculatingthetotalnumberof
states,andcomparingthis numbertothe designer’snotioncatchessomebugs.
2.Insistingonajustificationforallsupposedly dead,unreachable,andimpossiblestatesand
transitionscatchesa fewmorebugs.
3.Insistingonanexplicitspecificationof thetransitionand outputforeverycombination of
inputandstatecatchesmanymorebugs.
4.Asetof input sequencesthatprovidecoverageof allnodesandlinksisamandatoryminimum
requirement.
5.Inexecutingstatetests,itisessentialthatmeansbeprovided(e.g.,instrumentationsoftware)
torecordthesequenceof states(e.g.,transitions)resultingfromtheinputsequence and not
justtheoutputsthatresultfromtheinputsequence.

StateTesting–Whatto Model
1.Anyprocessingwheretheoutputisbasedontheoccurrenceofoneormoresequencesofevents,such
asdetectionofspecifiedinputsequences,sequentialformatvalidation,parsing,andothersituationsin
whichtheorderofinputsisimportant.
2.Mostprotocolsbetweensystems,betweenhumansandmachines,betweencomponentsofasystem.
3.Devicedriverssuchasfortapesanddiscsthathavecomplicatedretryandrecoveryproceduresifthe
actiondependsonthestate.
4.Transactionflowswherethetransactionsaresuchthattheycanstayinthesystem
indefinitely—forexample,onlineusers,tasksinamultitaskingsystem.
5.High-levelcontrolfunctionswithinanoperatingsystem.
6.Transitionsbetweenuserstates,supervisor’sstates,andsoon.
7.Securityhandlingofrecords,permissionforread/write/modifyprivileges,priorityinterruptsand
transitionsbetweeninterruptstatesandlevels,recoveryissuesandthesafetystateofrecordsand/or
processeswithrespecttorecordingrecoverydata

StateTesting–Getting the Data
•Statetesting,morethanmostfunctionaltest strategies,tendstohavealabor-intensivedata-
gatheringphase andtendsto need manymoremeetingsto resolveissues.
State Testing–Tools
•Therearetoolstodothesameforhardwarelogicdesigns.That’sthegoodnews.
•Thebadnewsisthatthesesystemsandlanguagesareproprietary,ofthehome-brewvariety,
internal,and/ornotapplicabletothegeneraluseofsoftwareimplementationsoffinite-state
machines

TestabilityTips

(i)Abalmforprogrammers:
•Thekeytotestabilitydesigniseasythatiswecaneasilybuildexplicitfinitestate
machines.
(ii)HowbigHowsmall:
•Fortwofinitestatemachinesthereareonlyeightgoodandbadones.
•Forthreefinitestatemachinesthereareeightypossiblegoodandbadone.
•SimilarlyforFourstatemachines2700mostofwhicharebadandforfivestatemachines
275000mostofwhicharebad.
•Forsixstatemachines100millionsmostofwhicharebad.
TestabilityTips

(iii)Switches,Flagsandunachievablepaths:
•Thefunctionalityofswitchesandflagsarealmostsimilarinthestatetesting.
•Switches or flags are used as essential tool for state testing to test the finite state machine in
every possible state.
•A flag or switch value is set at the initial process of finite state machine, and then this value is
evaluated and tested.
•Depending on its value the specific path is selected to find an easiest way for testing the finite
state machine.
•Mostly the switch or flag works on true or false condition.
TestabilityTips

(iv)Essentialandinessentialfinitestatebehavior:
•Tounderstandanessentialandinessentialfinitestatebehavior,weneedtoknowthe
conceptoffinitestatemachinesandcombinationalmachines.
•Thereisadifferencebetweenfinitestatemachinesandcombinationalmachinesinterms
ofquality.
•Incombinationalmachinesapathischosendependingonthetruthvaluesofpredicates.
•Thepredicatetruthvaluesarethevalueswhichoncedeterminedwillneverchangeand
alwaysremainsconstant.
•InthesemachinesapathisequivalenttoaBooleanalgebraicexpressionoverthe
predicates
•Furthermoreitdoesnotmatterinwhichorderthedecisionsaremade.
TestabilityTips

(v)Designguidelines:
•Finestatemachineisrepresentedbyastategraphhavingafinitenumberofstatesandafinite
numberoftransitionsbetweenstates
•Finitestatemachine(FSM)isafunctionaltestingtoolandprogrammingtestingtool.
•Thatisitisanessentialtoolforstatetestinginordertoidentifyormodelthebehaviorof
software.
Thedifferentguidelinesaregivenbelow.
•Initiallylearntheprocedureoffinitestatemachinethatareusedinbothhardwareandsoftware.
•Designanabstractmachineinsuchawaythatitworksproperlyandsatisfiestheuser
requirements.
•Designanexplicitfinitestatemachine.
•Prototypetestmustbeconductedthoroughlytodeterminetheprocessingtimeandspaceof
explicitfinitestatemachinedesign.
TestabilityTips

TestabilityTips
•Iftimeorspaceismoreeffectingtheoverallsystem,thenuseshortcutstocompletethedesign
process.
•Iftherearemorethanafewnumbersofstatesthenusehierarchicaldesigntorepresentthem.
•Ifthereislargenumberofstatesthensoftwaretoolsandprogramminglanguagesmustbe
developed.
•Thecapabilitytoinitializetoanarbitrarystatemustbeinbuilttogetherwiththetransition
verificationinstrumentation.

Thankyou