Let’s Code: Test-Driven JavaScript

James Shore presents a fascinating screencast
on rigorous, professional JavaScript development

Browse the Catalog

Latest Live Episodes

  1. Expectations and Actuals

    Wed, 28 Jan

    We’ve gotten our Selenium webfont test to run correctly. Now we just need to clean up the code and get the test to check expectations versus actuals. The biggest task is to get our list of stylesheet fonts to correspond to the font list we extracted from Typekit. It all goes smoothly.

  2. Origin Story

    Mon, 26 Jan

    Our Selenium webfont test is getting a SecurityError when it tries to read our Typekit stylesheet. It’s the result of Firefox’s same-origin policy. We look at the reasons for the error, ways of resolving it (including CORS), and implement a workaround.

  3. SecurityError

    Wed, 21 Jan

    Migrating our web-font test from PhantomJS to Selenium starts out smoothly enough. We take advantage of Selenium’s elegant wait() function to wait for our fonts to load, then migrate our font checking code from PhantomJS. Everything goes smoothly until we’re stopped short by a SecurityError. How can we fix it? I turn to the community for help.

Latest Specials

  1. Front-End Frameworks: AngularJS (Part III)

    Fri, 2 Jan

    We conclude our investigation into AngularJS’s impact on design and architecture. In this episode, we bring in our pre-existing persistence layer and use it to coordinate changes across our application. We also create a custom form field that uses domain-driven validation. Does AngularJS play well with our architecture? Should you use it? We render our verdict.

  2. Front-End Frameworks: AngularJS (Part II)

    Fri, 5 Dec

    We continue our exploration of AngularJS with a look at application design and architecture. Angular assumes simple models that live in “scope” objects. Our sample application, though, has a rich domain layer based on Ward Cunningham’s CHECKS pattern language. How well does Angular handle an approach that’s outside its comfort zone? We investigate.

  3. Front-End Frameworks: AngularJS (Part I)

    Fri, 7 Nov

    AngularJS is a hugely-popular framework for web applications from Google. It’s known for its two-way binding and automatic dependency injection. But does it live up to our standards of maintainability and long-term reliability? We take a close look in this three-part series. First: AngularJS fundamentals, including controllers, directives, modularity, and testing.

An in-depth screencast about
Test-Driven JavaScript

What our viewers are saying:
I will be using it as *the* goto reference for
any JS development for some time to come.
It has the right number of details that you don’t get by
reading book but only working with exceptional people.
I like the variety of technologies used and the
complete integration of them shown together.
I like seeing *all* aspects of the development:
the dead ends, the surprises, the wins, etc.
Quality is excellent, and I love that I can
download them and not have to stream them.

JavaScript Needs Test-Driven Development

If you’ve programmed in JavaScript, you know that it’s an… interesting… language. Don’t get me wrong: I love JavaScript. I love its first-class functions, the intensive VM competition among browser makers, and how it makes the web come alive. It definitely has its good parts.

It also has some not-so-good parts. Whether it’s browser DOMs, automatic semicolon insertion, or an object model with a split personality, everyone’s had some part of JavaScript bite them in the ass at some point. That’s why using test-driven development is so important.

What is Test-Driven Development?

Test-driven development (TDD) is a technique for ensuring that your code does what you think it does. It’s particularly relevant for JavaScript, with its cross-browser incompatibilities and hidden gotchas. With TDD, you express your intentions twice: once as a test, and once as production code. If the two approaches don’t match, your tests fail, and you’ve caught a bug.

TDD is a great way of catching the majority of programming errors. It’s not perfect, of course—in particular, it can’t tell you when your assumptions are wrong—but it’s very good at catching the kinds of bugs JavaScript is prone to.

Who am I?

I’m James Shore. I’ve been building applications using test-driven development and other Agile techniques for over 13 years. I’m a recipient of the Agile Alliance’s Gordon Pask Award for Contributions to Agile Practice and I wrote a book called The Art of Agile Development.

What You Get

This screencast series focuses on rigorous, professional web development. That means test-driven development, of course, and also techniques such as build automation, continuous integration, refactoring, and evolutionary design. We support multiple browsers and platforms, including iOS, and we use Node.js on the server. The testing tools we’re using include NodeUnit, Mocha, expect.js, Karma, and PhantomJS.

All videos are DRM-free, viewable on the web and downloadable, and all source code is included.

The “Live” Channel

The series consists of three main channels. “Recorded Live” episodes are a live recording of an application as it’s developed, with commentary. I edit out dead-ends and time spent in research so each episode is focused and meaningful. Each “Live” episode is about 15 minutes long and comes out twice per week, on Monday and Wednesday.

The application itself is a real-time multi-user drawing application, developed from scratch and continually enhanced in each episode.

Monthly Specials

In addition to the “Live” episodes, you also get a special “Lessons Learned” or “The Lab” episode every month.

“Lessons Learned” episodes are for people wanting a refresher, a quick reference, or who simply want to catch up. They provide a distilled look at a specific topic, such as automating Lint, testing a Node.js server, or automating cross-browser testing.

“The Lab” is about exploration and experimentation. These episodes examine topics that don’t fit into the other two channels.

I have learned so much more than I expected.
I really enjoy your approach to screencasting and
wish the series wouldn’t end some day.