Special

Special Print Closeout!

We're clearing out the remainder of our print issues at fire sale prices -- as much as 75% off! Quantities are extremely limited and only available while supplies last. Hurry to take advantage of this one-time offer.

RBD Magazines

Once these printed back issues are gone, they are gone!

Article Preview


Buy Now

Print:
PDF:

Feature

PostMortem: RBUnit

Unit Testing for REALbasic

Issue: 5.6 (September/October 2007)
Author: Paul Lefebvre
Article Description: No description available.
Article Length (in bytes): 5,429
Starting Page Number: 11
RBD Number: 5607
Resource File(s): None
Related Web Link(s):

http://www.logicalvue.com/
www.rbdevzone.com
support.realsoftware.com/feedback/nblvhwyb

Known Limitations: None

Excerpt of article text...

It all began in early 2004. I was working with Visual Studio 2003 and learning about unit testing. And I liked it. A lot. In the .NET world there are lots of unit testing frameworks to choose from. I used both nUnit and csUnit. Both of these unit test frameworks included a "test runner" UI that showed test results visually. I preferred the csUnit test runner (see Figure 1).

During this same time I was also spending a lot of time with REALbasic as I was developing SQLVue 3.0. I thought it would be useful to have a unit testing framework for REALbasic, but after searching for a while was unable to find one. So I decided to create one. I based RBUnit on csUnit and its test runner.

Developing RBUnit 1.0

It turns out that creating a unit testing framework in REALbasic is not as easy as it is in some other languages because REALbasic does not have reflection (see sidebar). Without reflection, it is not possible for the unit testing framework to determine what the test methods are. So for RBUnit 1.0, I used a rather inelegant method of having the user call their test method manually with a parameter to specify the method name so that it could be displayed in the UI. It was a bit awkward as you can see here:

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

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com