October 19, 2006

...Learn TDD with Codemanship

Whose Design Is It Anyway?

An argument I've been embroiled in recently has finally come to rest. The question of who should have control over software design has, as far as I'm concerned, finally been answered.

I took a UML design specification that had been painstakingly crafted by skilled architects. From that I calculated a handful of key design quality metrics. I then calculated the same metrics for the code that implemented that design.



Let's examine one metric to serve as an example: Normalised Distance from the Main Sequence (D'). I don't want to go into detail here, but you can find a detailed explanation of this metric in this tutorial.

The maximum value of D' is 1. The ideal is zero. Measuring D' using the UML specification, average D' turned out to be 0.32, which is not too bad. Measured against the code, however, D' was 0.67, which is actually not great at all. Quite shabby, in fact.

The point I want to make is this: the implementation turned a well-packaged design into a badly packaged design. And I should stress that the implementation almost completely satisfied the specification. It wasn't "bad programmers" failing to follow the "good design" that made the difference. The original design remained intact throughout. Try it for yourself, if you don't believe me. You'll find a list of UML and code metrics tools on our OO metrics page.

To my mind, anybody who makes a significant difference to design quality is - whether we like it or not - a designer. It's difficult to write a line of code that doesn't impact at least one design quality variable. In fact, it's impossible. (Try adding code without increasing complexity, for example).

This little experiment proved my point and the opposition have been forced to back down and accept that programmers make a big difference to the design. They're less willing to accept, however, that the implications are that programmers should be empowered to make design decisions locally without having to refer everything back to a central design authority.

I think that's folly, but lack the proof today to counter it. I'm working on it, though!
Posted 14 years, 2 months ago on October 19, 2006