Test Driven Development

I am very much attracted towards test driven development (TDD). A well made TDD makes sure that your code is solid and will pass the regression test. 30% to 40% project time can be saved using TDD.

JUnit philosophy is the key point here.

“At any point of time, when running a JUnit test code, always GREEN BAR should be displayed”

TDD process consists of

  • Write the test code
  • Run the test
  • Test will fail – RED
  • Now add the real code
  • Run the test
  • Test should pass – GREEN
  • Refactor the code.
  • Re-run the test code
  • Test code should pass – GREEN

Always use stubs and mock object in TDD. This helps for development in isolation and removes dependency on other modules for testing. TDD also makes integration easier.

Always try to follow interface depended development. Uphold the famous design principle “Program to interface and not to implementation”. This helps to replace stubs and mock objects during integration time.

This holds JUnit philosophy. The code will be cleaner and will always be working. Consider a project that is running for 1 year. If TDD is followed in such projects, it always make sure that none of the existing functionality is broken.


VTA Bus…

I love VTA ( Valley Transport Authority ) buses a lot… One day, on my way back to office, I took VTA bus no: 55. Time was around 7:00pm. I need get down at Remington so that I can walk to my home. The next major stop after Remington is Fairoaks, where apartments like Fairoaks West, Arbor Terrace are situated. Indian population is very high in these apartments.

When Remington was reached, the bus stopped and I got down. Then the bus started and then suddenly stopped. The driver came out of the bus and asked.. ” You looks to be an Indian. Lots of Indians stay at Fairoaks… Are you staying at Fairoaks. If so this is not the stop. Fairoaks is next stop…”. I was a lot surprised by the humbleness of the driver and said ” Thanks.. I stay near Remington”.. He said, “Good… Have a great evening”… I wished him back and thanked him for his concerns.

What touched me a lot was his concern for the travelers in the bus. Having stopped the bus, coming out and inquiring… A very good customer care and very humble… These activities brings a lot of good will… Hats off that driver….