Debugging Process in Software Engineering

debugging in software engineering

Debugging in Software Engineering –

On successful completion of software testing, debugging is performed. Debugging in software engineering is defined as the process of analyzing and removing all the errors. It is considered very necessary in every newly developed software or the hardware and in all the commercial products/ personal application programs. For the complex products, debugging is performed at all the levels of software testing.

Debugging is considered as a complex and very time-consuming process. Since, it attempts to remove all the errors at all the levels of software testing. To perform debugging, a debugger (debugging tool) is commonly used to reproduce the conditions in which the failure occurred, by examine the program state, and locating the cause. With the help of a debugger, programmer traces the program execution step by step (evaluating all the value of variables) and halting the execution whenever required to reset the variables. Note that many programming language packages usually include a debugger for checking the code for the errors while it is written.

Guidelines required while performing debugging in software engineering are discussed here-

  1. Debugging is the process of solving any problem. Hence, all the individuals that are involved in debugging. Should understand the causes of an error before starting with the debugging.
  2. No experimentation need to be done while performing the debugging. The experimental changes instead of removing the errors often increase the problem by adding some new errors in it.
  3. Whenever there is an error in segment of a program, there is a very high possibility that some other kind of errors also exist in that program. Hence, if any error is found in one segment of program, then rest of the program should be carefully examined for errors.
  4. It should be very ensured that all the new code that are added in a program to fix errors is correct and is not having any new error in it. Thus, to verify correctness of any new code and to ensure that 0 new errors are introduced, regression testing method should be performed.

The Debugging Process

During debugging, many errors are encountered. It may range from less damaging (like input of any incorrect function) to high damaging (like the system failure, which can lead to economic or any physical damage). Note that with increase in total number of errors, the total amount of effort required to find their causes also increases.

Once all the errors are identified in software system, to debug the desired problem, a few number of steps are followed, which are listed below.

  1. Defect confirmation/identification:An error is identified in a system and its defect report is created. A software engineer usually maintains and analyzes all this error report and tries to find solutions to the below questions.
    • Does the defect exist in the system?
    • Can this defect be reproduced?
    • What is the expected/desired behavior after defect of the system?
    • What is the actual behavior of system?
  2. Defect analysis:If the defect found is genuine, then the next step is to understand the root cause of that problem. Generally, software engineers debug by starting debugging tool (debugger).  Then they try to understand the basic root cause of the problem by following a step execution of the program.
  3. Defect resolution:Once the main cause of a problem is identified, the error can be easily resolved by making some appropriate changes to the system by fixing all the problem.

When the main debugging process ends, the software is again tested to ensure that no errors are left that are undetected. Moreover, it just checks that no errors are introduced in the software. While making some required changes to it during this debugging process.

Debugging Strategies

As debugging in software engineering is a difficult and very time-consuming task. It is very essential to develop any proper debugging strategy. This strategy will help in performing the process of debugging very easily and efficiently. The mainly used debugging strategies are debugging by using brute force, deduction strategy, induction strategy, backtracking strategy, and debugging by testing.

Brute force method used in debugging is the most commonly used method but least efficient method. It is generally used when all the other available methods fail. Here, debugging is done by taking the memory (or storage) dumps. Actually, program is loaded with all the output statements. That may produce a very large amount of info including all the intermediate values. Analyzing this information may help you to identify the errors caused. However, by using a memory dump for finding the errors requires analyzing very huge amount of information. It may lead to waste of time and effort.

This strategy is called ‘disciplined thought process’ where all the errors can be debugged by moving outwards. This strategy usually assumes that once all the symptoms of errors are identified, and all the relationships between them are established. The errors can be very easily detected by simply looking at the symptoms and all the relationships. To perform the induction strategy, some steps are followed, which are listed below-

 Locating relevant data:

All the information about program is collected in this to identify the functions, which may be executed correctly or incorrectly.

Organizing data:

 The collected data is then organized according to their importance. The data may consist of all the possible symptoms of errors. Their location in program, the time at which all the symptoms occur during the time of execution of the program and effect of these symptoms on the desired program.

Devising hypothesis:

The relationships among all the symptoms are studied and a hypothesis is later devised. That may provide the hints about all the possible causes of errors.

Proving hypothesis:

In this final step, the hypothesis is needed to be proved. It is done by comparing all the data in the hypothesis with original data. In order to ensure that this hypothesis explains the existence of the hints completely.


Speak Your Mind