Filed Under (Flex, FlexMonkey) by jonr on December-6-2009

What is FlexMonkey?

FlexMonkey is an open source Adobe AIR application used for testing Flex and AIR applications.  It provides the functionality to record, playback, and verify Flex UI interactions.  It also generates ActionScript / fluint tests that you can easily include within a continuous integration environment.

Who is FlexMonkey for?

Like many in the Flex community, we came to Flex development after many years of developing traditional web applications, where there are multiple tools that allow a developer to simulate a UI client for testing (like HTMLUnit).  For testing our Flex user interfaces, we had a strong desire to continue using this paradigm for our developer level testing.

As software consultants, ensuring quality is an important part of what we do.  So, we created FlexMonkey to fill the gap between a unit test and what’s really needed to ensure quality (and protect against regression) when developing user interfaces.  While we initially created FlexMonkey for developers, many in the FlexMonkey community have found it just as valuable for use in creating QA / Functional tests.

So, we believe that FlexMonkey is useful to both software developers and quality control engineers on Flex development projects.

So, what’s so game changing about it?

If you ask Mike Labriola (one of the Fluint/FlexUnit 4 guys), ‘How do I unit test my Flex user interfaces?’  He will quickly respond, ‘You don’t.’  He won’t tell you this because he doesn’t believe in unit testing (as I can assure you that he strongly believes in Unit Testing), but because there are parts of a user interface that cannot be sufficiently tested with unit tests.

So, as we jump into the reasons why FlexMonkey matters for you, I’ll note that we do not believe that FlexMonkey replaces the need for traditional unit tests.  There are still parts of a Flex application that are best tested this way (e.g. service clients, business logic, etc.).  If you are building a framework, it’s likely that the majority of your testing will be done through unit tests, but if you are focusing on features and functionality you will likely be able to achieve upwards of 80% of your testing goals with FlexMonkey.  Nevertheless, here are the high level places where FlexMonkey changes the game:

  1. FlexMonkey fills the gap left between unit testing and a truly successful test suite,  as it provides a tool for doing developer level functional tests that replace traditional unit testing activities that developers perform in other tiers of application development.
  2. FlexMonkey allows developers to write their user interface code in the most natural way. Typically, when developing a user interface application without a tool to simulate a client of the running application, the code has to be written differently to support testing.  This often leads to many unnatural acts, which can be avoided when using FlexMonkey.

    For the Java folks, I like to bring up the SpringFramework here, as it provides us with a powerful example of a framework that largely succeeded because it allows developers to write their code in a natural way.  Over the long run, the frameworks and tools that make it possible for developers to work in the most natural way will always win out.

    Tools like FlexMonkey are able to facilitate this simply through the paradigm they provide for testing user interfaces, as they allow developers to test applications without any knowledge of the underlying code.

  3. Cost. FlexMonkey is free.  So, even though it’s not a perfect tool, it does enable one to build and deploy a successful test suite, a task that is extremely difficult and costly in Flex development without FlexMonkey.

You can find the FlexMonkey project at: http://flexmonkey.gorillalogic.com/

FlexMonkey is built and open-sourced by Gorilla Logic, Inc.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • DZone
  • Digg
  • del.icio.us
  • Reddit
  • Facebook
  • LinkedIn

Comments:
Michael Labriola on December 11th, 2009 at 3:34 pm #

I do strongly believe in unit testing. I also strongly believe that tools like FlexMonkey are crucial to the testing lifecycle and help legitimize serious application development on the Flash platform. It’s a great tool.

Tom on December 21st, 2009 at 7:22 pm #

Can FlexMonkey be used when SWF is hosted inside a web app? Seems like I have to open a SWF instead of a URL , like I can to debug via Flash builder). What happens if the SWF requires a logged in session and lives inside a page that is responsible for generating the tag. I’ve used FunFx in past to automate this process but because that project seems dead I’ve been looking for alternatives

Stan Berka on January 21st, 2010 at 6:39 pm #

Yes, FlexMonkey fills a gap and it allows to nicely test Flex application UI, *BUT* only if it supports Flex 4. We’re starting a new project and we decided to go with the Flex 4 and Flash Builder 4. Will we be able to use FlexMonkey for functional tests in a month or two? That is the question.

jonr on January 22nd, 2010 at 8:14 am #

FlexMonkey uses the Automation API provided by Adobe. I don’t think they have published a schedule for when this will be available for Flex 4 yet. Hopefully, they will have it ready to go before Flex 4 is out of beta and officially ready for production use. Once that is out there, you should see Flex 4 support added to FlexMonkey fairly quickly. It’s probably worth letting Adobe that the community see this as a priority (i.e. blog, tweet, files bugs, etc).

Post a comment
Name: 
Email: 
URL: 
Comments: