Latest Updates: Test Driven Development RSS

  • The beauty of small tests

    Andrew Darnell 12:53 pm on 15th April, 2010 | 0 Permalink | Reply
    Tags: , , , , Test Driven Development,

    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 expectation, but fundamentally, it pin-points the cause of the failure to a small target, which usually means that debugging becomes trivial.

    When an end to end acceptance test fails, the failure could be due to any one of a large number of source lines or expectations changes across a large body of code.  Debugging may be quick, but often isn’t.

    (More …)

     
  • Agile – Tests = Fragile

    Andrew Darnell 3:55 pm on 9th April, 2010 | 0 Permalink | Reply
    Tags: , , , Test Driven Development, ,

    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, categorically will fail!

    There are two sets of tests that are critical here…

    Good unit test coverage and a TDD approach to development ensure that the rest of the organisation is supplied with product that works as developers expect it to.

    Component tests and functional acceptance tests ensure that the product does what the product owner expects it to.

    • Practically, the only way to do solid testing on new features is to have a stable product.
    • Practically, the only way to assure a stable product is to either have solid regression testing on each release or to not make any changes.
    • Practically, the only way to make sure that adequate regression testing is done is to automate the regression tests (unit, component, functional).

    Without these tests in place, iterating quickly places an impossible to meet burden of verification demand on the testers and product owners, which just gives you a fragile process not an agile one.

    Is your process Agile or Fragile?

     
  • Tech Talk - Behaviour Driven Development

    Ian Alderson 11:37 am on 18th March, 2010 | 0 Permalink | Reply
    Tags: Behaviour Driven Development, , Tech Talk, Test 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 find myself doing today. I have been following the principles of Test Driven Development (TDD) for many years now, however this is the first time I have really delved into Behaviour Driven Development (BDD). I would thoroughly recommend watching the video if you have 45 minutes to spare, however, if not, I have summarised the notes I took whilst watching it below.

    (More …)

     
  • Pitfalls of Exception expectations in JsUnit

    Ian Alderson 12:00 pm on 29th January, 2010 | 2 Permalink | Reply
    Tags: , JsCoverage, , , Test Driven Development,

    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 written using plain old JsUnit assertions.

    One of the main reasons we were keen to adopt JsUnit five years ago was its similarity to JUnit 3. Back then our developers had been using JUnit for a few years, and familiarity of the JsUnit API meant that we could immediately start writing tests. Unfortunately the old adage “familiarity breeds contempt” reared its ugly head, and we discovered that our main issue with JsUnit were the occasional, very subtle, differences between it and JUnit. The logic for a test that works in JUnit might not work in JsUnit.
    (More …)

     
  • How to dynamically create a class definition for use with Mock4JS

    Phil Leggetter 6:00 pm on 16th April, 2009 | 1 Permalink | Reply
    Tags: , , , , , Test Driven Development,

    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 to them.

    (More …)

    Related Posts with Thumbnails