Sep
2006
22

Frustrated => Eureka moment

Yesterday was hell! I woke up feeling great because I had learned so much Ruby the day before. However, the tutorial program that I was building had stopped working in the late evening, so I went to bed with the thought that I would fix it when I woke up yesterday morning.

Things just didn’t turn out that way: I knew I had to debug the program, so I searched for a full-feature IDE with debug support — has breakpoints, allows one to step through the code and inspect the progams variable values, etc.

I opened up my RADRails program, then my Microsoft Visual Studio 2005 with Ruby add-in — the debugging in both didn’t work. The final result was a very frustating day of work with my program still not working. Just before falling asleep, I read the Ruby on Rails [RoR] designer’s 24 page case study: Software Architecture Case Study Ruby on Rails.

I woke up this morning, took my 5km bicycle ride and during that ride I had the epiphany or “Eureka moment.” The details of paradigm-shift are as follows…”

I realized that yesterday’s frustrations were due to my old way of thinking about how to debug a program based upon my 30 years of programming.

The newer, agile way of programming emphasizes Behaviour Testing Development. The programmer writes the tests first and then writes the program code! The programmer then uses all prior written tests to verify the correctness of the program code. Any failure is added as a test, re-run. The software is OK only when it passes all the tests.

The paradigm-shift was the realization that I didn’t need a full-feature IDE debugger as much as I needed to change my pattern of developing software to include “behavior testing.” Developing this way, I needed only three windows open:

  1. Editor window displaying the “test suite” files,
  2. Editor window displaying the “development” files,
  3. Browser window displaying the results as would be seen by the user.

So today, I am reading about “behavior” testing. And feeling much better, i.e even a bit “enlightened” :-)