CSC 216 F09/Debugging S: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 9: Line 9:
This exercise is an intro into debugging.  It focuses on the step over and step into tools in Eclipse.<br>               
This exercise is an intro into debugging.  It focuses on the step over and step into tools in Eclipse.<br>               
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.
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===

Revision as of 02:05, 17 November 2009

This page is a work in progress

Debugging S

Step by step debugging.

The problem

This exercise is an intro into 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.