-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathILikeUnitTesting.cfm
More file actions
8 lines (7 loc) · 2.16 KB
/
ILikeUnitTesting.cfm
File metadata and controls
8 lines (7 loc) · 2.16 KB
1
2
3
4
5
6
7
8
I Like Unit Testing
I never imagined that I'd say that, but it's true. I must start by admitting that I wrote my first unit test a couple of days ago. I know, I'm bad, I should have been doing this for years. I've known about unit testing for years, I've been reading more and more about it, and listening to speakers at conferences extol its virtues. But somehow I just couldn't get my a$$ in gear. It just seemed like too much extra work. And as a sole developer working on relatively small projects I was able to get away with not doing it.</p>
<p>Anyway, I read a <a href="http://www.bryantwebconsulting.com/blog/index.cfm/2008/7/2/An-Introduction-to-Writing-Unit-Tests-with-CFUnit">blog post</a> a few days ago that inspired me to take the plunge. The post describes unit testing with <a href="http://cfunit.sourceforge.net/">CFUnit</a>, but I'd been hearing a lot of good things about <a href="http://mxunit.org/">MXUnit</a>, so I decided to give that a try.</p>
<p>I started by visiting the <a href="http://mxunit.org/">MXUnit Home Page</a>, and went through steps 1 and 2, which I was able to complete without a hitch. I now had the framework and the Eclipse Plugin installed. I then visited the <a href="http://mxunit.org/doc/index.cfm">docs</a>, and worked my way through the Base Tutorials. Within an hour I was up and running and writing my first real unit test. Kudos to the MXUnit team for a great product, and such clear and concise documentation.</p>
<p>The biggest surprise for me is just how much I enjoy unit testing. I guess it's more the whole process of Test-driven development (TDD) that I enjoy, but I do also like writing the tests themselves. It's like a whole new realm of problem solving has been opened up to me. I'm also already seeing how much time I'm saving this way - it's truly amazing.</p>
<p>I think I also found it easy to get started as I had one component that I decided to unit test. It was a nice, small place to start, and relatively easy to test.</p>
<p>So my advice to anyone else who's on the fence as I was; find a small component, give yourself a few hours to really get started, and you too may find that unit testing isn't painful at all.</p>