views:

32

answers:

1

Hi,

I have a flex application written using PureMVC framework.Now,I want to write tests.We are using FlashBuilder 4.Is FlexUnit sufficient for testing? Are there any issues you have faced while writing tests?

A: 

I, personally, have had problems getting the Unit testing features of Flash Builder 4 to work. I ended up creating a separate AIR Project and creating Unit Tests in that using FlexUnit 1 (I believe the swc is 0.98 or something similar). I chose that version of FlexUnit because --at the time--documentation was very sparse on FlexUnit 4 and Flash Builder integration. I suspect things have changed on the documentation, and stability front, I have not gone back to that since Flash Builder was released.

Now, I'm not sure specifically how PureMVC works, so can't comment on specifics of unit testing with PureMVC. But, I have found that unit testing works great for model classes; which are often not framework specific. You should have no problem unit testing said classes.

I have found that unit testing is not beneficial for User Interface classes. For something like that an automation testing tool such RIATest or FlexMonkey are better suited.

Does that answer the question?

www.Flextras.com
true,model classes will be priority for testing,since they will have the core business logic.So,maybe I will tackle them first and then come to other parts.How did you do integration testing ie tests hitting the database.?We are using SQLite.
jess
Since Flex doesn't hit the database directly, I probably wouldn't use a Flex unit testing tool for database test hits. I would use a tool for the server language. I believe I used CFUnit for ColdFusion, but I'm sure options exist for all server side languages. If you wanted to test Flex calling the server side class and verifying the results; FlexUnit should work for that. It'd be easier if you're server side access code was encapsulated somehow.
www.Flextras.com