Archive of Test Driven Development
The beauty of small tests
When tests are small, a test failure means just one thing – somewhere in these ten lines of code which are being tested, there is an error. Ok, sometimes this can mean that there is an error in the test script, or a there is a failure, or change of…
Read MoreAgile – Tests = Fragile
The nature of agile projects, with lots of small releases mean that there are a lot of test runs to execute if you want to have any confidence in the code and the product. Ignoring this testing just generates projects which will fail – not may fail – will fail,…
Read MoreTech Talk – Behaviour Driven Development
Last week several of my colleagues and I watched a Google Tech Talk on Beyond Test Driven Development: Behaviour Driven Development, presented by Dave Astels way back in March 2006. Although four years can seem like an eternity within software development, I found this video extremely pertinent to what I…
Read MorePitfalls of Exception expectations in JsUnit
At Caplin we use the JsUnit framework to test our JavaScript code. Over time we have made minor modifications to it, integrating Mock4JS and JSCoverage, as well as adding a few of our own extensions that are sympathetic to our JavaScript coding style, however, by and large, our tests are…
Read MoreHow to dynamically create a class definition for use with Mock4JS
Mock4JS is a really useful unit testing helper library that allows you to create mocks of your JavaScript classes. What it doesn’t presently support is mocking of objects that you can’t create an instance of yourself using new Class() or of objects that are dynamically created and have functions appended…
Read More