Paul Robertson's words, punctuated

Thoughts on development, user-centered design, code, etc. by Paul Robertson

Resources for getting started with FlexUnit

I’ve been finishing up migrating my XML-RPC client library to ActionScript 3.0. First task, according to my own recommendation: write more unit tests.

Even though the unit tests I wrote for the ActionScript 2.0 version of the library used ASUnit, this time around I decided to go with the “home team” (i.e. developed by Adobe employees) solution and try out FlexUnit. Fortunately, at least for the tests I had already written, the two systems are pretty similar, so I only had a few tweaks to make to migrate them. (Too bad there wasn’t any way for me to unit-test my unit tests, to make sure they worked the same across frameworks.)

Anyway, along the way I found a couple of resources that were very helpful in getting started, especially since the FlexUnit documentation is rather sketchy (only limited API reference docs available). These were the articles that helped the most:

  • Darron Schall: How to use FlexUnit with Flex Builder 2 (A great “getting started” article. This article was actually written while Flex Builder was still in public alpha, so it’s not perfectly accurate when describing Flex Builder’s dialog boxes – but it’s close enough that it was easy to figure out.)
  • Daniel Rinehart: Asynchronous Testing with FlexUnit (Naturally, it doesn’t take long with ActionScript 3.0 before you want to test something involving events…so you need to do some asynchronous tests. The docs are no help here, and the included examples are really convoluted. I don’t know how Daniel figured it out, but I found his article very helpful for getting going with asynchronous tests.)