Let’s Code: Test-Driven JavaScript

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

Browse the Catalog

Latest Live Episodes

  1. Rounded Corners

    Mon, 1 Sep

    Our button needs rounded corners. This seems like it should be easy to test-drive, but some browsers won’t give us the computed style for “border-radius”, the property used to implement rounded corners. Fortunately, it’s easy to fix. We finish up the corners and move on with a spike of the button’s drop shadow.

  2. Rounding Errors

    Wed, 27 Aug

    Our CSS tests have been failing due to rounding errors. In this episode, we try to solve the problem once and for all. We take a careful look at our centering test, how different browsers handle rounding, and even the effects of the browser’s zoom level. By the end of the episode, it’s all cleaned up and we’re ready to move on.

  3. T̶he ͘center̨ c̕ann͞o͞t̀ ͘h̛o͠ld̛

    Mon, 25 Aug

    It all started out fine. We needed set the width on our “Join Us” button, and we take advantage of the opportunity to refactor some of our CSS test code. The real problem com͜es with the ceǹt̕ering te̛st. Safari has a rounding i̧s̛s͟u͟e, and our attempts to f̡ix̧ it just m͘akes ̷t͏hings s̶t́e̸a̧di̸ĺy ̧wo̵r̀s̵ȩ…

Latest Specials

  1. Front-End Frameworks: React (Part I)

    Fri, 1 Aug

    React is the hot new library for building user interfaces from Facebook. It boasts an innovative virtual DOM and bucks the trend by eschewing templates. How well does it work for real-world apps? We dive deep with a two-part series. In this first episode, we get React up and running and look at the fundamentals of automation, modularity, and testing.

  2. Legacy Code Part IV: Unit Tests

    Fri, 6 June

    The conclusion of our four-part legacy code series! We’re ready to put unit tests in place for Intro.js, our real-world legacy code example. We extract our scrolling function into its own module, install Karma, and implement honest-to-goodness cross-browser unit tests around it. Challenge completed!

  3. Legacy Code Part III: Refactoring

    Fri, 2 May

    Our massive legacy code series continues! With pinning tests in place, we can safely change our legacy Intro.js code. We need to do two things: figure out how the showElement() function works and set the stage for introducing unit tests. To do that, we’ll factor showElement() into its component pieces.

A brand-new 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.