Search here for all the info you want in this Blog

Script Debugging


     The term debugging refers to the activity of a programmer trying to figure out the cause of a problem (or “bug”) in his or her program, and then taking steps to eliminate the problem.

            What is Debugger?
            A debugger is a tool to help programmers follow the logic of their code as it runs. This can aid not only in finding bugs, but also in simply understanding a program.

            A debugger sits in between the complier and/ or runtime engine and the actual running program. (In the case of VBScript, the compiling step is  invisible; the scripting engine complies the code for you when you run it.)

            A typical debugger gives you various tools to help in watching and interacting with your code as it executes:

            Breakpoints:A way to specify a certain line of code on which to pause program execution.The line of code you specify is called a breakpoint.

     Example: If the problem you are having is deep down the code in your function, you would mark a certain line in the function as a breakpoint.The program would run up until the breakpoint is reached, at which point the program pauses execution, showing you the breakpoint line.
     
     Step Into , Step Over, and Step Out: A way to step through your code one line at a time.


            Step Into will bring the debugger into a procedure or function, If one is being called and if the code for it is in the scope of the debugger.This is useful when you suspect the procedure being called might have a problem.
    
            Step over:Will do the opposite: If the line you are on calls a procedure or function, the debugger will execute it without stepping into it.This is useful when you are confident that the procedure being called is not part of the problem you’re debugging.

            Add Watch:A way to view the value of all of the variables active at any given point in the code.While code execution is paused, mostly any debugger will have some way to view all of the variables active at that point in the code and what their values are.(Using Command Widow)
    
      Call Stack:A way to view the “Call Stack” .The Call Stack is the nested sequence of function and procedure calls that have led to a certain point in the code.Example: The Call stack displayed the Main procedure which called the sub procedure and also sub procedure calling to another low-level procedure.


1 comment:

  1. It is really a great work and the way in which u r sharing the knowledge is excellent.
    Thanks for helping me to understand script debugging concepts. As a beginner in software testing your post help me a lot.Thanks for your informative article. software testing Training in chennai | Best software testing Training institute in velachery

    ReplyDelete