105

ISBN : 978-81-963532-2-3 (E-Book) Thefollowingaresomeoftheapproachespopularlyadopted byprogrammers fordebugging. BruteForceMethod: This is the most common method of debugging but is the least efficient method. In thisapproach,theprogramisloadedwithprintstatementstoprinttheintermediatevalueswith the hope that some of the printed values will help to identify the statement in error.This approach becomes more systematic with the use of a symbolic debugger (also calleda source code debugger), because values of different variables can be easily checked andbreakpoints andwatch pointscan beeasilyset totest thevalues ofvariables effortlessly. Backtracking: This is also a fairly common approach. In this approach, beginning from the statement atwhich an error symptom has been observed, the source code is traced backwards until theerrorisdiscovered.Unfortunately,asthenumberofsourcelinestobetracedbackincreases,the numberofpotentialbackwardpathsincreasesandmaybecomeunmanageablylargethuslimiting the useof this approach. CauseEliminationMethod: In this approach, a list of causes which could possibly have contributed to the errorsymptom is developed and tests are conducted to eliminate each. A related technique ofidentificationofthe errorfromthe errorsymptomis thesoftwarefault tree analysis. ProgramSlicing: This technique is similar to back tracking. Here the search space is reduced by definingslices. A slice of a program for a particular variable at a particular statement is the set ofsourcelines precedingthis statement that can influencethevalue ofthat variable DebuggingGuidelines Debugging is often carried out by programmers based on their ingenuity. The following are somegeneralguidelinesforeffectivedebugging:  Many times debugging requires a thorough understanding of the program design. Tryingto debug based on a partial understanding of the system design and implementation mayrequirean inordinateamount ofeffort tobeputinto debuggingeven simpleproblems.  Debugging may sometimes even require full redesign of the system. In such cases, acommon mistake that novice programmers often make is attempting not to fix the errorbutits symptoms.  One must be beware of the possibility that an error correction may introduce new errors.Thereforeaftereveryround oferror-fixing, regressiontestingmustbecarriedout. 100 Software Engineering Keerthana P, Manasa KN, Ganga D Bengal

106 Publizr Home


You need flash player to view this online publication