Another argument in favour of TDD

An interesting observation came up at work the other day, while we were discussing developer working habits. Say you’re adding a new feature to an application, that takes 2-3 days to develop. If you don’t write any unit tests, you have no way of knowing if any of your code works until you’ve finished everything, …

Running Mocha browser tests in TeamCity

Mocha is a great javascript testing framework that supports TeamCity out-of-the-box for testing node.js-based apps on your build server. Here’s a quick guide on how to get it running in TeamCity for browser-based apps as well. Configuring Mocha’s TeamCity reporter First we need to configure Mocha to emit specially formatted messages to console.log() that TeamCity …

Parallel vs serial javascript async tests

If you’re writing tests for a javascript web application, sooner or later you’ll need to be aware of whether you are using a parallel or serial test runner. Parallel Serial How it works Start all async tests at once and wait until they have all completed. Wait for each test to complete before starting the …

Yet another reason to love REST

There are a lot of reasons why you should love REST. It’s fast, simple, stateless, and easy to debug. This makes it absolutely fantastic to test against. REST APIs get you great end-to-end test coverage Line for line, an end-to-end system test covers a lot more code than a deep down class-level unit test. They …

Fragmented integration tests – aka the questionable value zone

In TDD, different styles of tests can be applied to cover different levels in your code base. Two or three years ago, if you asked me what they were, I would probably have listed them as: Highest granularity – unit tests, quick to run, drive low-level class design Fragmented – integration tests, testing higher-level components …

TestFixture attribute – just because R# doesn’t care, doesn’t mean you shouldn’t

Recently I noticed ReSharper’s built-in test runner doesn’t require you to decorate your fixtures as TestFixture — it’s smart enough to locate Test methods regardless. My team noticed this too, and as a result we’ve started to omit TestFixture entirely. Turns out this is a big mistake. NUnit itself requires them — in our case, …