Testable JavaScript

Grand Ballroom - Salon F

Testable JavaScript is a process. Whether starting with a blank slate or an already implemented application (or somewhere in-between) being able to test your JavaScript code simply, cleanly, and effectively is a necessary feature. Code that cannot be tested will be rewritten.

While JavaScript is unique due to the myriad of environments within which it runs, there are several tried and true ‘testable’ methodologies from other languages which also hold true for JavaScript. And of course there remain the unique challenges that JavaScript developers must face while writing and testing their code.
What patterns make code testable? Which anti-patterns hinder testing? What metrics and common sense guideposts can be used to measure the testability of our code? Once the process of creating testable code has started now what?

Join me to break down the process of writing testable JavaScript. We will investigate ideas, patterns, and methodologies that greatly increase the testability, and hence the maintainability, correctness, and longevity of your code. Whether you write client- or server-side JavaScript mastering this process will greatly enhance the quality of your code.

Mark Trostler's picture
I have been writing and testing code for over 20 years. From humble beginnings as a Computer Science/Philosophy double major at UC San Diego, to working at both startups (IPivot) and large corporations (Qualcomm, Intel, Redback Networks, Juniper Networks, Yahoo, and currently Google), I have always been dedicated to code quality. Previously as a Senior Principal Front End Engineer on the Yahoo Mail team, I help spearhead testing and quality for the latest rewrite of Yahoo Mail. I'm currently employed by Google as a Software Engineer in Test with the Ads team helping to ensure an excellent experience for our customers. I have spoken at several internal and external conferences (Yahoo TechPulse 2010 and 2011, Yahoo's Front End Summit, and at YUIConf 2011) about Testable Javascript and am the author of the Open Source Javascript Unit Test Environment (https://github.com/zzo/JUTE).