An introduction to FlexUnit 4 and the explanation of why it exists

What it's all about?

FlexUnit 4 was created by Digital Primates to modernize testing with ActionScript 3.0 and Flex, bringing parity with the tools and techniques available to the Java community. It provides full support for unit testing in the tradition of FlexUnit .9 , but goes further with rich asynchronous support, meta-data defined testing, support for integration-level testing and an extensibility layer for new types and methods of testing.

Why not just use FlexUnit .9?

FlexUnit .9 is an excellent tool for creating unit tests for Flex in the JUnit 3.x style, but it lacks the more modern JUnit features such as Theories, Parameterized Tests and especially the definition of tests based on annotations or metadata rather than class extension. Further support for asynchronous testing was too limited to handle the rich event infrastructure and inherent multi-frame asynchronous calls present when trying to test UI component in Flex. Lastly, FlexUnit 4 actually contains FlexUnit .9 as one of the many test runners available to the developer. Should you still want to run your FlexUnit .9 tests or code in the JUnit 3.x style, you are welcomed to do so inside of the FlexUnit 4 framework.

Why not use Fluint 1?

Fluint is a tool originally written to address the asynchronous needs of the component lifecycle when testing Flex components. While fluint contained a full unit testing framework, its strengths were its ability to provide integration testing absent from the other testing frameworks available. Much like FlexUnit .9, the fluint framework is included as a runner inside of FlexUnit 4, so you can still continue to run your fluint tests unaltered or use the unique features of fluint inside of FlexUnit 4.

Where do I get the code for FlexUnit 4?

Release versions of the FlexUnit 4 framework are available from the flexunit.org downloads page or from the opensource.adobe.com downloads page . Both of these places will always have stable releases for you to download, however, flexunit.org will also have nightly builds and unreleased source code available should you wish to work with those versions. In general, the http://opensource.adobe.com site and SVN repository will only have milestone and release builds, while active development will happen from flexunit.org and Git.

Take a look at the following pages to learn more about this project:

And then... The project still needs a lot of additional documentation as this just scratches the surface of testing. Our intent is to help maintain this project and site but also to gain community involvement to flesh out the edges and propose features that will make this a great way to test. So, please, get the source and start playing.

Next

  • No labels