Article

Articles

tagged with testing  Show All

1 articles tagged with testing

Washing Your Hands by Dave Hoover.

Not categorized. Tagged with professionalism, sterile and testing.

I had the privilege of speaking twice at WindyCityRails on Saturday.  It was a one day conference near and dear to my heart since I spend most of my days in the Windy City working on Rails projects.  My official talk was about what I learned developing Mad Mimi.  (I learned that having a good customer is an incredible advantage.)  My unofficial talk was 10 minutes of whatever I wanted to talk about in front of the 100+ conference attendees (immediately after an excellent Q&A with David Heinemeier Hansson).  So, being the untalented speaker that I am, I decided to channel Uncle Bob, one of the best presenters I've ever heard, and talk about washing your hands.  After being inspired by his talk at Agile 2008, my team and I have ratcheted our craftsmanship up a few notches, and I hoped I could spread the momentum to other teams.

So I talked about washing your hands?  Yes, particularly about how surgeons "scrub in" before they perform an operation.  I think there are many parallels between surgeons and programmers, and I'm going to be researching this a bit further (I helps that my college roommate recently became an attending orthopaedic surgeon).  The simplest parallel is between Test-Driven Development and sterile procedure.  This is something Uncle Bob started talking about 2 years ago: "It has become my position that TDD is a necessary discipline for professional developers. I consider it rather like sterile procedure for doctors. It's simply what you have to do to write professional code." (comment from Agile People Still Don't Get It).  I find this analogy particularly appropriate when you have an existing codebase and you've been asked to fix or enhance something.  Like a surgeon you need to ensure you do not infect your patient, and in order to prevent that, you need to create a sterile environment.  If you don't have tests in place, you retrofit them in order to prevent regressions (similar to cleaning a dirty patient).

I mentioned a couple other implications from this line of thinking.  First, it seems like it wouldn't be too much of a stretch to think that, like doctors, we should subscribe to the principle of Primum non nocere, "First, do no harm."  When we work with a codebase, we should always be improving it, we should never do harm.  How would we know if we are harming it?  Our tests would fail.  Our metrics would be heading in the wrong direction.  Second, when it comes to washing your hands, consider when surgeons wash their hands.  They wash them before, not during, not after, the operation.  Imagine how ridiculous it would be for the doctors to try to keep their environment sterile after beginning an operation with dirty hands.  Similarly, we need to setup our tests before we begin our fix or enhancement or feature development.

Like Uncle Bob, I'm beginning to think that Test-Driven Development is a mandatory practice for people who call themselves professionals or software craftsmen.


 

Copyright O'Reilly Media

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |