Unit Testing
Now we go over a few server-side debugging approaches that we use while working with ZoomFlex applications.
Unit Testing is the first amongst them. In reality, it is much more than a debugging approach. It is a critical part of how you develop software. It involves writing unit tests for each piece of functionality you add to server-side components. So, for example, if you extend a server-side ColdFusion component by adding new methods to it, you write tests for those methods as you go along, thinking through the various aspects you need to test. The advantage of this approach is that you can simply run unit tests on your components on the server and you can be assured that your server-side functions are doing what you expect them to. If the tests fail, then you know that you need to fix your server-side methods before looking at the code in your ZoomFlex application.
We have used two unit test frameworks with ZoomFlex applications: CFUnit and RocketUnit. CFUnit is a more established framework with support in Eclipse for running tests. RocketUnit is a relatively newer framework. The key difference between the two is that RocketUnit provides a simpler way to test -- it has a single assert statement. On the other hand, CFUnit is more widely used and has Eclipse IDE support.
Whichever framework you decide to use, the basic idea remains the same -- write tests for functionality as you develop it. Writing tests can take slightly longer, but it reduces the time to deploy applications later on. It also helps you focus on your debugging energies on client-side or network-related issues rather than server-side issues.
Next approach: ZoomFlex Server-side Debugging »
Comments
There are no comments for this page as yet.
print page
