I started a new CFML position on a Knowledge Management (KM) project this past Monday. It’s a a great bunch of folks and an awesome team of CFML developers, in particular. My new position has me working on the mobile team, on which we are currently building an Air desktop application for our KM project. The only ‘drag’ with my first week is that my team lead is out for vacation … and the mobile team is the smallest team in the company, consisting of the team lead and me.

So, my assignment this week has been twofold: (1) get up and running and (2) start working on unit tests for the existing methods in the mobile project. The first task was no big deal. The second task, however, is both exciting and intimidating. It’s exciting because I have read and toyed with test driven development (TDD) for years but was not disciplined about testing and did not use TDD across my projects.

It’s intimidating because, as I just noted, I have not yet used TDD consistently in my projects, let alone employing TDD inside a new, existing, large project that heretofore has not used TDD/unit tests. The development teams have decided that we should start out with adding unit tests for all existing methods so that we can do regressing testing as we add new features, etc. Going forward, I believe the mobile team will go full-on TDD. Great. But, why am I boring you all with this? Well, mostly because I’m sort of evil that way :). Okay, I am not that evil. I wanted to write this post because of how important I think it is that more and more CFML developers give TDD (or BDD, if that’s your thing) a long, hard look. But where do we go to get started? Here’s the approach I took to get myself rolling:

MXUnit

  1. Download mxunit (and the eclipse plugin, if you use CFEclipse or ColdFusion Builder)
  2. Follow the wiki’s Getting Started section to make sure you have it installed and running correctly
  3. Read through the Testing Basics section of the wiki to give yourself a general sense of how unit testing works
  4. Read through the Using the Eclipse Plugin section of the wiki (if you’re using an Eclipse-based IDE, that is)

ColdFusion Koans (Github URL)

  1. Read the initial documentation on the Koans page
  2. Clone the github repository and get to work making and running tests!

Back to MXUnit

  1. Complete reading through the wiki (Advanced Stuf and the API Reference sections)
  2. Start a simple project and go TDD all the way
  3. I did the now-standard “To-Do” project to get myself more into the mindset of TDD)Ryan Anklam and Mike Henke have done a great job with Koans. Not only does Koans teach you a lot about TDD in ColdFusion but it’s also a great project to learn ColdFusion/CFML or just refresh your knowledge of it.

There you have it … in my opinion, it’s time to start living the TDD lifestyle. And, with kick-ass projects like MXUnit and ColdFusion Koans, there is no time like the present to get started!