If you’re building a web application today, JavaScript is one of the most important foundations on which your application is built. There are a lot of libraries available to help you rapidly and easily use JavaScript to great effect. Testing that code, well, that’s a different matter.
Java has JUnit. Ruby has Test::Unit and RSpec. Python has unittest and Nose.
JavaScript has a number of unit test frameworks as well, but they see far less use than those seen in other languages. What JavaScript doesn’t have is an environment that makes it easy for a developer to write and run their tests without breaking their train of thought.
In Java you run Eclipse or ant. In Ruby you run rake or autotest. In python you run python or nose.
In JavaScript, you write your code, create an HTML fixture page to test that code, load that page in browser, click a few times, and look to see if the result looks right. Then you switch back to your editor, modify your code, bring the browser up again, hit browser refresh, click, look …
Or, more likely, you don’t. At least not very often.
And if you do run tests, you only run the tests you think you broke, rather than the ones you actually did break.
Much of this is because in JavaScript it has been harder to run tests than it has been to write them.
It’s now possible to do much better than edit/refresh/look/repeat. Borrowing heavily from best practices in other languages, it’s now possible to make JavaScript unit testing as easy as in, say, Ruby:
In this talk we’ll walk through the process of developing/modifying a JavaScript browser-based application in a test-first manner, showing how every step can be automated for immediate feedback to the developer.
Highlights:
Steven Parkes is an independent software developer in Palo Alto, California. He has been involved in concurrent object oriented programming for many years. He currently specializes in highly-reliable and asynchronous web development.
For information on exhibition and sponsorship opportunities at the conference, contact Sharon Cordesse at scordesse@oreilly.com
Download the OSCON Sponsor/Exhibitor Prospectus
Download the Media & Promotional Partner Brochure (PDF) for information on trade opportunities with O'Reilly conferences or contact mediapartners@ oreilly.com
For media-related inquiries, contact Maureen Jennings at maureen@oreilly.com
To stay abreast of conference news and to receive email notification when registration opens, please sign up for the OSCON Newsletter (login required)
Have an idea for OSCON to share? oscon-idea@oreilly.com
View a complete list of OSCON contacts