Feeds

Why UML won't save your project

Modelling a badly thought-out project just doesn't help...

The Power of One Brief: Top reasons to choose HP BladeSystem

The project's been wobbling along for 18 months. A bottle of champagne just went to the tester who logged the one millionth bug in TestDirector (and everybody cheered), the lead programmer looks like a raccoon that's discovered a departed junkie's heroin stash buried beneath a tree, half the programmers have quit, and the customer believes everything's fine... Although it does strike him as odd that all he's seen so far are static screenshots and Gantt charts with every single task stuck at "90 per cent". The project's in trouble.

head shot of Matt Stephens smilingSo what does the team do? They've read the IBM/Rational marketing blurb, so they firmly believe that they can "do UML" on their project and that this'll have a miraculous effect on the bug-riddled codebase. It's this vague desire to start doing the right thing in order to save the project that can sink a team even further into the swamp.

When a project is in trouble because of a lack of initial analysis/design thought, the worst thing to do is to stop everything and start modelling the whole sorry mess in a CASE tool. It seems reasonable to want to create a clear picture of where you're at: a level playing field from which to start fixing the design. But muddy water poured into a crystal flute is still muddy water. Now you've got the same dysfunctional mudball in two places - the code and the UML model. Great.

It's also tempting to automatically reverse-engineer the code into class diagrams using a modelling tool. This might have an unseen benefit in that it'll shock whoever sees the resultant diagrams into realising just how bad the problem has gotten, but the diagrams themselves will be as scary as the code they're modelled on, a jumble of criss-crossed lines and teeny-tiny overlapping boxes that could rival anything in the Tate Modern.

I'm a great fan of UML, but like any tool or language it can be misused horribly – and usually is, because people start to use it for the wrong reasons, e.g. to do the thinking for them or make their team cleverer.

The right time for drawing diagrams is near the start of the project (or new feature, or weekly/monthly development sprint) when you do a little collaborative modelling with the whole team involved and figure out how it'll all fit together.

So it's worth emphasising: the solution is not to start modelling the existing illogical codebase in UML. However, do map out your ideal new improved design, unfettered by the constraints and design dead-ends of the current system. But the first thing to do (assuming you can't just scrap it all and start over) is cover the existing code with unit tests so you can begin refactoring your way to the new design.

But even before that, you must know what it is you're actually designing. Start with the basic questions: Who's the project for? What problems is it addressing? If you're feeling especially virtuous today, map out some use cases and try to drive the new design from them. Don't be afraid to come up with something very different from what you currently have.

UML used at the right time and in the right way can work wonders - it'll set the foundations for a successful, well factored project. But, to adapt Frederick Brooks' famous law about the perils of adding resources to a late project, stopping to map out the bad design on a late project will just make the project later.

Matt Stephens co-authored Use Case Driven Object Modeling with UML: Theory and Practice and Agile Development with the ICONIX Process.

The Essential Guide to IT Transformation

More from The Register

next story
Secure microkernel that uses maths to be 'bug free' goes open source
Hacker-repelling, drone-protecting code will soon be yours to tweak as you see fit
KDE releases ice-cream coloured Plasma 5 just in time for summer
Melty but refreshing - popular rival to Mint's Cinnamon's still a work in progress
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
Put down that Oracle database patch: It could cost $23,000 per CPU
On-by-default INMEMORY tech a boon for developers ... as long as they can afford it
Another day, another Firefox: Version 31 is upon us ALREADY
Web devs, Mozilla really wants you to like this one
Google shows off new Chrome OS look
Athena springs full-grown from Chromium project's head
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Consolidation: The Foundation for IT Business Transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.
Application security programs and practises
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Securing Web Applications Made Simple and Scalable
Learn how automated security testing can provide a simple and scalable way to protect your web applications.