Thursday, March 16, 2006

Software Quality Characteristics

In CodeComplete, McConnell defines 15 'characteristics of software quality':

External Characteristics
  • Correctness
  • Usability
  • Efficiency
  • Reliability
  • Integrity
  • Adaptability
  • Accuracy
  • Robustness
Internal Characteristics
  • Maintainability
  • Flexibility
  • Portability
  • Reusability
  • Readability
  • Testability
  • Understandability
It's important to work out early on in a project what your priorities are (and especially what they aren't) so that you can steer the project effectively. It's also important not to underestimate the effect of all the unspoken tacit decisions made by developers in the course of their work: the unspoken assumptions. Without clear guidelines, developers will benignly pursue their own ideas about 'the right way' to do something. You can tick off all the use cases you like, but if they favour performance or reusability, and your client's real goals are accuracy and maintainability then you're heading for trouble. It’s always the non-functionals that bit you, IMHO.

Fortunately McConnell also points out that given clear guidance, developers will actually do what they're told, which is reassuring. Setting clear goals is a pretty key management tenant, but one easily forgotten. Some of these characteristics (say performance, code-complexity) can even yeild metrics, so you can deal with the project graphically: BigVisibleCharts.

On my previous project, we used this list as the basis for our peer code reviews, out of which came the categorisation I posted previously, but to re-iterate (slightly re-worded):
  • Customer Facing (most of the External Characteristics)
  • Maintenance and Design (most of the Internal Characteristics)
  • Defects (Just hunting for bugs)
I think it’s a good split. Each review role had a cheat sheet which consisted of the relevant characteristics (as defined above) to look for, and some check lists. This helps ensure visibility of the quality priorities into the code review, which makes them doubly hard to ignore.

PS: If you weren't sure what some of the characteristics meant, maybe you should re-read your copy of CodeComplete.

Wednesday, March 01, 2006

Focused Code Reviews

I was going to write something laying out the arguments for code reviews, but Hacknot beat me to it (and did a better job):

Hacknot: In Praise Of Code Review

To which I'll only add that not only is Code Review cheaper than formal testing, but it picks up whole classes of defects that can never be found by traditional testing (eg: plain unmaintainable code)

On my last project we did peer code reviews, with three random reviewers for the week, each performing a different role in the review:
  • Customer Focused & Usability (do the messages make sense, does the flow work, are we accurate and not robust (or viceversa if required))
  • Maintenance and Legibility (self-documenting code, documentation comments, architectural synergies)
  • Bugslaying (checking for obvious foobars, and reviewing test coverage)
We found this split worked pretty well at keeping reviewers focused, without which people can tend to miss the hard-to-spot stuff. Additionally having multiple people review each unit ensures that someone's bound to pick up on any serious issues, whilst also maximizing the cross-pollination of approaches.

Also I'm all for paper reviews. It's easier to annotate on paper, plus I tend to think along the lines that if someone missed it once on-screen, maybe printing it out reduces the chance someone else will do the same thing.

Popular Posts