Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the algorithm used to add breakpoints to debug a code? For example a code of 1000 lines where and how many breakpoints should I add

user-image
Question added by Safi Rehman , Intern , Wateen Telecom
Date Posted: 2015/03/18
thushara thushara
by thushara thushara , Software Test Engineer , Macrosoft India Pvt. Ltd

Breakpoints break (temporarily halt) execution of a program during runtime at certain point.

Breakpoints is a feature provided by the debugger in Microsoft Visual Studio that allows breaking execution of code at runtime when debugging applications.For Exampledebugging application

When you click on the side (in the margin) of a line of code in Visual Studio it sets a break point in your code as displayed in the image above. So when you start execution (debug) the code it will break execution at this point. BreakPoint Menu (Option for the Break)he precediing image shows the context-menu for breakpoints, in other words the breakpoint menu. The following describes all the options one by one.

  1. Delete BreakpointThis option of the breakpoint menu allows removal of a breakpoint. 
  2. Disable BreakpointThis option of the breakpoint menu allows disabling a breakpoint so the breakpoint is just disabled and becomes gray. This is useful when the developer just wants to execute code without stopping at the breakpoint yet later on enable it again when they want to use it again. 
  3. Location…This menu option allows setting a breakpoint at a specified location, in other words at a given line in the source code file.

BreakPoint Menu

Syed Muzaffar Uddin Ahmad
by Syed Muzaffar Uddin Ahmad , Senior Engineer Test and QA (Cloud Security, CASB) , Symantec Corporations USA, Subsidiary.

As the name suggest it should be placed where you want to stop the execution of software/application under debugging. I am not if there is any rule of thumb exists for deciding where to put the breakpoint while debugging it merely depends on programmer/reviewer of the code.

mohamedzubair aslam
by mohamedzubair aslam , network engineer , AMS polytechnic college

C++ using Visual Studio, Java with Eclipse

More Questions Like This