CFUnited Europe Speaker Interview: "Testing CF Applications" with John Paul Ashenfelter

Michael Smith: This time we are talking with John Paul Ashenfelter about his CFUNITED Europe talk "Testing ColdFusion". So why should a developer come to your session John Paul ?

JP : I think most ColdFusion developers have *heard* something about testing over the past year, whether it's test-driven development, unit testing, or one of the myriad other testing topics that are being discussed in the web development community but don't quite know how to *use* those tools and techniques in the daily work. This session demonstrates several different testing tools and techniques and shows how to integrate them into your existing development workflow.

MS: What kinds of tools are you covering?

JP: Well, we're going to cover tools for each aspect of testing as well as the environments that glue all of those tools together. We'll start with the basics -- unit testing and functional testing, and then cover some of the supporting tools and more sophisticated topics like load testing.

MS: Let's hear some more about unit testing.

JP: Sure! Unit testing focuses on testing tiny *units* of an application. In the ColdFusion world, this means testing the methods of CFCs. I'm going to specifically talk about CFCUnit, which functions much as all the other xUnit testing tools in other languages -- JUnit in Java, etc. We'll look at using it standalone, integrating it into Eclipse, and using it in an automated build process.

MS: How should a ColdFusion developer get started with unit testing?

JP: First of all, unit testing is really only going to help the parts of the application that are implemented using CFCs. I think the easiest way to get started is to write unit tests for parts of the application that cause the most trouble or are the most sensitive to bugs -- tax and discount calculations in a commerce application for example.

MS: So what about functional testing?

JP: Functional testing is what we do as web developers all the time -- clicking through a login window, adding a blog post, or any of the many other functions that the web application performs. Computers are *really good* at handling boring, repetitive activities which I think accurately describes how many developers test their applications. During the session we're going to look at the open source Selenium functional testing tool. Selenium basically lets you script (or even record) interactions with a web page and play them back. And of course this can be done either standalone or integrated into an automated build process.

MS: Selenium sounds pretty interesting.

JP: It is! I find that many developers immediately put Selenium to use in automating their current browser-based testing so they can focus on other, more interesting things like development. QA teams have also use Selenium to let their testers developer more sophisticated testing plans with the time freed by automating all of the clicking. Not to mention the reduction in wear-and-tear on your mouse.

MS: What else will you cover?

JP: I'm going to cover a lot of related tools that improve your testing process -- tools like DBUnit for managing data during testing and testing the database itself is one good example. We'll also touch on load testing, but that's a far more complex topic that deserves it's own talk.

MS: You've mentioned automated testing several times -- tell me more about that.

JP: Automated testing is how all these pieces are pulled together. I typically use Ant to automate my entire build process, including tests. Once the testing process is automated, it's straightforward to use something like CruiseControl to *continuously* build and test the application, so as changes are made by any developer, problems are immediately detected and can be fixed early while it's still easy and cheap to do so.

MS: Anything else you want to say about testing?

JP: I'd like everyone to know that even though testing sounds boring, you'll learn things in this session that you can immediately put into practice that will save you time and improve the quality and reliability of your code. Unless you're in love with testing your application manually and dealing with bugs, you should be here!


Testing CF Applications: Test-driven development is very popular in the Java and Ruby worlds and becoming moreso in the ColdFusion world. This session covers the tools that are available to test ColdFusion applications and discusses how to implement them into your existing workflow. We'll specifically cover:

* CFCUnit/CFUnit for testing ColdFusion code

* Selenium for testing web pages

* DBUnit for managing the database during testing

* Other testing for web applications Together, these tools can provide unit, functional, regression, and load tests for your applications. Finally, we'll touch on automating these tests so you can ensure that you are delivering higher-quality, well-tested code.

Speaker Bio: John Paul Ashenfelter is CTO of, where he builds web-based business applications using a mix of open source tools, ColdFusion, and Java. He has been the technical lead on a number of ColdFusion projects for startups as well as regularly serving as an architect for existing ColdFusion sites converting to Fusebox. A ColdFusion developer since version 2.0, John Paul has written several books covering ColdFusion, contributed articles to CFDJ, and spoken at several ColdFusion conferences.

CFUNITED Europe is Thursday 03/12/2008 - Friday 03/13/2008 in Hammersmith, West London UK. It costs $749 until 10/31/07 then $849. For more information on CFUNITED Europe see