首页 Debug It! Find Repair and Prevent Bugsin Your C…

Debug It! Find Repair and Prevent Bugsin Your Code Paul Butcher.pdf

Debug It! Find Repair and Preve…

上传者: macware 2014-02-14 评分1 评论0 下载1 收藏0 阅读量681 暂无简介 简介 举报

简介:本文档为《Debug It! Find Repair and Prevent Bugsin Your Code Paul Butcherpdf》,可适用于软件工程领域,主题内容包含WhatReadersAreSayingAboutDebugIt!Pauldoesanexcellentjobofexplainingthetech符等。

WhatReadersAreSayingAboutDebugIt!Pauldoesanexcellentjobofexplainingthetechnical,intellectual,andpsychologicalaspectsofallphasesofdebugging:preventingbugsinthefirstplace,diagnosingandfixingbugs,andmakingsurethatthesamebugsdon’thappenagainApplyinganyoralloftheideasfromthisbookwillimprovetheoverallqualityofyoursoftwareprojectsSure,thetechnicalissuesarewellcoveredbuthowPaulalsoexplainsthepsychologicalanglesiswhatmakesthisbookexceptionalFredericDaoudAuthor,StripesandJavaWebDevelopmentIsFunAgainIwholeheartedlyrecommendthisbooktosoftwareengineersgenerallybutmorespecificallytoteamleadswhoneedtoknowhowtosetuptheirteamsforbestpracticeAllanMcLeodFounderandCTO,IsaaccSoftwareDebugIt!doesagreatjobofsettingthescenefordebuggingandgettingyouintotherightmindsetwhilealsotalkingaboutthecomplicationsthatcanariseoncethebugisfoundandsquashedIt’sworthalookfortheanecdotesalone,toseethelengthsthatpeoplegotowhentryingtounderstandtrulybizarredefectsJonDickinsonAuthor,GrailsWebApplicationDevelopmentDebugginghasbeenafolkartforsolongthatit’sgreattohavesomeoneputallthetriedandtruetechniquestogetherDebugIt!istheperfectbooktopulloutwhenyou’redisillusionedwiththebrainbreakingprocessofcreatinggoodsoftwareWiththistoolchestofassertions,logging,refactoring,andothergoodstuff,you’llfeellikeyou’reSherlockHolmesandsolvingthecaseisinevitableCraigRieckeAuthor,MasteringDojo:JavaScriptandAjaxToolsforGreatWebExperiencesPreparedexclusivelyforRobertWalshDownloadatWoweBookComThisbookislikeacompanionvolumetoThePragmaticProgrammer,applyingthesamefocusoncraftsmanshiptothedebuggingprocessIanDeesAuthor,ScriptedGUITestingwithRubyPaulButcherhasbroughtlongoverdueattentiontothemethodsofdebugging,afundamentalactivityforeverysoftwaredeveloperyetonethatremainsanexerciseofintuitionandguessworkformostintheprofessionPaul’sgentlewritingstylebeliesthedisciplineinhistechniqueBeforeyouknowit,you’llbeanengineerinsteadofahackerBillKarwinSoftwareEngineer,KarwinSoftwareSolutions,LLCPreparedexclusivelyforRobertWalshDownloadatWoweBookComPreparedexclusivelyforRobertWalshDownloadatWoweBookComDebugIt!Find,Repair,andPreventBugsinYourCodePaulButcherThePragmaticBookshelfRaleigh,NorthCarolinaDallas,TexasPreparedexclusivelyforRobertWalshDownloadatWoweBookComManyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarksWherethosedesignationsappearinthisbook,andThePragmaticProgrammers,LLCwasawareofatrademarkclaim,thedesignationshavebeenprintedininitialcapitallettersorinallcapitalsThePragmaticStarterKit,ThePragmaticProgrammer,PragmaticProgramming,PragmaticBookshelfandthelinkinggdevicearetrademarksofThePragmaticProgrammers,LLCEveryprecautionwastakeninthepreparationofthisbookHowever,thepublisherassumesnoresponsibilityforerrorsoromissions,orfordamagesthatmayresultfromtheuseofinformation(includingprogramlistings)containedhereinOurPragmaticcourses,workshops,andotherproductscanhelpyouandyourteamcreatebettersoftwareandhavemorefunFormoreinformation,aswellasthelatestPragmatictitles,pleasevisitusathttp:wwwpragprogcomCopyrightPaulButcherAllrightsreservedNopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmitted,inanyform,orbyanymeans,electronic,mechanical,photocopying,recording,orotherwise,withoutthepriorconsentofthepublisherPrintedintheUnitedStatesofAmericaISBN:XISBN:PrintedonacidfreepaperPprinting,NovemberVersion:PreparedexclusivelyforRobertWalshDownloadatWoweBookComContentsPrefaceAboutThisBookAcknowledgmentsITheHeartoftheProblemAMethodintheMadnessDebuggingIsMoreThan“MakingtheBugGoAway”TheEmpiricalApproachTheCoreDebuggingProcessFirstThingsFirstPutItinActionReproduceReproduceFirst,AskQuestionsLaterControllingtheSoftwareControllingtheEnvironmentControllingInputsRefiningYourReproductionWhatIfYouReallyCan’tReproduceItPutItinActionDiagnoseStandBackI’mGoingtoTryScienceStratagemsDebuggersPitfallsMindGamesValidateYourDiagnosisPutItinActionPreparedexclusivelyforRobertWalshDownloadatWoweBookComCONTENTSFixClearingtheDecksTestingFixtheCause,NottheSymptomsRefactoringCheckingInGetYourCodeReviewedPutItinActionReflectHowDidItEverWorkWhatWentWrongIt’llNeverHappenAgainClosetheLoopPutItinActionIITheBiggerPictureDiscoveringThatYouHaveaProblemTrackingBugsWorkingwithUsersWorkingwithSupportStaffPutItinActionPragmaticZeroToleranceBugsTakePriorityTheDebuggingMindSetDiggingYourselfOutofaQualityHolePutItinActionIIIDebugFuSpecialCasesPatchingExistingReleasesBackwardCompatibilityConcurrencyHeisenbugsPerformanceBugsEmbeddedSoftwareBugsinThirdPartySoftwarePutItinActionReporterratumthiscopyis(Pprinting,November)PreparedexclusivelyforRobertWalshDownloadatWoweBookComCONTENTSTheIdealDebuggingEnvironmentAutomatedTestingSourceControlAutomaticBuildsPutItinActionTeachYourSoftwaretoDebugItselfAssumptionsandAssertionsDebuggingBuildsResourceLeaksandExceptionHandlingPutItinActionAntipatternsPriorityInflationPrimaDonnaMaintenanceTeamFirefightingRewriteNoCodeOwnershipBlackMagicPutItinActionAResourcesASourceControlandIssueTrackingSystemsABuildandContinuousIntegrationToolsAUsefulLibrariesAOtherToolsBBibliographyIndexReporterratumthiscopyis(Pprinting,November)PreparedexclusivelyforRobertWalshDownloadatWoweBookComPrefaceI’vealwaysbeenmystifiedwhysofewbooksareavailableondebuggingYoucanbuyanynumberoneveryotheraspectofsoftwareengineeringsuchasdesign,codeconstruction,requirementscapture,methodologiesthelistisendlessAndyet,forsomereason,debugginghasbeenalmost(notquitebutverynearly)ignoredbyauthorsandpublishersIhopethatthisbookcanhelpremedythesituationIfyouwritecode,it’sacertaintythatatsomepoint(possiblyverysoonafterward)you’regoingtohavetodebugitDebuggingis,morethananythingelse,anintellectualprocessitdoesn’ttakeplacewithinadebuggeroryourcodebutinsideyourmindReachinganunderstandingoftherootcauseoftheproblemisthecornerstoneuponwhicheverythingelsedependsOvertheyears,I’vebeenfortunatetoworkwithanumberofincrediblytalentedteamsonawiderangeofsoftwareI’veworkedatalllevelsofabstractionfrommicrocodeonbitsliceprocessorsthroughdevicedrivers,embeddedcode,mainstreamdesktopsoftware,andwebapplicationsIhopethatIcanpassalongsomeofthelessonsI’velearnedfrommycolleaguesalongthewayAboutThisBookThisbookisdividedintothreeparts,eachofwhichconsidersaparticularaspectofdebugging:“TheHeartoftheProblem”:Thispartintroducestheempiricalapproach,whichleveragesoursoftware’suniqueabilitytoshowuswhat’sgoingon,andthecoredebuggingmethod(reproduce,diagnose,fix,reflect)thatreliesuponitPreparedexclusivelyforRobertWalshDownloadatWoweBookComACKNOWLEDGMENTS“TheBiggerPicture”:Howdowefindoutthatthere’saproblemthatneedsfixinginthefirstplaceAndhowdoesdebuggingintegrateintothewidersoftwaredevelopmentprocess“DebugFu”:Inthethirdandfinalpart,we’llturnourattentiontoanumberofadvancedtopics:•Althoughtheapproachesdiscussedearlierinthebookapplytoallbugs,certaintypesofbugsbenefitfromspecialtreatment•DebuggingstartslongbeforetheiratetelephonecallfromtheuseraffectedbyitWhattoolsandprocessescanweputinplaceaheadoftimetohelpwhenthephonerings•Finally,we’llconsideranumberofcommonpitfallstoavoidAcknowledgmentsIt’snotuntilIembarkeduponthetaskofwritingabookofmyownthatIrealizedthetrueimportanceoftheacknowledgmentssectionMynamemightbeonthefrontcover,butitwouldn’thavecometofruitionwithoutthehelpofmanyandtheforbearanceofmanymoreThankstoeveryonewhojoinedthebook’semaildiscussionlistandprovidedinspiration,criticism,andencouragementAndrewEacott,DanielWinterstein,FreelandAbbott,GarySwanson,JorgeHernandez,ManuelCastro,MikeSmith,PaulMcKibbinandSamHallidayParticularthankstoDaveStrauss,DominicBinks,FrederickCheung,MarcusGröber,SeanEllis,VandyMassey,MatthewJacobs,BillKarwin,andJeremySydikwhohavekindlyallowedmetosharetheiranecdotesandinsightswithyouThanksalsotoAllanMcLeod,BenCoppin,MiguelOliveira,NeilEccles,NickHeudecker,RonGreen,CraigRiecke,FredDaoud,IanDees,EvanDickinson,LyleJohnson,BillKarwin,andJeremySydikfortakingthetimetoparticipateintechnicalreviewTomyeditor,JackieCarter,thankyouforbeingsopatientwithafirsttimeauthorlearningtheropes,andthankstoDaveandAndyfortakingthechanceReporterratumthiscopyis(Pprinting,November)PreparedexclusivelyforRobertWalshDownloadatWoweBookComACKNOWLEDGMENTSApologiestomycolleaguesatTexpertswhohavehadtoenduremetalkingaboutnothingbutthebookfortoolong(don’tworryI’llgetanewracecarsoon,andthenyou’llhavetoenduremetalkingaboutthatinstead)Andtomyfamily,sorryforthelongeveningsandweekendsduringwhichI’vebeenincommunicado,andthanksforthesupportFinally,thankyoutoeveryoneI’vehadtheprivilegeofworkingwithovertheyearsThebestaspectofacareerinsoftwaredevelopmentisthecaliberofthepeople,andI’vebeenparticularlyluckytoworkwithatrulygreatselectionPaulButcherAugustpaulpaulbutchercomReporterratumthiscopyis(Pprinting,November)PreparedexclusivelyforRobertWalshDownloadatWoweBookComPartITheHeartoftheProblemPreparedexclusivelyforRobertWalshDownloadatWoweBookComChapterAMethodintheMadnessSo,yoursoftwaredoesn’tworkNowwhatSomedevelopersseemtohaveaknackofunerringlyzeroinginontherootcauseofabug,whereasothersthrasharoundapparentlyaimlesslyandwithoutconcreteresultsWhatseparatesthefirstgroupfromthesecondInthischapter,wewillexamineadebuggingmethodthathasbeenrepeatedlyproveninthetrenchesofprofessionalsoftwaredevelopmentIt’snotasilverbulletyou’restillgoingtohavetorelyonyourintellect,intuition,detectiveskills,and,yes,evenalittleluckButitwillallowyoutotargetyoureffortsmosteffectively,avoidchasingphantoms,andgettotheheartoftheproblemasquicklyaspossibleSpecifically,we’llcoverthefollowing:•Thedifferencebetweendebuggingand“makingthebuggoaway”•Theempiricalapproachusingthesoftwareitselftoshowyouwhat’sgoingon•Thecoredebuggingprocess(reproduce,diagnose,fix,reflect)•FirstthingsfirstthingstothinkaboutbeforedivinginDebuggingIsMoreThan“MakingtheBugGoAway”Askaninexperiencedprogrammertodefinedebugging,andtheymightanswerthatitis“findingafix”Infact,thatisonlyoneofseveralgoals,andnoteventhemostimportantofthemPreparedexclusivelyforRobertWalshDownloadatWoweBookComDEBUGGINGISMORETHAN“MAKINGTHEBUGGOAWAY”Effectivedebuggingrequiresthatwetakethesesteps:WorkoutwhythesoftwareisbehavingunexpectedlyFixtheproblemAvoidbreakinganythingelseMaintainorimprovetheoverallquality(readability,architecture,testcoverage,performance,andsoon)ofthecodeEnsurethatthesameproblemdoesnotoccurelsewhereandcannotoccuragainOfthese,byfarthemostimportantisthefirstidentifyingtherootcauseoftheproblemisthecornerstoneuponwhicheverythingelsedependsUnderstandingIsEverythingInexperienceddevelopers(andsometimes,unfortunately,thoseofuswhoshouldknowbetter)oftenskipdiagnosisaltogetherInstead,theyimmediatelyimplementwhattheythinkmightbeafixIfthey’relucky,itwon’twork,andalltheywillhavedoneiswastetheirtimeTherealdangercomesifitworks,orseemstowork,becausenowthey’vemadeachangetothesourcethattheydon’treallyunderstandItmightfixthebug,butthereisarealchancethatinrealityitisonlymaskingthetrueunderlyingcauseWorse,thereisagoodchancethatthiskindofchangewillintroduceregressionsbreakingsomethingthatusedtoworkcorrectlybeforehandWastedTimeandEffortSomeyearsago,IfoundmyselfworkinginateamcontaininganumberofveryexperiencedandtalenteddevelopersMostoftheirexperiencewaswithUNIX,butwhenIjoinedtheteam,theywereinthelatestagesofportingthesoftwaretoWindowsOneofthebugsfoundduringtheportwasaperformanceissuewhenrunningmanythreadssimultaneouslySomethreadswerebeingstarved,whileotherswererunningjustfineGiventhateverythingworkedjustfineunderUNIX,theproblemwasclearlybrokenthreadinginWindows,sothedecisionwasmadetoimplementacustomthreadschedulingsystemandavoidusingthatprovidedbytheoperatingsystemThiswouldbealotofwork,obviously,butquitewithinthecapabilitiesofateamofthiscaliberReporterratumthiscopyis(Pprinting,November)PreparedexclusivelyforRobertWalshDownloadatWoweBookComTHEEMPIRICALAPPROACHIjoinedtheteamwhentheyweresomewayintotheimplementation,andsureenough,threadswerenolongersufferingfromstarvationButthreadschedulingissubtle,andtheywerestillworkingthroughanumberofissuesthathadbeencausedbythechange(notleastofwhichwasthatthechangeshadslowedthewholesystemdownsomewhat)Iwasintriguedbythisbug,becauseI’dpreviouslyexperiencednoproblemswithWindows’threadingAlittleinvestigationdemonstratedthattheperformanceissuewascausedbythefactthatWindowsimplementsadynamicthreadpriorityboostThebugcouldbefixedbydisablingthiswithasinglelineofcode(acalltoSetThreadPriorityBoost())ThemoralTheteamhaddecidedthatWindows’threadswerebrokenwithoutreallyinvestigatingthebehaviortheywereseeingInpart,thismighthavebeenaculturalissueWindowsdoesn’thaveagoodreputationamongUNIXhackersNevertheless,iftheyhadtakenthetimetoidentifytherootcause,theywouldhavesavedthemselvesagreatdealofworkandavoidedintroducingcomplicationsthatmadethesystembothlessefficientandmoreerrorproneWithoutfirstunderstandingthetruerootcauseofthebug,weareoutsidetherealmsofsoftwareengineeringanddelvinginsteadintovoodooprogrammingorprogrammingbycoincidenceTheEmpiricalApproachTherearemanydifferentapproachesyoucanadopttogaintheunderstandingyouseekAndaslongastheapproachyouchoosegetsyouclosertoyourgoal,ithasserveditspurposeHavingsaidthat,itturnsoutthatinmostinstancesoneparticularapproach,theempiricalapproach,tendstobebyfarthemostproductiveConstructexperiments,andobservetheresultsEmpiricismreliesuponobservationorexperience,ratherthantheoryorpurelogicInthecontextofdebugging,thismeansdirectlyobservingthebehaviorofthesoftwareYes,youcouldreadtheentiresourcecodeandusepurereasontoworkoutwhat’sgoingon(andonoccasionyoumayhavenootherchoice),“Theusebygues

职业精品

(汽车)产品营销策划书范文.doc

HH牙膏营销方案策划书.doc

加班管理人力资源考勤管理系统方案.doc

物品采购管理制度-正式.doc

用户评论

0/200
    暂无评论
上传我的资料

精彩专题

相关资料换一换

  • Debug It!.pdf

  • Debug+It%21+Find…

  • [软件调试修炼之道].Paul.…

  • debug_it.pdf

  • debug_it.pdf

  • Trade.the.Trader…

  • Debug_It!_Find,_…

  • Manage Your Day-…

  • find-your-streng…

  • Find Your Power.…

资料评价:

/ 218
所需积分:2 立即下载

意见
反馈

返回
顶部