Why roll your own test framework?
In a comment, Luke Bayes asked a question about Buzzword’s automated test framework that I thought I should answer a little more prominently.
Why did we roll our own test framework? Well, one point from Daniel R.’s notes that I’d like to underscore is that we also use FlexUnit extensively to test the Buzzword code that is most amenable to API-style testing. For example, the Document model, which is all about manipulating objects in a tree, is covered pretty well with FlexUnit tests.
But we did build an entirely separate test framework in addition to FlexUnit, and it was a lot of work, so it’s worth explaining more about what we got out of it. More than anything else, what we got out of that work was a test framework that was tightly integrated into Buzzword. This integration allowed us to build features like an interactive test recorder that generates tests as you operate Buzzword, and a step-debugger than lets you step through a recorded test one step at a time to make sure it’s working correctly, while watching the document commands being executed on an open document.
I should add that tight integration between the test framework and the application is not always desirable. In fact, frameworks like FlexUnit are deliberately designed to be more loosely coupled, testing primarily at the API level. This is quite important, but it’s even better to use multiple testing strategies that leverage both tightly coupled and loosely coupled frameworks.
The other question Luke asked was about the pros and cons of relying on ActiveX to support reading and writing local files as part of the test framework, particularly if it prevented running tests against a production environment. This is probably a good time to mention that the primary design goal for our automated test framework was to allow developers to work on a complex shared codebase and verify the correctness of the internal models of the application as we make changes to code. In other words, it was designed to keep us from breaking each others’ code. Because this test framework really only tests the internal models of Buzzword, it is isolated from external environmental factors like OS, browser, or server environment.
One potential disadvantage of this approach is that it means that developers can’t run tests in a Mac development environment. In practice this has not been a major practical issue for us. Most of our developers work under Windows most of the time, and virtually all of our Mac bugs are browser-related. Running these tests isn’t necessary or helpful under the Mac anyway — as with running our tests against a production environment, it wouldn’t provide any new information.
At this point, you’re probably asking yourself: if this test framework doesn’t test browser-related issues, then how do these guys test against all the different browsers they support. Good question, and one for another post.




Hey David,
Thanks for the detailed response!
Automated testing for GUI applications has a lot of room for improvement, so I’m always excited to see smart people experimenting with new approaches.
Most of the books and essays I’ve read on the subject recommend the Humble Dialog Box pattern, which is certainly a useful and important direction, but never seems to go far enough when an application reaches that critical point of complexity. This is the point at which failures seem to be related to timing and wiring. Many of the authors I’ve read just kind of cop-out with unhelpful statements like, “Testing GUIs is hard,” or “Record and Playback tools are brittle.”
I do have to confess to a strong bias against the platform constraints imposed by Active-X.
In my experience, whenever there has been consensus around constraining a deployment or tool to one particular platform or another, an urgent need to support the previously-excluded platform(s) inevitably arises. I have found this to be true with operating systems, IDEs and browsers.
Active-X seems especially concerning given the (perceived?) market failures of Vista and increased share of the development community that OS X has taken.
In spite of those concerns, I’d love to see more detailed information about your solution!
Thanks so much for sharing and I’m looking forward to that cross-browser testing post.
By the way, we only use ActiveX as a hack to write out local files, since the Flash Player can’t do that. We’re in the process of porting that part of the test framework to AIR so that we can use AIR’s local file support instead.
I’m throwing in a vote to hear more about both the cross browser testing support and any details you have to share about the implementation of the integrated testing. This testing area seems to have plenty of room for refinement and it’s great to see a discussion on it. Thanks again!
I was able to get Selenium running with Flex. This is integrated with Maven to run on our CI server TeamCity.
Maybe the blog post is interesting for you:
http://www.agimatec.de/blog/2008/11/selenium-flex-tests-with-maven