Automated end-to-end tests are often seen as a necessary evil. A common example is Selenium-based browser tests. This kind of testing has many drawbacks: They take a long time to run They require complicated setup They are fragile But it doesn’t have to be like that! In this talk I describe how we can write… Read More

I gave a talk yesterday at Mile High Agile 2015: A lot of applications these days have a substantial, if not a major, part written in JavaScript. And not only for the front-end part, as Node.js is gaining popularity on the back-end. You might already have started doing some unit testing for your JavaScript code,… Read More

Introduction When starting a new front-end JavaScript project, we have a lot of decisions to make. The JavaScript ecosystem has grown explosively over the past couple of years with exciting new tools, libraries and frameworks appearing on a weekly basis. To illustrate, look at the TodoMVC site that showcases different MVC frameworks: 15 main frameworks… Read More

When writing unit tests for our front-end JavaScript code, we often need to specify fixtures: static pieces of data that give the context for the test. A fixture can be a piece of HTML that the JavaScript function under test can operate on. Or a piece of XML that we mock the server to return.… Read More

I gave a talk together with Rob Myers at the Mile High Agile conference in Denver the other day. Here is the appetizer: Test-Driven Development (TDD) and Continuous Integration (CI) are far more common for back-end projects than they are for front-end JavaScript projects. But front-end projects benefit just as much from the rapid feedback… Read More

On one of our projects we structure our front-end JavaScript code using RequireJS modules, ensuring predictable load ordering and better encapsulation. When writing unit tests for code that depends, directly or indirectly, on one or more other modules, we often want to mock some of those modules to make our unit tests more focused giving… Read More

When running our automated tests, we sometimes need a running web server. A back-end example is when we write (integration) tests against our web service end-points. A front-end example is when we use the text-plugin for RequireJS to load HTML templates ( We can have multiple build jobs running on our CI-server, which is useful… Read More

I recently gave a presentation at a meetup in Pleasanton, California on fast feedback. One of the cornerstones in Agile development is fast feedback. For engineering, “fast” means “instantly” or “in 5 minutes”, not “tomorrow” or “this week”. Your engineering practices should ensure that you can answer yes to most of the following questions: Do… Read More

I recently gave a presentation for a client on how to manage database changes in a large development organization with multiple database systems, multiple databases and multiple applications. I talked about how you can streamline your database changes by versioning your database instances and your database schema, running database instances locally and implementing database changes… Read More

Unit testing front-end JavaScript presents its own unique set of challenges. Yesterday we had another event in the Test Driven Developers Bay Area meetup group. At this event I presented a number of different techniques to tackle these challenges and make our JavaScript unit tests fast and robust using Jasmine (another version using QUnit). I… Read More