HOME | Overview | Syllabus | Instructor | Lectures | Laboratories | Readings | Assignments | Resources | Other Links
CS 1711 Recitation Laboratory 9:
Debugging and Profiling [11/9/99; 11/11/99]

 

Objectives:


Debugging Overview

Debugging is the process of finding and eliminating program errors. Program errors generally fall into four categories: syntax, linkage, runtime and algorithmic. Section 3.8, 6.8, 6.9, and 7.10 of the textbook discuss some aspects of program debugging. This section briefly describes the four types of errors and how you interact with Java WorkShop to debug them.

Debugger in Java Workshop

Java WorkShop has an interactive debugger that is useful for finding runtime errors and for understanding how programs work. You can access the JWS debugger through the Debug menu bar or through the Debug Toolbar. The main way that we will be using the debugger is to set a stopping point in the program (a breakpoint) and then examining different program variables. More sophisticated ways of using the debugger are described in the JWS documentation that can be accessed through the Task-based Help option on the Help menu bar.

The Debug Toolbar is       where:

You have to build your project with the debug option to use these features of Java WorkShop. This is the default.


Laboratory details:

Check-off procedure:

You must attend the recitation and sign in. This laboratory will be checked off using the new procedures.

Warm up

Part I: Executing to a certain point in your program.

Part II: Setting a breakpoint

A breakpoint is a point in the program where you want the program to stop executing (take a break) so that you can examine its status. The debugging facility in Java Workshop allows you to set a breakpoint at virtually any point in the program. You can then examine your program variables and evaluate expressions based on these variables to determine the state of your program. This part of the laboratory takes you through the steps in setting a break point and examining the value of a variable.

You can also set a count so that the program will stop after a specified number times that the statement at the breakpoint is reached (a counted breakpoint). You can read about these and other debugging features in the Java WorkShop documentation.

Part III: Profiling


Last revision: November 8, 1999 at 8:40 am.