Thursday, July 02, 2009

Sputnik, Google's New JavaScript Test Suite

Google engineers working on the Chrome web browser have announced a new open-source JavaScript testing and performance suite called Sputnik. The new test suite is intended to provide a comprehensive set of tests, more than 5,000 of them, and check compliance with the ECMA-262 JavaScript standard.

“The goal was to create a test suite based directly on the language spec that checked the behavior of every object, function and individual algorithm in the language. The task was given to a team in Russia – hence the name "Sputnik" – which went about systematically producing tests,” Christian Plesner Hansen, Google software engineer, writes. “Now that the test suite is complete we're happy to be able to release it as an open source project, under the BSD license. We hope Sputnik can be as useful to other implementers of JavaScript as it has been to us, particularly at a time where implementations change rapidly.”

The project was started soon after V8, Chrome's lightning-fast JavaScript engine, took shape and the development paralleled it. As the number of tests in the suite grew the team would test V8 to check if it complied or displayed unexpected behavior. Now that it is finalized Google is releasing it under the very liberal BSD open-source license.

Sputnik is built in python and to run it you need to install the environment so it might not be as user friendly as other JavaScript performance tests. However the suite is intended more for developers and focuses on compliance rather than pure performance measuring. With its goal of testing every function and object in the JavaScript language it could prove a valuable resource for browser developers aiming for standards compliance as well web developers trying to find out how various browsers differ in their implementations.