As folks know, I've been a big fan of unit testing for quite a while and used to advocate Paul Kenney's cfcUnit at every opportunity. Unfortunately, Paul hasn't been working on cfcUnit much for the last few years and MXUnit has grown up to take the crown of the most comprehensive, most robust, most feature-rich testing framework for ColdFusion.
If you're still not doing unit testing, you need to check out the MXUnit website and try to get to at least one of the presentations that the MXUnit team are giving. They're on the Online ColdFusion Meetup on Thursday July 17th (database patterns for unit testing - Bill Shelton) and if you're at MAX 2008, you can catch Marc Esher talk about advanced patterns for ColdFusion test automation which should be excellent (Wednesday, November 19th @ 9:30am).
Brian's preso (references on my blog) also shows off MXUnit along with his tools. Worth checking out.
Most of the examples I've seen demo pretty simple functions (add 2 numbers, etc) that no one would actually write.
How do you test a query function, though, except for the case of a database exception? It is perfectly acceptable for a query to return 0 rows, and it could be acceptable (though possily undesirable) for a query to return 10,000 rows. There's no simple assertion that I can envision to indicate whether a function passed or failed, as the results are strongly dependent on input parameters, and may well change over time.


