David Lee, SoftSource Consulting
Beyond the days when JavaScript changed minor facets of a web page, today’s JavaScript creates full featured web applications. Technologies such as JSON, JQuery and AJAX move the playing field from server side to client-side with much of this functionality now delivered via JavaScript.
Programmatically unit testing this client-side code gives us the assurance that it will not break. The challenge is to implement JavaScript unit testing while keeping it relevant when server-side, client-side or HTML changes are made, and while keeping test failures visible.
What does this mean for quality? If an organization has a unit testing strategy they will detect errors quicker and easier than organizations that do not. When JavaScript unit tests are written well with code coverage then changes will no longer require hours of manual testing. Removing even a small portion of manual testing can save time and money, giving a QA organization the ability to focus on what’s new rather than rehashing old tests.
SoftSource consulting has thought through how to implement JavaScript unit testing in a way that saves time, focusing on some of the drawbacks and positives of various approaches, and using custom development with the QUnit testing library.
David Lee, 2011 Technical Paper, Abstract, Paper, Slides, Notes