CSC 216 F09/Debugging S: Difference between revisions
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==Step by Step Debugging== | |||
===The problem=== | ===The problem=== | ||
This exercise is an intro | This exercise is an intro to debugging. It focuses on the step over and step into tools in Eclipse.<br> | ||
Step | Step Into enters the next method at the line of code currently being executed. to debug it, while Step Over executes the next method without entering it in the user interface. | ||
The purpose of this exercise is to simulate the process of finding errors in a program using Eclipse's tools. | |||
The sample program finds the areas of different polygons and polyhedrons. | |||
Sample Code: | |||
//calculate the surface area of a box | |||
transformBox(); | |||
boxarea=boxArea(); | |||
System.out.println("Box Calculated= " +rectanglearea); | |||
System.out.println("Box Expected= " +192); | |||
public void transformBox(){ | |||
width=length; //(Error shown if Show error is clicked) width should equal height | |||
} | |||
===Participants and props=== | ===Participants and props=== | ||
Step by Step Debugging was created in Flash, using 18 frames and screenshots of Eclipse to show where each Step Over and Step Into will lead. <br> | |||
Anyone can download the file and go through the exercise on their computer. | |||
The flash file [http://www4.ncsu.edu/~dclong2/debug.swf] | |||
Made by David Long, Dustin Geckler, and Parker Beaman | |||
===The script=== | ===The script=== | ||
Run the flash file. After hitting debug, you are able to choose | Run the flash file. After hitting debug, you are able to choose Step Over or Step Into to examine the code further and find the errors. |
Latest revision as of 02:09, 17 November 2009
Step by Step Debugging
The problem
This exercise is an intro to debugging. It focuses on the step over and step into tools in Eclipse.
Step Into enters the next method at the line of code currently being executed. to debug it, while Step Over executes the next method without entering it in the user interface.
The purpose of this exercise is to simulate the process of finding errors in a program using Eclipse's tools.
The sample program finds the areas of different polygons and polyhedrons.
Sample Code:
//calculate the surface area of a box transformBox(); boxarea=boxArea(); System.out.println("Box Calculated= " +rectanglearea); System.out.println("Box Expected= " +192);
public void transformBox(){ width=length; //(Error shown if Show error is clicked) width should equal height }
Participants and props
Step by Step Debugging was created in Flash, using 18 frames and screenshots of Eclipse to show where each Step Over and Step Into will lead.
Anyone can download the file and go through the exercise on their computer.
The flash file [1]
Made by David Long, Dustin Geckler, and Parker Beaman
The script
Run the flash file. After hitting debug, you are able to choose Step Over or Step Into to examine the code further and find the errors.