An Introduction to Writing Unit Tests (with CFUnit)

In our last user's group meeting, we had a round table discussion about testing. I said that I would put together a simple example of a unit test.

Since I have been using CFUnit so far (MXUnit looks attractive as well though), that is what I will use for my example. The principles should work the same for any common testing framework.

[More]

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Hey Steve,

Great post. I'm ashamed to admit that prior to reading your post I hadn't written a single unit test in my career. It's something I've known I should be doing for a long time, and I'd read all about it, but just couldn't seem to get myself started.

Thanks to your post I can now say that I actually have written a unit test (using MXUnit, btw), and will continue to do so.

Thanks for the kick in the pants ;-)

Bob
# Posted By Bob Silverberg | 7/2/08 8:42 PM
broken image immediately after "This yields the following result" ?
/clients/example/unittest/1-notest.jpg

otherwise, thanks for the great post
# Posted By duncan | 7/3/08 5:20 AM
Bob,

That is great news! Glad I was of use.

Duncan,

Thanks for the catch. That is fixed now.
# Posted By Steve Bryant | 7/3/08 5:38 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.