Test Swarm of the use of JavaScript for integration testing


Dionysios G. Synodinos translator author Zhang Published in at 12:09 on April 1, 2009

Community
Ruby,
. NET,
Java
Topics
RIA,
JavaScript
Tags
jQuery,
Continuous Integration

jQuery JavaScript Library Founder John Resig released Test Swarm , The platform for distributed client-side JavaScript continuous integration testing. JavaScript because of the traditional test environment (not expansion) are deeply disappointed, John's new project (currently in alpha version or private) aimed at a large number of developers and communities to provide a test of the system browser.

As John mentioned, In a variety of browser jQuery very difficult test :

We strive to jQuery at all major projects to support the current version of the browser, the latest release and the upcoming release of a daily build version / beta version (in accordance with our customers to upgrade your browser to support the frequency of these standards a number of balance - Safari and Opera users to upgrade a very high frequency).

At time of publication of this article contains a total of 12 browser.
  • Internet Explorer 6,7,8. (Not including 8 7 mode)
  • Firefox 2,3 and a daily build version of
  • Safari 3.2,4
  • Opera 9.6,10
  • Chrome 1,2

Of course, this is only on Windows platform, and does not include the OS X and Linux. JQuery project for us to take a sensible strategy, usually only on a test platform, but under ideal circumstances required test on all platforms in Firefox, Safari and Opera (all three are cross-platform browser). Finally the results are presented before and after every time we have to separate at 12 browser 10 running on an independent test suite. Cross-browser JavaScript is not enough to test scalability.

If the test required to interact with users, it is even for any large-scale use of jQuery's Web applications JavaScript is a dreadful thing.

Some test suite (such as Yahoo UI, jQuery UI, and Selenium) can automate user interaction (like you can write "click the button" This kind of test). In most cases this will satisfy our requirements, but all these only the actual user interaction are a simulation. Nothing can make things run a number of easy to reproduce by hand (and verifiable) mentioned in the same breath test.

This is the biggest scalability problem. With automated test suite you want to run the test multiplied by the number of hand at 12 months to run a browser test 100 is a fairy tale. Must have a better way, because it is clear: cross-browser's JavaScript is not enough to test scalability.

As Selenium Grid Such a solution There is some limit :

  • As far as I know, Selenium Grid required to run tests using Selenium. Which there is no mainstream JavaScript library using Selenium (not a small price to do so).
  • It can not test the non-desktop machine. Each server must be running a background process to deal with many tasks, such mobile devices on the point of death.
  • Unknown it can not test the browser. Browser are required for each special Selenium callback code to allow the browser to load, so Unknown browser (Such as IE 8, Opera 10, Firefox Nightly and Chrome) may not be able to run.
  • Above all: Selenium Grid with large machines require you to run tests, this is not very feasible, especially in the development of distributed under open source, especially JavaScript. Therefore, we need more effective solutions.

John proposed solutions Test Swarm of JavaScript-based client, the client will be continuously connected to the central server to run the test request. Server test suite to collect and send it to their clients on:

The following is my idea of the work of the Test Swarm by: open-source JavaScript library will be submitted to the test suite on a central server, while users will also be involved. Library users at the necessary day-to-day work of two additional browser window open to support our work, so that they feel are involved in the project (in fact, is one such!).

Libraries can also be sent to the user manual test. The arrival of a new manual test will be notified when the user (through the voice prompts?), So that they can be quickly implemented.

Assist users of these are not free: we can take part in the most positive statistics on users, and then carried out several awards before (T-shirt, cup, book, etc.).

InfoQ to contact to learn more about John Resig related information.

InfoQ: Test Swarm protocol based on what?

MIT-based protocol (server-side using PHP and MySQL, client are some simple JavaScript).

InfoQ: In addition to outside the framework of the owner, do you think it is what the value of other organizations?

I think that other organizations and vendors to benefit. The following is my idea of the growth plan:
  • First of all, open to the mainstream JavaScript library (they had better set up a test suite and test system).
  • Next open the JavaScript to the other open source projects.
  • Then open to other organizations, as long as these organizations allow anonymous users to run their tests on the line.
Of course, through these steps, any organization can easily download server software and run their own swarm examples - the need for a major test of the Test Swarm server.

In the first statement, John also referred to Test Swarm of the "corporate" version of :

Test Swarm of the "corporate" version has aroused the interest of a lot of people. What is yet to plan (except in the form of open-source release of the software), I'd want to leave space for future expansion (perhaps the user manual will get some compensation test - the test is like JavaScript as Mechanical Turk -- - I do not know, but its growth is determined by a lot of space).

If interested can Test Swarm Obtained from the alpha version of its .

Also available through the on InfoQ JavaScript , jQuery , Rich Internet applications And Continuous Integration Channel for more information.

See the original English text of: Crowdsourcing JavaScript Integration Testing with Test Swarm