Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 16 in printed book and digital formats -- plus a one-year subscription (beginning with 17.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 6.6

COLUMN

Debugging

Learn How To Debug

Issue: 6.6 (September/October 2008)
Author Bio: Bob is the owner and Vice President of BKeeney Software located in Kansas City. He is also the current President of the Association of REALbasic Professionals.
Article Description: No description available.
Article Length (in bytes): 4,800
Starting Page Number: 44
Article Number: 6615
Related Web Link(s):

http://www.rbdevzone.com/free-software/rbunit/

Excerpt of article text...

Your customers and clients expect your REALbasic applications to be as bug free as possible. What mechanisms do you have in place to handle an error and report it? Bugs occur -- that's a fact of life -- and even the best error handling in the world can't prevent bugs from occurring.

Thoroughly testing your application is your first and best line of defense. However, it's very time consuming and without good testing procedures it could even be a waste of time. Regression testing is the only way to really make sure that changes in one part of your code doesn't change other parts of your application (or a new version of REALbasic doesn't affect you either!). An excellent way to do regression testing on your software is to use the open source unit testing module called RBUnit (http://www.rbdevzone.com/free-software/rbunit/). It allows you to test your code with known inputs and test them against the actual output.

A common question from the forums is that people get an error message saying, "The application has encountered an error and must now shutdown," and they have no idea what the error is or where the error occurred in their code. They need to learn as much as they can about the Exception class and in particular the Stack property. The stack was introduced in RB 2006 and has a string array that contains the methods that have run from the entry point into your code until where the exception occurred. Be aware that the Include Function Names property has to be true in your application for the stack to be readable.

...End of Excerpt. Please purchase the magazine to read the full article.