Saturday, April 08, 2006

Tests !


checking in tests :-)

Finally got tests for all parts of the application now. I was not testing the controllers directly as info from the client was being sent to the server using JSON objects and I was not sure how I was going to test this. Just got this working B-)

Must say its much much better when you can implement a feature completely using tests before you even hit the UI. And as a 'side effect' you have the tests which will tell you when you break something by mistake.

Till Rajesh pointed out, I was building the application UI downwards. For example, saving of a route, I got the UI aspects (the markers, the Lightbox) working first and then put in the code for the actual saving on the server.

... a small change in thought ...

and this has changed our approach to building the application backend upwards.

Wanted to introduce the concept of a Road into the app. I wanted the ability to save info on the 'road' between two markers. So started from the server side. Got tests which checked for how Road objects were saved and brought up and their relationships (unit tests). Then started on what information the server would expect from users when they save a road and wrote tests around the saving of roads with that information (functional tests). Still no UI. But the feature is in place. Now just need to write up the UI and the whole thing plugs into place.

Beautiful

Thursday, April 06, 2006

Its the best feeling

... when someone from your office comes up to you and says that they too want to cycle to work and make some enquiries about where they can get a good cycle.

Writing tests for Biketowork.info

Development on this site had come to a complete standstill. Sigh!

After a small chat with The Learning Journey man, and after all those fiascos trying to get stuff to work on the server decided to go ahead and TDD BikeToWork.info

So yesterday was spent in writing Unit tests for all the models that were being used for the site. And today was spent trying to get the existing UI stuff to fit on the sparking new models :D

That took some time, but looks ok now I guess.