Let’s Code: Test-Driven JavaScript

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

Watch Now

Advanced Episodes

  1. Testing Without Mocks

    Mon, 23 Apr ’18

    We end Let’s Code JavaScript with a look at how we avoided using mocks and other test doubles. Although test doubles are useful, they’re not without their problems. But we needed to write unit tests, not integration tests. How did we do it? It’s a tough problem, but we came up with a novel—and practical!—solution.

  2. Visual Testing

    Wed, 18 Apr ’18

    Some people say UIs can’t be tested, but our application is almost entirely UI. We needed to test it anyway. In this episode, we look at three ways we tested the visuals of our application: unit tests of the UI, unit tests of CSS, and integration tests of web fonts.

  3. Evolutionary Design

    Mon, 16 Apr ’18

    Evolutionary design is the process of designing your code to be as small and simple and perfect as you can for the needs you have today, then using refactoring make the design more sophisticated and able to handle more features as those needs arise. In this episode, we demonstrate evolutionary design by looking at the evolution of our client-side code.

Introductory Episodes

  1. Hat and Gown

    Fri, 12 Feb ’16

    Our series is complete! Where do you go from here? With the conclusion of this series, if you’ve done the exercises, you’re ready to act as a junior developer on a professional team. Now we talk about what it takes to graduate to the next stage of your career and provide some specific guidance about what to do to get there.

  2. Test Doubles

    Fri, 5 Feb ’16

    One of the most common testing techniques you’ll see in the wild is the use of test doubles, also known as “mocking.” We take a close look at this advanced technique. It’s seductive and easily abused. We rebuild one of our tests using mocks so you can understand the concept... and see what to avoid.

  3. Cohesion

    Fri, 29 Jan ’16

    Our application is done. It works. I’m not entirely happy with the design of our latest code, though. It lacks cohesion. In this episode, we wrap up our tab application with a look at three fundamental design forces: the DRY Principle, Decoupling, and Cohesion. We use what we learn to improve the cohesion of our application’s startup code.

An in-depth screencast about
Test-Driven JavaScript

You've taught me a lot this past year and have
been better than a teacher, a true mentor.
Jason Weden
I’m completely new to TDD and this is by far
the most comprehensive TDD for JS... your videos are
a breath of fresh air!
Adam Brodzinski
This is a gold mine... This will help a lot in my day job.
Timothy Myers
Love what you're doing. It's helped out our
team tremendously here at Sevenly.
Scott Corgan
I’m delighted with LCJ. It’s interesting and informative, and the
candid way you think aloud makes it personal and engaging.
You’ve done a terrific job.
Crispin Bennett

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 butt 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 15 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 test against multiple browsers and platforms, including iOS, and we use Node.js on the server.

All videos are DRM-free, available for streaming or download, and all source code is included.

The Videos

The series consists of three main channels. The “Recorded Live” channel focuses on real-world development, warts and all. It’s meant for experienced programmers.

If you’re a new developer, the “How To” channel is for you. It’s meant for beginners who have recently learned to program and are ready to start their professional career.

The “Lessons Learned” channel provides concise reviews of key topics, such as continuous integration, test-driven development, and build automation. It’s great for review and reference.

Release Schedule

The series’ final episode was published in April 2018. Although some of the specific tools and language features are out of date, the purpose of the videos is to show the thought process and design approach used in professional Agile development. That material is remains current and is well worth watching.

There are over 600 episodes available. Most are about 15 minutes long. Although the majority of the videos are intended for experienced practitioners, there’s about 10 hours of content just for beginners.

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.