Test first software development

Having personally developed lots of software as well as worked with many software developers over the years, I’ve formulated a theory on why lots of developers are resistant to unit testing and test driven development (TDD). The theory is simply that most developers know that 90% (or more) of the lines of code they write are defect free; consequently, forcing 100% of the code to have tests seems counterproductive to many of them. It’s a theory that seems obvious after being said out loud, but I rarely hear it explicitly verbalized in discussions to increase testing.

The mental hurdle that is difficult to overcome is that the 5-10% of the code with defects is like a minefield scattered throughout the product. Many Agile software processes promote a test first then code approach, and this considered a mythical utopia by most software shops. Even though more companies are adopting test first strategies, the key to changing the mindset has to occur in technical textbooks and classrooms. After the ‘hello’ program has been taught, all other examples should start with a test and proceed from there.

Agile processes and life

At last year’s Agile conference, I was entertained to hear one of the group discussions involve ‘relating Agile software development to every day situations in life’. I didn’t attend this group discussion, but there have been many times over the past year where I have taken a mental note of some similarities. While this will surprise very few people, since our work processes often stem from actions outside of work and vice versa, some of the similarities help explain why Agile works in developing ‘craft-like’ products, such as software. I’ve listed a couple of incredibly simple ones, but there are many more.

Paying bills. As any financial planner will advise, a wise person should pay their utilities and other necessities before buying that new ceramic unicorn for the collection. With an Agile process, the truly important features are added first, and once these features have been added, the extras are worked into the product. In the end, there’s little chance of the electricity being turned off!

The big spelling test. When I was in 5th grade, I aced a ~70 word vocabulary test that we were given a couple of weeks to prepare. I’m no word buff, but when the teacher asked me to explain to the class how I did it, I said I had casually studied 5 new words every day for the past couple of weeks. I hadn’t tried to learn the whole list all at once nor cram a few days before the test. This is very similar to the iterative approach prescribed by Scrum and other Agile methods. Break the work out into discrete blocks and concentrate on those blocks for short periods of time.

The point is not to trivialize Agile processes in general, but it is important to note the methods used in Agile are also methods that generate higher success rates in other practical areas.

Too much exercise? Think again.

I really enjoyed this article in the Austin American-Statesman about how much is too much to run. The bottom line is that you can run as much as you want, and the reality is that 99.99% of most people won’t even be able to come close to over doing it. Granted, this assumes you are healthy enough to exercise (i.e. walk) and slowly build up your stamina (i.e. not running 10 miles on your first day out).

This rule applies to just about all forms of exercise, even though there are a few skeptics who have seen a 60 Minutes special on an obsessive person who over did it. Anything under 2 hours of exercise per day is still considered recreational exercise, and squeezing 30 minutes a day is a stretch for most. I recommend alternating between various types of exercise to prevent injuries and increase motivation, but if fear of exercising is preventing a regular visit to the gym or a trip around the block, think again.

Deep water

The boating scene is always ripe for an escapade, and this weekend was no exception on Lake Travis. At dusk on Saturday, we started to pull up our anchors, but one boat’s anchor would not budge. Unfortunately, we were in about 80 feet of water, and the options were limited. Leaving the anchor and chain at the bottom of the lake is the least desirable option (and an expensive one), and I’m sure there is a mile of anchor chain and rope sitting at the bottom of the lake for people in this exact situation. After an hour of circus moves with jet skis, multiple boats, and a lot of advice from passer-bys, it was time to call some divers to help.

The next morning, a couple of guys, Nik and Sam, from Oak Hill Scuba showed up to take a shot at freeing the anchor. After a couple of dives in the 60 degree water (at 70 feet), they decided the chain was wrapped around an old tree, and with one foot of visibility, the scene was too treacherous to continue with the remaining amount of compressed air. So, they headed back disappointed at not being able to free the anchor but vowing to get it out.

Getting prepared

Graciously enough, Nik and Sam passed the story onto their friend Justin, a commercial diver, who has worked on oil rigs at depths of 300 feet. Later on Sunday afternoon, Justin showed up with his girlfriend and dive partner, Anita.

Getting prepared 2

While getting geared up, Justin was casually mentioning a few experiences, like shooting straight up from 150 feet in an emergency and fending off sharks while working on the rigs. (This was like a wading pool for him!) In any case, Justin’s plan was to head straight for the anchor, release the shackle and just pull the chain off the tree. With the increased boat traffic in the area, I was a bit concerned, but within 15 minutes, Justin had free the chain and floated the anchor to the surface. A job well done

I have posted some additional pictures of the affair on my Flickr site.

Austin Energy, Google & Red Monk

Changing managers

Over the years, I’ve heard many a person grumble about having to change managers, either due to organizational changes or natural attrition. I found it interesting that the author of The Fiefdom Syndrome actually promotes the systematic changing of managers and directors at periodic intervals. Using a system such as this prevents people from hiding within an organization and allows fresh eyes to look at old problems. As the title suggests, it also decreases the possibility that fiefdoms will occur within an organization and base their actions on self-survival while costing the company as a whole.

When I first heard this, I was somewhat opposed to this idea, but after thinking about it more, I can see certain situations where this might make sense. A lot of employee surveys I’ve seen state the number one reason for quitting was due to a bad manager, and this option might help while improving the business in other ways. At a minimum, organizations, large and small, should be on the lookout for situations where groups have taken on a “life of their own” within the larger organization and consider this as one possible option.

Salty eyes

Someone recently told me that you can tell whether you are eating too much salt if your sweat burns your eyes. I found this interesting because I thought every person’s sweat burned his/her eyes, but after asking around, this apparently is not so.

Because of this and a documentary I saw about the risks of salt intake, I recently started loosely tracking how much sodium I was consuming. Thus far, I’ve been kind of surprised in the high amount of sodium in some innocent things like salsa, which I love.

While I was clicking around, I found this link from the Salt Institute. According to them, you can eat as much salt as you want. Talk about checking your sources!