Agile JavaScript Testing
*Excerpt
With the recent surge in JavaScript popularity, and the advances in JavaScript virtual machines, serious applications can and are being built in JavaScript. As the sophistication of these apps grow, so grows the need for verifying that our code continues to work as we expect. We'll briefly cover the advantages of test driven development, the reasons for pushing it all the way to the browser level, and then explore the options for testing JavaScript, look at some examples, and then integrate the tests into our existing development workflow.
Description
Intro
- Test Driven Development – What is it, why do it, what are the advantages?
- Challenges of web applications – browser quirks, asynchronous ajax, dynamic-ness of JavaScript language
- Future VMs will run JS faster, making “bigger”, more processing intensive apps possible within a browser
- Traditionally web applications have most business logic running server side.
- Testing for server-side web applications has matured over the past few years
- AJAX applications have large amounts of code executing in the browser in JavaScript
- This creates a growing need for testing at the browser level, but this area is still young and not as widely practiced
What do we gain?
- Stable development – iterate without fear of breaking existing features
- Easier refactoring – rewrite the guts of your app and be confident it continues to work
- Speed – stop refreshing and clicking through your app to verify things are working, thats what computers are for
- Automation – repeatable tests help you do the right thing every time, without having to think about it
Getting Started
- What libraries and methodologies exist for JavaScript testing?
- A simple example – a client-side form validation library and a suite of tests for verifying it works as expected
Going further
- A complex example – integration testing, scripting user stories
- Testing across multiple browsers
- Incorporating JS tests into a larger development workflow with server-side tests
- Continous integration – running tests automatically, every time you commit
Tags
javascript, testing, web, applications, agile, tdd
Speaker
-
- Website: http://synthesis.sbecker.net/
Biography
Scott currently writes code for WeoGeo (http://www.weogeo.com) helping to make geo-content more accessible via the web.
Scott founded the Tampa Florida Ruby Brigade (http://www.meetup.com/tampa-rb/), and co-founded the Portland JavaScript Admirer’s group (http://pdxjs.com/). He regularly attends tech events in Portland Oregon such as the Portland Ruby Brigade, WhereCamp PDX, and others. His contributions to open source include the widely used AssetPackager plugin for Ruby on Rails (http://synthesis.sbecker.net/pages/asset_packager) and contributions to the Portland tech calendar project, Calagator (http://calagator.org).
Scott currently lives in hot and sunny Portland Oregon. Before that he toiled away in cold and rainy Tampa, Florida.
In his other life Scott is a musician, having played many instruments in many bands back in Tampa and now in Portland.
Sessions
-
- Title: Agile JavaScript Testing
- Track: Cooking
- Room: St. Johns
- Time: 11:20am – 12:05pm
-
Excerpt:
With the recent surge in JavaScript popularity, and the advances in JavaScript virtual machines, serious applications can and are being built in JavaScript. As the sophistication of these apps grow, so grows the need for verifying that our code continues to work as we expect. We’ll briefly cover the advantages of test driven development, the reasons for pushing it all the way to the browser level, and then explore the options for testing JavaScript, look at some examples, and then integrate the tests into our existing development workflow.
- Speakers: Scott Becker