Automated Framework Testing
Filed under: Development, Testing
By Daniel Wagner @ August 26, 2009 13:54
It is said that "if your software is bug free, you're just not testing enough". With that in mind, we spent quite a bit of time during the last months on our internal testing infrastructure. Let's take a closer look at the results so far.
Since it was first mentioned in a blog post back in January, qooxdoo's automated testing setup has grown and matured quite a bit. As of this week, the testing infrastructure consists of 6 PCs running 4 different operating systems (Windows XP, Vista, OS X and Linux) with a total of 18 browsers, from IE6 all the way up to the latest devel version of Google Chrome. While not every conceivable combination of OS, browser and application is tested, each nightly test run consists of over 160 individual tests.
Test schedule
Each night all the framework applications are generated, unit tests are run and applications are subjected to simulated interaction tests. Additionally, the framework classes are scanned for missing documentation and checked for potentially problematic code by ecmalint.
A reduced number of tests is also run each Friday afternoon to make sure the week's devel versions of the demo apps are free of show stopping bugs.

Selenium running the Feedreader simulation
Software components
The backbone of the testing system is a test controller script, written in Python: Its first task is to update a local qooxdoo trunk checkout and to run the Generator commands necessary to build the framework applications, api reference and unit tests. Once the apps are ready, the test controller script proceeds to launch a sequence of simulated interaction tests (a.k.a. simulations), each of which logs any errors it encounters. Finally, the controller script aggregates the test results and generates HTML-formatted reports which are then emailed to the qooxdoo team members.
The simulations leverage Selenium RC, enhanced by the qooxdoo user extensions from the Simulator contribution. These add a number of locators and commands that are used in the simulation code to interact with a qooxdoo application and its widgets.
For example, the Feedreader test mimicks a user selecting a feed item, changing the application language and adding a new feed. After each step, the application is inspected to make sure the action had the expected result.
The Testrunner simulation, on the other hand, features very little simulated interaction: Unit test packages are run, and any test failures or errors are logged.
All Simulations are written in JavaScript and executed in Mozilla Rhino which provides access to the Selenium Java class.

HTML report of the API documentation test
Conclusion
Even though we've yet to further stabilize the infrastructure and to reach some of the loftier goals of Continuous Integration (such as building and testing (almost) continuously rather than just nightly), automated testing already helps us notice bugs faster and has taken at least some of the burden of testing in a wide variety of browsers off the core devs' shoulders. You certainly benefit from a more stable and higher-quality framework.

Comment by Stefan
It is great that you show your openness. The framework is though closed in the context of the company but pretty much open. Maybe you can allow more developers into contribution and then instead use more of your time in management of the bigger teams. Learn from MySQL!!!! They have a fantastic team all around the world. That way you gain much more of being just germanophilic. The framework becomes multicultural and in the end multi-lingual. Additionally, your limited ideas, they are always limited in a limited group, will expand a lot more in a better context where they can grow. This is a change I would like to see of one more reason: stability, whatever happens to any of you or the company you work for.
August 26, 2009 14:50
Comment by Andreas Ecker
Hi Stefan, thanks for the feedback, even if it’s quite harsh. I wonder why and where you think this open source project is lacking openness compared to any other major ajax framework, even being “germanophilic” (which is quite dissappointing to hear). That’d be interesting to know, since outside perception may indeed be something to work on. Independent of the fact that expectations usually are very high in being better here and there …
Are you aware of all the collaboration with and within the community, which in fact is quite diverse and from all around the world? I tried to figure out what personal experience you could have based your comments on so far, but couldn’t find any appearance of yours neither on the mailing list, in wiki nor bugzilla (at least not under your real name). Is there anything that kept you from joining and contributing to the project or community so far, besides your comment here?
August 26, 2009 16:57
Pingback by qooxdoo » News » The week in qooxdoo (2009-08-28)
[...] certainly saw the blog post about the efforts we make to continuously test the framework during development. This certainly pays off, resulting in a more stable, higher-quality code base. [...]
August 29, 2009 00:06
Comment by Stefan
Well, I am surprised of the reaction! My intention was to comment on a very crucial and important aspect in a positive way. There was no tone of any negativity or harshness and for that you have to respect it as it is. “Germanophilic” was only used here to show where the major interest lies and nothing else. Nevertheless, maybe some of my intention reached anyone of you receptive for it… Relax guys!!!!
I would also like to add about the automated testing framework, after testing the ideas about it, that it is very well done. And maybe it can become half-automated in the future and I would be very happy. Don’t you see any value in presenting the “compilation” and building results after each build on this site? I would certainly do, cause then I would get a clearer picture when using the trunk during my own development.
August 29, 2009 08:31
Comment by Andreas Ecker
Hi Stefan, I already sent you an email to get rid of some of the obvious misunderstandings. Unfortunately, the email just came back with your “mailbox unavailable”. It would be great you could email me at andreas DOT ecker AT 1und1 DOT de to get in touch, thanks.
August 31, 2009 13:51
Comment by Me, myself and I
CI … I don’t know. IMO, nightly builds are OK. I’m picturing a normal working day. You get to work, look at what the nightly build/test system sent you, do a short standup meeting, plan the work for the day, then get to work. Additional build/test results over the day just mess up you schedule, IMO.
I agree, it would be nice to have a parallel infrastructure, on which you can run personal builds/tests. You could work on a new issue while the personal build system builds and tests the issue you just resolved, before committing the just solved issue, so you make sure you don’t commit fresh bugs. But having only one CI system for all developers would not allow this sort of build, at least not with a reasonable setup.
Or am I wrong in my assumptions?
November 26, 2009 10:27
Pingback by qooxdoo » News » qooxdoo 1.0 released
[...] development team and an active open source community established a framework that is feature-rich, well-tested and [...]
December 20, 2009 13:04