Tuesday, December 9, 2008

Debugging Vs Unit Testing

We developers need to win this battle. Ofcource I am on the Unit Testing side and thatz the reason for this battle. We want to improve. We want to stop debugging, or we may call it post coding or post delivery nightmare.

  • How may of us are fond of SOPs? [System.out.println]
  • How many of us are good a putting / reading log files?
  • How many of us are good at using the debugger? Looking up the values inside objects at runtime?

We all are. Because thatz what we do most often. The percentage of time we
spend on debugging is far more than coding.

Every programmer knows they should write tests for their code. Few do. The universal response to "Why not?" is "I'm in too much of a hurry." This quickly becomes a vicious cycle- the more pressure you feel, the fewer tests you write. The fewer tests you write, the less productive you are and the less stable you code becomes. The less productive and accurate you are, the more pressure you feel.

  • Programmers burn out from just such cycles. Breaking out requires an outside influence.
  • The best way to convince you of the value of writing your own tests would be to sit down with you and do a bit of development.
  • Along the way, we would encounter new bugs, catch them with tests, fix them, have them come back, fix them again, and so on.

Wednesday, December 3, 2008

Do we have enough time for testing?

Thatz the first question I hear while talking to a developer who is not writing tests for his/her code.
"Delivering Code Without Tests Is A Sin"
This is a punch line by Bob-Martin, I heard in one of his sessions I attended. We already are wasting/investing huge amount of time in injecting bad design and bugs into our applications. So I want to ask this question again -
Do we have enough time for testing?
My question to this question is - Do we have anything to lose?

Lets start writing tests...

Tuesday, December 2, 2008

Post Horrible Mumbai terror attack 26/11..

Lots of aggression all around.. questions.. blames.. resignations..
Some groups, citizen showing a high sense of responsibility.. of worrying about the state of country and people..
Some very irresponsible.. thick skinned..
Everyone around me.. at my work, my friends, my family.. express frustration in various ways about such barbaric terror acts..
I've been thinking around all these thoughts, information revealed.. discussions..
I am a lazy person.. And I know this very well, I publicly accept this. This actually is very helpful in always being aware of this negative quality of mine. As it helps me remain alert at many times. But generally I am lazy about many things..
- my health,
- my plans towards my career,
- maintaining documents,
- filing my tax returns,
- playing with my kid,
- calling my friends,
- wishing my friends happy birthday,
The list goes on..
But still I am leading a very responsible and efficient daily life. I continue taking care of my health, my family, my social responsibilities, my career, my documents... list goes on.
I am part of Cycle Of Life. The way I understand it is, there is a threshold, for every negligence, every ignorance, every selfish act, every uncaring attitude. As soon as the threshold is reached, the alarm goes ringing. I dont really care at the first alarm. But there are series of alarms well set, which keep going on with increasing threshold values. And a time comes when a blast is triggered. The blast is very harmful all the time. I have to pay heavy penalty to my bank for not taking care of my documents, I catch cold/fewer for neglecting my health, my kid starts becomming cranky and unstoppable because I am not paying attention to him...
After the first instance of each blast I start taking care to avoid it to repeat.

Our society behaves in exactly the same way. People all around the world become selfish, irresponsible, careless. If they do not listen to warning alarms they suffer thru the blasts. In the news / papers, I can read a lot about various agencies across different countries showing irresponsible behaviour in executing there duties. Of-course they are all headed by human beings who commit mistakes.

If we see the current scenario around the world, the number of alarm blasts is very high.
- multiple economies going down
- financial crisis
- terrorist activities
- etc...
This will cause damage at various levels. And bring the world below the threshold level of alarms.

I believe, the divine power can help us at the micro-est level to take care of preventing us from doing any negative act.
I wish we sahajayogis are able to convey the vision of Sahajayoga to the world.
Sahajayoga principles are the only way we can always remain below the threshold and keep growing continuously in positive direction.

By Sahayoga principles I mean -
- How can I avoid lying?
- How can I get more strength to forgive?
- How can I only love and never hate?

A beautiful world visioned by Shri Mataji Nirmala Devi. You'll see this coming true if you meet with a group of Sahajayogis.