Tuesday, September 16, 2008

Re-Developing an Application using TDD against an Establised API

The last few months have provided an interesting experiment to test our application testing. For several reasons that I won't go into, we decided to rebuild one of our web services, and we made the decision to try and keep as many of the tests we had as possible. We found out quite quickly that moving unit tests to a new project when you're redesigning a system just isn't feasible. Our unit tests were too tightly tied to the design (well, that's the point of test driven design right?). However, our acceptance tests which tests our API as a black box was a perfect candidate to measure our progress.

It turned out to be more useful then we'd realised. When you have working black box tests, you can do whatever you want to the internals of the application as you already have appropriate tests to validate the application. This is exactly what we did.

We could happily start turning on our acceptance tests as and when we felt a feature was implemented. By insisting that we should not change these tests, it gives a an excellent benchmark for completeness. Of course, this is quite a rare occurrence, but it goes to show that if you test at different layers of your application and regard APIs or interfaces as unchangeable, you can re-implement to your hearts content.

Wednesday, September 10, 2008

Convergence, Divergence, Convience and Quality

When I got my first job, I was really keen to get a great stereo. At the time the thinking was that to get quality music playback, hi-fi separates ware the way forward. Each component was stand alone, loosely joined by standard interconnects (phono, coaxial or fibre optics), and was easily replaced, upgraded or repaired without affecting the rest of the product. This was opposed to a hi-fi that when, say the CD player breaks, you need to replace the whole damm thing.

Now the trend is convergence, as Dr. Pep mentions, I have been tempting him, and myself, into buying an iPhone. The obvious comparison is the iPhone is convergence personified. It's a mobile phone, a 3G device, it's wifi enabled, a MP3 player, a GPS receiver and a pseudo computer that fits in your pocket.

What happens if one of those features breaks, or you need to change the battery? Well, it seems your in trouble. But that's the price for convenience. The alternative is a mobile phone (with or without 3G access), a laptop with wifi and a 3G dongle, a MP3 player and a GPS receiver. You can of course get other devices than the iPhone that do many of these things, but let's face it, they not an iPhone.

So here's the dilemma, I want to upgrade/get new features like GPS and 3G access. But I already have an iPod, a mobile phone and a wifi enabled laptop. If I were to buy the iPhone, do I throw this all away? If so, it becomes an expensive upgrade.

Does it follow that, more convergence means less devices, means more time on a single device, means wearing that divice out sooner, means expensive upgrades more often? How does having one be and end all device affect my battery life, I don't want to be have to plug something in every four hours.