Archive for the 'FlexUnit' Category

FlexUnit - Some useful examples and tutorials covering unit testing in Flex and Actionscript 3.0

In an effort to build my skills and create applications that are based on a firm foundation, I am implementing unit testing. So far I am completely sold on the concept, and while I'm not quite to the point of full TDD, I can see the benefits immediately with the tighter code and confidence level that accompanies it. Here are some of the useful resources that I came across in my research. They are all centered around FlexUnit, the 'official' unit testing framework for Actionscript 3.

Neil Webb has an article on Adobe's Developer Center that covers the basics of getting started with FlexUnit. It is thorough and easy to read. This is probably the best starting off point that I have come across

Theo Hultberg has some valid critiques of the framework, as well as an alternative approach to the 'Temperature Conversion' example that is supplied with the FlexUnit distribution. I found this to be extremely helpful in deciphering FlexUnit and getting it up and running in my project.

Eric Feminella has created a simple API called TestUnitHelper that includes static methods to eliminate some of the tedium involved with creating unit tests with FlexUnit. There is some overlap with some of the points Theo touches on in terms of parsing test methods, but Eric's API is straight forward and gets the job done. Eric is a busy man, be sure to check out the trove of other useful APIs while you are there.

Daniel Rinehart gives a decent explanation of how to handle asynchronous calls in FlexUnit tests in the Flex Cookbook (beta). He also writes up another similar example over on his blog. I'm still not quite there with this concept, but these articles are a step in the right direction.

1/23/08 - I found this page with a huge repository of FlexUnit resources.