Software Debugging | Software Testing Tutorial | Minigranth

Debugging : Introduction

  • Debugging is the process of identifying and correcting errors occurred in a software product.
  • Whenever a software fails, we would like to understand the reason behind it for such failures.
  • After the reason is known, we can attempt to make necessary changes in the source code and try to find the solutions. Those changes can remove the reason for that software failure.

Debugging Process

  • Since, debug means detecting and correcting/removing errors from the software program. Whenever a program generates an unexpected behavior, it is known as failure of program.
  • The process starts after receiving a failure report either from the testing team or from users.
This image describes the complete debugging process that is used while debugging in software testing.
Debugging Process : Software Testing

  • The steps to debug a software product are:
    1. Replication of Bug: It means, to recreate the undesired behavior under controlled scenario.
    2. Understanding the Bug: After the replication is done, the reasons for the failure are searched.
    3. Locating the Bug: Locate the bug in the program/code.
    4. Fixing the Bug and Retesting the program: The bug is fixed in this step by making necessary changes to the program and finally the program is retested again.

Debugging : Easy or Difficult?

  • Debugging itself is a very difficult process because of the involvement of humans.
  • Another reason due to which it is considered as difficult because it consumes a large amount of time and resources too.
  • Whenever a programmer is debugging a program, all he is  doing is taking out the bugs that he put in when writing the program. This is clearly a waste of time and energy, particularly when there are pressures on budgets and timescales. So why not do a better job from the beginning? 
  • Also, due to this developers becomes uncomfortable after receiving any request of debugging as it is taken against their professional pride.

Approaches of Debugging

  • Trial and Error methods.
  • Backtracking.
  • Brute Force.
  • Cause Elimination.

Debugging Tools

  • Run time debugger.
  • Automatic debugger.
  • Automatic test case generator.
  • Memory dump.
  • Compilers.