CHAPTER 5 HOW TO TEST AND DEBUG APPLICATION
CHAPTER 5: HOW TO TEST AND DEBUG APPLICATION #9 Tarun Ashwinbhai Gajjar
OVERVIEW • Test • debug • How to work in break mode • How to control the execution of an application
TEST AND DEBUG ?
TESTING • In general, testing is finding out how well something works. • Testing is an essential aspect of any programming language.
DEBUGGING • Debugging is the process of detecting and removing of existing and potential errors (also called as ‘bugs’) in a software code that can cause it to behave unexpectedly or crash. • To debug a program, user has to start with a problem, isolate the source code of the problem, and then fix it.
HOW TO WORK IN BREAK MODE Shopping Cart application in break mode
• When you enter break mode, the debugger highlights the next statement to be executed. • To display the value of a variable or property in a data tip, position the , mouse pointer over the variable or property in the Code Editor window. • To display the members of an array, structure, or object in a data tip, position the mouse pointer over it to display its data tip, and then point to the plus sign in the data tip.
• To change the value of a property or variable using a data tip, click on the value in the data tip and then enter the new value. • You can use the icons to the right of a data tip to pin the data tip so it remains displayed, to unpin the data tip so it floats on top of all other open windows, to add, display, and hide the comment for a data tip, and to close the data tip. • To continue program execution, press F 5 or click the Continue button in the Standard or Debug toplbar. For more on controlling program execution.
HOW TO CONTROL THE EXECUTION OF AN APPLICATION Commands in the debug menu and toolbar Commands in the Code Editor window’s shortcut menu
• Once the application enters break mode, you can use the Step Into, Step Over, Step Out, and Run To Cursor commands to execute one or more statements and return to break mode. • To alter the normal execution sequence of the application, you can use the Set Next Statement command. • To stop an application that's caught in a loop, switch to the Visual Studio window and use the Debug» Break All command.
Thank you
Queries? ? ?
- Slides: 12