|
From: Luke B. <lb...@pa...> - 2007-10-27 01:29:07
|
Hey Bop, Like most everything else, mocks are kind of a big subject, and well, "it depends." If you're trying to write tests that verify behavior that is defined in a code behind that is associated with (and depends on) those symbols, I'm not sure how well mocks would help. If you have separated out your application logic in such a way that the symbols are truly just basic MovieClips with some assets in them, you should definitely be able to use any old MovieClip instance in their place. If you do have this kind of separation, you should consider using Flex Builder or MXMLC as your compiler, and then your FLA file will *only* have symbols in it, and your development environment will better support your efforts. Here is some info on how that might be done: http://www.bit-101.com/blog/?p=853 I can tell you with confidence that writing code in Flex Builder is unbelievably more enjoyable than it ever will be with Flash Authoring. of course, the trade off comes in when you want to start creating simple, quick, time line-driven animations. You can still do this, but you have to write code to control them. Folks may not know this, but Flex Builder is perfectly appropriate for ActionScript only projects - you don't *have* to use the Flex Framework in order to get the benefits of Flex Builder. You wouldn't believe the kind of haggling Ali and I had to get into with marketing/product folks over at Macromedia about including this very feature! In closing, yes - mocks could be helpful, so long as you're not mocking the very features that you want to test! Luke Bayes http://www.asserttrue.com PS: Here's a good article about the differences between testing 'behavior' and testing 'state' http://martinfowler.com/articles/mocksArentStubs.html |