Accessibility
Bill Shelton

Bill Shelton

mxunit.org

Marc Esher

Marc Esher

mxunit.org

Table of Contents

Created:
20 April 2009
User Level:
Intermediate
Products:
ColdFusion

Test Driven Development with ColdFusion – Part 1: Driven by the cold

"Testing is not the same thing as having tests."
—Kent Beck, Test Driven Development: By Example

Test Driven Development (TDD) is the disciplined practice of writing unit tests prior to writing the actual production code. This practice can lead to clean, well-designed software that is agile and easily adapted to rapidly changing requirements. Additionally, having tests for your code gives you a platform for immediate feedback on the state of your software and communicates your intentions to team members. The process is simple; yet, like anything done well, it takes time to learn and practice. You write tests for your code first, quickly write just enough code to make the tests pass, then refactor the code until it satisfies the system's requirements, ensuring your test is passing as you are refactoring. Changes to code are done in small increments, referred to as baby steps. While developing, you will frequently run your unit tests. This gives you that immediate feedback.

This two-part series will demonstrate how to apply TDD and unit testing techniques to ColdFusion application development. It will show you how you can leverage the MXUnit toolset to build unit tests and automated test suites that give you, the developer, an almost instantaneous assessment of your code while facilitating collaboration in a team environment.

Requirements

In order to make the most of this article, you need the following software and files:

ColdFusion 8

MXUnit Framework and Eclipse Plugin

Sample files:

Prerequisite knowledge

Working knowledge of ColdFusion components. Minimal understanding of MXUnit, unit testing, and CFEclipse will also be helpful.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

About the authors

Bill Shelton is the blurred visionary for the MXUnit framework and part-time software quality evangelist. He has been building web software since the time CGI and Perl were considered really cool and has been using ColdFusion, Java, and other languages for more than 10 years. Bill lives in Northern Virginia with his wife and kids, and works for the U.S. Federal Government.

Marc Esher has been developing ColdFusion and Java applications since 2000. He currently works in the financial industry building custom print-on-demand software. He is a co-project-owner for MXUnit and has contributed the Eclipse plugin along with several framework features. He has an abiding passion for team building, mentoring, and process improvement. Marc lives in Pennsylvania with his wife and children.

Marc and Bill blog occasionally at http://blog.mxunit.org and can be followed on Twitter: Bill Shelton@virtix. Marc Esher@marcesher