Unit testing macro code using JUnit

The RPTools applications are written in Java. If you're interested in contributing to any project here by submitting patches to the source code, this is the forum to ask questions about how to do so. Please put the two-letter tool name abbreviation in your thread Title. To enter this group, go to the Usergroups page of your User Control Panel and join the Java Developer group.

Moderators: dorpond, trevor, Azhrei

Post Reply
User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Unit testing macro code using JUnit

Post by jfrazierjr »

So, in discussions about targeting, macro performance came up. Craig noted that he has a few ideas that would speed up the macro performance, but the changes would likely require a fair bit of code changes to support. Part of that would then require him or someone else to extensively test the macro functions to make sure nothing is broken. At this point, I started playing around to see if I could get any JUnit tests to work around macro parsing. I quickly found out that much of the Maptools set up code is not geared toward doing any unit tests. I was wondering if this can be discussed for changing in 1.4 since it is expected to have a fairly large GUI rewrite anyway.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Unit testing macro code using JUnit

Post by Azhrei »

Great point.

I think it would be most excellent :) to dictate that all code checked in must have unit tests to go with it. I'm not so picky as to withhold waivers for some types of code (network handling routines, for example). But as you might guess I'm a big fan of programming-by-contract and starting out by writing unit tests is a big step in that direction, I think.

But that's just me and I'm not the one who's going to be writing all of the new 1.4 code!

Post Reply

Return to “Java Programming Info”