« Jini and JavaSpaces | Main | Infiniflow »

October 25, 2005

TDD in the world of Grid Computing

Well it has been about seven months since my last post! I never have been much good at keeping up appearances.


A question i have been asked a lot over the past 9 months: How do you do TDD in the world of Grid Computing

The answer is simple: The same way you do it in the non Grid Computing world!

The way I do TDD is to push away external systems, libraries, components etc, by wrapping them with Interfaces. This gives me the abilitity to Test/Design the behaviour of an application without external dependencies having too much influence on the overall design.
With Unit level tests I can then substitute the Interface to the external system (Grid in this case) with a Mock or Stub implementation. This provides a number of advantages:

  • I can run all of the unit tests without having to deploy/run a grid etc.
  • The tests run very quickly, fail fast, as they do not depend on potentially slow external systems such as databases etc.
  • Most of the code can run anywhere, it does not have to run on a Grid.
  • ...

Of course this approach doesn't cover case where you really want to know that it works when everything is plumbed together. That is what Functional tests are for.

Functional tests should test from top to bottom with real dependencies plumbed in. Further, they should run as a seperate stage in your build pipeline so they don't slow down the feedback loop. Slow feedback == frustrated developers == lower moral == short cuts == a mess!

So the moral of the story: TDD on a grid application is no different to TDD in any application. Fail fast and be happy!

Posted by Damian at October 25, 2005 09:54 AM

Comments

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?