The Art of Debbuging

The 4W Technique

From my perspective that we can solve any bugs by asking these four questions

  • When
  • What
  • Where
  • Why

When?

  • When a bug or issue arises is the first question.
  • In which scenario or test case does the bug occurs.
  • First, we have to identifying the scenario.
  • Then, confirm the scenario by repeating same case several time or similar case several time.

What?

  • What is the desired output what is the program output?
  • Simply what is your end goal?

Where?

  •  Where is the skewing occurs from the desired path.
  •  Where the processing input gets modified to something not intended or remains unchanged when it should have been processed.
  •  Or In case of error, Where is the exception or error occurs?
    • In java which class -> function -> line does the error occurs?
    • It can be identified from error stack trace.

Why?

  • At last the most crucial part, Why it occurs ??
  • Why whatever happens, happens?
  • If you find out why it occurs you can most possible solve it.
    • If there is an exception there may be validation problem. So we can validate for the particular case.
    • If there is some processing left undone, finish it.
End Note:
 
According to Murphy's law "Anything that can go wrong will go wrong". So, don't sweat it. 
 
PS: It is not a standard scientific method. But this is what I do to solve the problem.

That's it!

Comments

Popular posts from this blog

How to install Apache Tomcat in Ubuntu

How to install MRTG on UBUNTU

How to send email on user login in ubuntu