Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides...
Transcript of Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides...
![Page 1: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/1.jpg)
DevelopmentStrategies,FunctionDesignBBM101- Introduction toProgramming I
Hacettepe UniversityFall2015
FuatAkal,AykutErdem,Erkut Erdem,Vahid Garousi
![Page 2: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/2.jpg)
Today
• Howtodevelopaprogram– Programdevelopmentstrategy
• MoreonTestingandDebugging– Testinganddebugging– Blackboxtesting– Glassboxtesting– Integrationtestingandunittesting– Debuggingapproaches
2
![Page 3: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/3.jpg)
Today
• Howtodevelopaprogram– Programdevelopmentstrategy
• MoreonTestingandDebugging– Testinganddebugging– Blackboxtesting– Glassboxtesting– Integrationtestingandunittesting– Debuggingapproaches
Slides basedonmaterialpreparedbyRuthAnderson,MichaelErnstandBillHoweinthecourseCSE140University ofWashington
3
![Page 4: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/4.jpg)
Programdevelopmentmethodology:Englishfirst,thenPython
1. Definetheproblem2. Decideuponanalgorithm3. Translateitintocode
Trytodothesestepsinorder
4
![Page 5: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/5.jpg)
Programdevelopmentmethodology:Englishfirst,thenPython
1. DefinetheproblemA. WriteanEnglishdescriptionoftheinputandoutput
forthewholeprogram.(Donotgivedetailsabouthowyouwillcomputetheoutput.)
B. Createtestcasesforthewholeprogram• Inputand expectedoutput
2. Decideuponanalgorithm3. Translateitintocode
Trytodothesestepsinorder
5
![Page 6: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/6.jpg)
Programdevelopmentmethodology:Englishfirst,thenPython
1. Definetheproblem2. Decideuponanalgorithm
A. ImplementitinEnglish• Writetherecipeor step-by-stepinstructions
B. Testitusingpaperandpencil• Usesmallbutnottrivialtestcases• Playcomputer,animatingthealgorithm• Beintrospective
– Noticewhatyoureallydo– Maybemoreorlessthanwhatyouwrotedown– Makethealgorithmmoreprecise
3. Translateitintocode
Trytodothesestepsinorder
6
![Page 7: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/7.jpg)
Programdevelopmentmethodology:Englishfirst,thenPython
1. Definetheproblem2. Decideuponanalgorithm3. Translateitintocode
A. ImplementitinPython• Decomposeitintologicalunits(functions)• Foreachfunction:
– Nameit(importantanddifficult!)– Writeitsdocumentationstring(itsspecification)– Writetests– Writeitscode– Testthefunction
B. Testthewholeprogram
Trytodothesestepsinorder
7
![Page 8: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/8.jpg)
Programdevelopmentmethodology:Englishfirst,thenPython
1. Definetheproblem2. Decideuponanalgorithm3. Translateitintocode
Trytodothesestepsinorder– It’sOK(evencommon)tobackuptoapreviousstep
whenyounoticeaproblem– Youareincrementallylearningabouttheproblem,
thealgorithm,andthecode– “Iterativedevelopment”
8
![Page 9: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/9.jpg)
TheWishfulThinkingapproachtoimplementingafunction
• Ifyouarenotsurehowtoimplementonepartofyourfunction,defineahelperfunctionthatdoesthattask– “IwishIknewhowtodotaskX”– Giveitanameandassumethatitworks– Goaheadandcompletetheimplementationofyourfunction,using thehelperfunction(andassumingitworks)
– Later,implementthehelperfunction– Thehelperfunctionshouldhaveasimpler/smallertask
9
![Page 10: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/10.jpg)
TheWishfulThinkingapproachtoimplementingafunction
• Canyoutesttheoriginalfunction?– Yes,byusingastub forthehelperfunction– Oftenalookuptable:worksforonly5inputs,crashesotherwise,ormaybejustreturnsthesamevalueeverytime
10
![Page 11: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/11.jpg)
Whyfunctions?Thereareseveralreasons:• Creatinganewfunctiongivesyouanopportunitytonameagroup
ofstatements,whichmakesyourprogrameasiertoreadanddebug.
• Functionscanmakeaprogramsmaller byeliminatingrepetitivecode.Later,ifyoumakeachange,youonlyhavetomakeitinoneplace.
• Dividingalongprogramintofunctionsallowsyoutodebugthepartsoneatatimeandthenassemblethemintoaworkingwhole.
• Well-designedfunctionsareoftenusefulformanyprograms.Onceyouwriteanddebugone,youcanreuseit.
11
![Page 12: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/12.jpg)
Today
• Howtodevelopaprogram– Programdevelopmentstrategy
• MoreonTestingandDebugging– Testinganddebugging– Blackboxtesting– Glassboxtesting– Integrationtestingandunittesting– Debuggingapproaches
Slides basedonmaterialpreparedbyE.Grimson, J.Guttag andC.Terman inMITx 6.00.1x 12
![Page 13: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/13.jpg)
TestingandDebugging
• Wouldbegreatifourcodealwaysworkedproperlythefirsttimewerunit!
• Butlifeain’t perfect,soweneed:– Testingmethods
• Waysoftryingcodeonexamplestodetermineifrunningcorrectly
– Debuggingmethods• Waysoffixingaprogramthatyouknowdoesnotworkasintended
13
![Page 14: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/14.jpg)
Whenshouldyoutestanddebug?
• Designyourcodeforeaseoftestinganddebugging– Breakprogramintocomponentsthatcanbetestedanddebuggedindependently
– Documentconstraintsonmodules• Expectationsoninputs,onoutputs• Evenifcodedoesnotenforceconstraints,valuablefordebuggingtohavedescription
– Documentassumptionsbehindcodedesign
14
![Page 15: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/15.jpg)
Whenareyoureadytotest?
• Ensurethatcodewillactuallyrun– Removesyntaxerrors– Removestaticsemanticerrors– BothofthesearetypicallyhandledbythePythoninterpreter
• Haveasetofexpectedresults(i.e.input- outputpairings)ready
15
![Page 16: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/16.jpg)
Testing
• Goal:– Showthatbugsexist– Wouldbegreattoprovecodeisbugfree,butgenerallyhard• Usuallycan’trunonallpossibleinputstocheck• Formalmethodssometimeshelp,butusuallyonlyonsimplercode
“Program testing can be used to show the presence ofbugs, but never to show their absence!”
– Edsger Dijkstra
16
![Page 17: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/17.jpg)
Testsuite
• Wanttofindacollectionofinputsthathashighlikelihoodofrevealingbugs,yetisefficient– Partitionspaceofinputs intosubsetsthatprovideequivalentinformationaboutcorrectness• Partitiondividesasetintogroupofsubsetssuchthateachelementofsetisinexactlyonesubset
– Constructtestsuite thatcontainsoneinputfromeachelementofpartition
– Runtestsuite
17
![Page 18: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/18.jpg)
Exampleofpartitiondef isBigger(x, y):
“““Assumes x and y are intsreturns True if x is less than yelse False”””
• Inputspaceisallpairsofintegers• Possiblepartition
– xpositive,ypositive– xnegative,ynegative– xpositive,ynegative– xnegative,ypositive– x=0,y=0– x=0,y!=0– x!=0,y=0
18
![Page 19: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/19.jpg)
Whythispartition?
• Lotsofotherchoices– E.g.,xprime,ynot;yprime,xnot;bothprime;bothnot
• Spaceofinputsoftenhavenaturalboundaries– Integersarepositive,negativeorzero– Fromthisperspective,have9subsets•Splitx=0,y!=0intox=0,ypositiveandx=0,ynegative•Sameforx!=0,y=0
19
![Page 20: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/20.jpg)
Partitioning
• Whatifnonaturalpartitiontoinputspace?
– Randomtesting– probabilitythatcodeiscorrectincreaseswithnumberoftrials;butshouldbeabletousecodetodobetter
– Useheuristicsbasedonexploringpathsthroughthespecifications– black-boxtesting
– Useheuristicsbasedonexploringpathsthroughthecode– glass-boxtesting
20
![Page 21: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/21.jpg)
Black-boxtesting
• Testsuitedesignedwithoutlookingatcode– Canbedonebysomeoneotherthanimplementer– Willavoidinherentbiasesofimplementer,exposingpotentialbugsmoreeasily
– Testingdesignedwithoutknowledgeofimplementation,thuscanbereusedevenifimplementationchanged
21
![Page 22: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/22.jpg)
Pathsthroughaspecificationdef sqrt(x, eps):
“““Assumes x, eps floatsx >= 0eps > 0
returns res such thatx-eps <= res*res <= x+eps”””
• Pathsthroughspecification:– x=0– x>0
• Butclearlynotenough
22
![Page 23: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/23.jpg)
Pathsthroughaspecification
• Alsogoodtoconsiderboundarycases– Forlists:emptylist,singletonlist,manyelementlist– Fornumbers,verysmall,verylarge,“typical”
23
![Page 24: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/24.jpg)
Example• Foroursqrt case,trythese:– Firstfouraretypical• Perfectsquare• Irrationalsquareroot• Examplelessthan1
– Lastfivetestextremes• Ifbug,mightbecode,ormightbespec(e.g.don’ttrytofindrootifeps tiny)
x eps
0.0 0.0001
25.0 0.0001
.05 0.0001
2.0 0.0001
2.0 1.0/2.0**64.0
1.0/2.0**64.0 1.0/2.0**64.0
2.0**64.0 1.0/2.0**64.0
1.0/2.0**64.0 2.0**64.0
2.0**64.0 2.0**64.0
24
![Page 25: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/25.jpg)
Glass-boxTesting
• Usecodedirectlytoguidedesignoftestcases
• Glass-boxtestsuiteispath-completeifeverypotentialpaththroughthecodeistestedatleastonce– Notalwayspossibleifloopcanbeexercisedarbitrarytimes,orrecursioncanbearbitrarilydeep
• Evenpath-completesuitecanmissabug,dependingonchoiceofexamples
25
![Page 26: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/26.jpg)
Exampledef abs(x):
“““Assumes x is an intreturns x if x>=0 and –x otherwise”””
if x < -1:return –x
else:return x
• Testsuiteof{-2,2}willbepathcomplete• Butwillmissabs(-1) whichincorrectlyreturns-1– Testingboundarycasesandtypicalcaseswouldcatchthis{-2-1,2}
26
![Page 27: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/27.jpg)
Rulesofthumbforglass-boxtesting
• Exercisebothbranchesofallifstatements• Ensureeachexceptclauseisexecuted• Foreachforloop,havetestswhere:
– Loopisnotentered– Bodyofloopexecutedexactlyonce– Bodyofloopexecutedmorethanonce
• Foreachwhileloop,– Samecasesasforloops– Casesthatcatchallwaystoexitloop
• Forrecursivefunctions,testwithnorecursivecalls,onerecursivecall,andmorethanonerecursivecall
27
![Page 28: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/28.jpg)
Conductingtests
• Startwithunittesting– Checkthateachmodule(e.g.function)workscorrectly
• Movetointegrationtesting– Checkthatsystemaswholeworkscorrectly
• Cyclebetweenthesephases
28
![Page 29: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/29.jpg)
TestDriversandStubs
• Driversarecodethat– Setupenvironmentneededtoruncode– Invokecodeonpredefinedsequenceofinputs– Saveresults,and– Report
• Driverssimulatepartsofprogramthatuseunitbeingtested
• Stubssimulatepartsofprogramusedbyunitbeingtested– Allowyoutotestunitsthatdependonsoftwarenotyetwritten
29
![Page 30: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/30.jpg)
Goodtestingpractice
• Startwithunittesting• Movetointegrationtesting• Aftercodeiscorrected,besuretodoregressiontesting:– Checkthatprogramstillpassesallthetestsitusedtopass,i.e.,thatyourcodefixhasn’tbrokensomethingthatusedtowork
30
![Page 31: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/31.jpg)
“Most people, if you describe a train of events to them, will tell you what the resultwould be. They can put those events together in their minds, and argue from them thatsomething will come to pass. There are few people, however, who, if you told them aresult, would be able to evolve from their own inner consciousness what the steps werewhich led up to that result. This power is what I mean when I talk of reasoningbackwards, or analytically.“ -- Sherlock Holmes (A Study in Scarlet, by Sir Arthur Conan Doyle)
Debugging
31
![Page 32: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/32.jpg)
Runtimebugs
• Overtvs.covert:– Overthasanobviousmanifestation– codecrashesorrunsforever
– Coverthasnoobviousmanifestation– codereturnsavalue,whichmaybeincorrectbuthardtodetermine
• Persistentvs.intermittent:– Persistentoccurseverytimecodeisrun– Intermittentonlyoccurssometimes,evenifrunonsameinput
32
![Page 33: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/33.jpg)
Categoriesofbugs
• Overtandpersistent– Obvioustodetect– Goodprogrammersusedefensiveprogrammingtotrytoensurethatiferrorismade,bugwillfallintothiscategory
• Overtandintermittent– Morefrustrating,canbehardertodebug,butifconditionsthatpromptbugcanbereproduced,canbehandled
• Covert– Highlydangerous,asusersmaynotrealizeanswersareincorrectuntilcodehasbeenrunforlongperiod
33
![Page 34: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/34.jpg)
Debuggingskills
• Treatasasearchproblem:lookingforexplanationforincorrectbehavior– Studyavailabledata– bothcorrecttestcasesandincorrectones– Formanhypothesisconsistentwiththedata– Designandrunarepeatableexperimentwithpotentialtorefute
thehypothesis– Keeprecordofexperimentsperformed:usenarrowrangeof
hypotheses
34
![Page 35: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/35.jpg)
Debuggingassearch
• Wanttonarrowdownspaceofpossiblesourcesoferror• Designexperimentsthatexposeintermediatestagesof
computation(useprint statements!),anduseresultstofurthernarrowsearch
• Binarysearchcanbeapowerfultoolforthis
35
![Page 36: Development Strategies, Function Design › ~bbm101 › fall15 › lectures › w07-de… · Slides based on material prepared by E. Grimson, J. Guttagand C. Terman in MITx 6.00.1x](https://reader034.fdocuments.net/reader034/viewer/2022042411/5f2930dc54c5807a3f7c974b/html5/thumbnails/36.jpg)
Somepragmatichints
• Lookfortheusualsuspects• Askwhythecodeisdoingwhatitis,notwhyitisnot
doingwhatyouwant• Thebugisprobablynotwhereyouthinkitis– eliminate
locations• Explaintheproblemtosomeoneelse• Don’tbelievethedocumentation• Takeabreakandcomebacktothebuglater
36