Skip navigation.

Erik Petersen's blog

De-smelling by refactor or rewrite: some thoughts

design & development

Is there a tipping point when rewriting code should be favored over refactoring ? It is often hard to decide. There are some important factors that can help. Code smells cluster, whether as bugs that are detected, or potential failures lurking in immature code that may break during future updates or maintenance. Steve McConnell wrote (in “Rapid Development”) that “Error prone modules tend to be more complex than other modules in the system, less structured and unusually large. They often were developed under excessive schedule pressure and were not fully tested”. He also quotes indicative studies that these modules are much more expensive to develop. Steve’s metric is 10 defect per 1000 lines of code to mark a module for further work. If it appears to be an error prone module, he advises rewriting it. Other indicators are large concentrations of bugs, large number of checkins, or large amounts of fix time spent in comparison to similar modules. While error-prone modules are typical in traditional development, agile practices like well executed TDD should minimize them. High cyclomatic complexity of code is also a good indicator of the need for simplification.

The hard thing is determining the tipping point between refactor and rebuild. The easy thing is that because of clustering, there is often a lot of low hanging fruit, and focused effort on a small portion of the code should have a massive impact on the code quality.

For more on bug clusters and other productivity ideas, see my Google tech talk “Building Software Smarter”, http://www.tinyurl.com/80-20-rules

Severity One outage - on a golf course??!!

acceptance testing | events | metaphors | usability testing

I never really realized the parallels between software development and golf course layout. Both have a technical component, and a reliance on usability. The Australian (Golf) Open moves from city to city each year, and has a hiccup every so often. This year they had a five hour outage.

How do you get an outage in golf? While not in the infamous class , this years competition was held at a cliff top course in Sydney overlooking the ocean. Spectacular but windy. A savage wind blowing balls the width of the green had players blowing par just with their putters. A 5.5 hour delay to play was called by which time the wind speed had halved. The outage confused the local players who said those conditions were typical and just “par for the course”. The greens were all very fast, 10.5 based on their stimpometer score, much higher than the 8 recommended by some players before the tournament started. While the golf club staff ignored the advice, they had tried to slow 4 of the faster holes. The rest of the tournament was played sucessfully in windy conditions that kept the flags taut but didn’t move the balls.

If you could only follow one agile practice, what would it be?

agile

At the MXUG meeting this week, Steve Hayes was volunteered into giving a lightning talk. He asked for a suggested topic, and someone said “If you could only follow one agile practice, what would it be?” My instant comment was “Standups”. Later on Steve spoke about Kent Beck’s revised agile values condensed down to the trio of Accountability, Responsibility, and Transparency (which has good and bad aspects he said). Any practice that supported this would be good, but Steve chose retrospectives. I added my 2 cents worth that I would choose standups if quality was a major goal, as studies have shown that lack of communication in groups creates bugs particularly in larger teams. Linda Hayes has written about this, as has Mike Cohn in Chapter 10 of his new book . Standups also function as mini-retrospectives as well. They start conversations that continue after the meeting to help team members get better understanding of what they are delivering.

Standups have now moved beyond software development and are infiltrating other industries; I recall reading about the new HQ of an advertising company that has meeting rooms without chairs and bar counter tables to only allow standups (and cocktail parties!)

Cool Tools - for customer data etc

functional testing | test automation

Test data is often a bottleneck on testing projects. Security and privacy issues can require complex massaging of existing information, Today, there are tools to make it easy to create it from scratch! I find two in particular quite useful.

I’ve been telling people about generatedata.com for several years. It is an amazing tool for generating data for customers or other items, including items chosen from lists and data ranges. It is free, customizable and can even be run off a USB (after it is customized for the computer and database etc).

Lewis Hamilton, agile tester?

acceptance testing | agile | metaphors

Lewis Hamilton became the youngest Formula One racing car champion last year, in spectacular circumstances with a last gasp fifth place in the last race. This year, as tabloid headlines screamed “hero to zero”, his success has been measured by trying to avoid being lapped by the leaders and ending a five race drought without winning a point.

Apollo 11 glitches: the alarming 1202, the 4 sec fastforward and the soft landing bug

events | perspectives
It's forty years on from the moon landing, the culmination of the work of 400,000 people. I can remember as a kid seeing the hazy picture on TV (One of the few bits of TV I saw as a kid, as I grew up on the Pacific island of Nauru but must have been in Australia on holiday).

Sluggish starts slow subsequently successful Service screening streams

events | non-functional testing | perspectives
That title could be from a page in Graeme Base's book Animalia. It is an amazing picture book, with a small boy hiding in the inventive illustrations on each page.  It has recently been turned into a cartoon and is used in creative writing classes in schools as well.   I don't know if Michael Jackson's children know of the book but their late father would have loved it, like he loved Peter Pan.

Breaking News breaks records across the net

events | non-functional testing | performance testing | perspectives
The sad passing of Michael Jackson became a breaking news story that sent a shockwave spike through the infrastructure of the internet. Google saw a huge spike in traffic that security threshold detectors interpreted as a hacker attack, resulting in a 25 minute captcha confirmation or service refusal from Google News. Yahoo had the MJ report headlined in their news aggregator, then Google had it further down, and Microsoft's Bing had it way way down. A Bing blog post seemed to imply that it was ranked down because it did not have images with it, which breaking news typically wouldn't.

The website TMZ.com broke the story 20 minutes after his passing, then went down briefly under the load. The LA Times was the first news site, and it fell over soon after. Online news services saw a 20% increase in traffic, but the availability of popular web news sites dropped from 100% to 86% and didn't return for another 4 hours.

1 2 3 4 5 6 7 8 9
XML feed