Archive For The “TDD” Category

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, […]

Read more »

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 […]

Read more »

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 […]

Read more »

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 […]

Read more »

Fast empty Raven DB sandbox databases for unit tests

Say you you have some NUnit/xUnit/Mspec tests that require a live Raven DB instance. Specifically: You do not want your test to be affected by any existing documents, so ideally the Raven DB database would be completely empty. Your test may span multiple document sessions, so doing it all within a single transaction and rolling […]

Read more »