Being Agile… Part III: Failure is always an option!*

Wednesday, 15 December 2010 23:02 by salim

So we are TDD. We proudly announce the number of unit tests and the percentage coverage as part of the scrum achievements. We make demands on minimum coverage (for a brief while when we had TFS, it was a check-in constraint). But, what do we actually gain by testing? Is there a law of diminishing returns in testing?

Uncle Bob in his first presentation at our company demonstrated the bowling example. It is such a simple, eye opening experience to see how easy it is to over specify.

As I mentioned earlier, we were used to very delayed gratification. There were no demands on checking in code, actually we encouraged private branches for doing stuff. Sometimes it takes months before the changes could get in to the build.

The fun part about unit testing (especially if you have a “run this test” context menu) is the instant gratification, even in failure. You should first write a test that fails, so says TDD.

In a non TDD style of development we always expect to succeed. The first time I press build after a series of changes, I expect it to pass. The first time I run the application after a change, it better not crash. Even under the best circumstances a full build and run of the application, which was required if the change was in any of the core units, takes quite a while. Once the application comes up, we need to login and navigate to the view where the change is to see its effect. If we were to find something not working it would be a downer. So, we expected to succeed all the time, there by accumulating heart breaks upon heart breaks.

What changes when tests becomes the primary focus of development? When you write a unit test to model a new behavior, the first attempt is not even supposed to compile. Sometimes, if you are just fixing a behavior, we might have a unit test that can be compiled successfully without changes, but it definitely should not be passing. So, most times, we are specifically looking for a failure. It grows on you. I am no longer ashamed by a compilation error. It is a piece of information, sometimes quite valuable insight into the change that I am going to make. Since when a unit test breaks no airplanes fall from the sky (or angels die), we can afford to do this over and over. Every failing test gives us yet another insight into the problem, one more thing to do; every passing test makes us look for the next best way to fail.

Accepting failure as not just a normal outcome but as a desired outcome makes things much less stressful. If we fear failure, we will build safety measures for every imaginable way something can fail. The problem here is that, there are more imaginable ways to fail than plausible. And there are far more even plausible ways to fail than probable.

In a very fast pace environment things do go wrong from time to time. Since failure is welcome, there need to be a way to celebrate it. This is why we invented the Blame Gametm. When something goes wrong, when the build turns red, when a test “works in my machine” but no where else, when you wipe out the changes for 50 Fitnesse scripts because of one wrong merge, we blame. Of course, the blamee doesn’t have to accept it. There can always be come backs as long as they are more logically consistent and evidenced than “dog ate my hard drive”. The key is to embrace the failure.

What TDD, not just unit testing but aggressive acceptance testing teaches us is to fail often and fail gracefully. As we all know, if your millions of assertions never fail, they are as good as absent. The value of a test is when it fails.

Being Agile… Part I
Being Agile… Part II


*This is one of the best memes to come out of MythBusters promoted constantly by Adam Savage. There is one podcast where he describes why it is a fundamental principle for him. I hope it is not copyrighted by Adam or Discovery channel.

Tags:   , ,
Categories:   IT | Science
Actions:   E-mail | | Permalink | Comments (0) | Comment RSSRSS comment feed

The Arsenic DNA Bacteria that might not be!

Wednesday, 8 December 2010 02:54 by salim

So, earlier last week, NASA comes out with an announcement saying that it will have a press conference on the 2nd of December to announce a major development that has implications to astrobiology.

A day after NASA announcement, Gizmodo published a highly speculative article that predicted that NASA is going to announce that they have found life in one of Saturn’s moons. Then there was just a flood gate of article, some of them with completely bizarre and unfounded speculations and rumors about the discovery.

On December 2, 2 PM, NASA announces the finding (at the same time the article was made available in Science Magazine titled A Bacterium That Can Grow by Using Arsenic Instead of Phosphorus. The authors claimed in the paper and asserted in the press conference that they have shown that these bacteria can not only tolerate Arsenic but incorporate it into their DNA structure replacing Phosphorous.

This followed another flood of reports and blog posts. There was great excitement about the news, especially because it, if correct, would mean that the life can support a much wider range of conditions than we thought. It also will suggest that the main ingredients if life as we know are not that fixed after all.

First thing to come out of it was that, it was certainly over hyped by NASA by clearly hinting it is something more than what it is. Yes, finding a life form that can substitute Arsenate instead of Phosphate is an incredible finding. But, we know life on earth is very resilient and innovative. It would certainly don’t mean that we are closer to finding exobiological entities.

Along with this, there came a series of posts by scientists questioning the veracity of the methods used by the NASA scientists (Felisa Wolfe-Simon et al). Among the many I read about this subject there are two that stand out in its clarity of presentation and scientific rigor (no, that is not to make any claims about its correctness).

The article by Alex Bradley looks at the problem from a chemist’s perspective and brings up a few very serious process and interpretation issues. He correctly points out that there were due diligence that the NASA scientists did not perform.

An even more detailed criticism by Rosie Redfield can be read here. She goes more into the methodology and points out many potential pitfalls in them.

All this reminded me of the famous Carl Sagan adage “Extraordinary claims require extraordinary evidence”.

Another point this brings to light is the methodology of science and the immediacy and openness with which it is happening. Answering requests for comment, one of the authors of the article said that the discussion should happen in peer reviewed journals, not in the blogosphere. That is a bit odd though, considering that they themselves made an effort to make this very public.

Irrespective of how this particular finding turns out, science will go on. I have noted this earlier, the usually hidden away dynamics of the process of scientific enquiry is now spilling over for every one to see. It is beautiful, exciting. Now, if only the media learn to stop seeing everything in black and white.