The merits of Design Diagrams

You’ll find many articles online describing how to create very detailed design documents covering things like business requirements, data design, UI mockups, class diagrams… Most developers however will shy away from them. Reasons I often hear are:

  • "I know what I am developing"
  • I’m not a Technical Writer
  • Nobody is going to read it anyway
  • All the info someone would need is in the code anyway
  • This is going to cost me way to much time and I’m already under pressure
  • Keeping these documents up to date is impossible
  • We work Agile, we adapt as we go long, so we don’t need documents”

To make matters worse: often when people do create them, they tend to create very detailed documents confirming their own arguments. So, I want to suggest a type of design diagram that meets the following goals:

  • allows anybody to challenge the design BEFORE any development starts
  • can be created in < 4 hours
  • can be consumed by the reader in < 15 minutes
  • saves the team AND the organization time
  • allows us to quickly identify those areas that are the most expensive to fix/change (e.g. around performance, stability…)
  • is easily maintainable
  • ensures that everybody has the same understanding of the design

Note that I didn’t mention creating a design document, I prefer to use the term design diagram. The idea of a design diagram is not to have the full specification written out, but to communicate the essence.

How to create a Design Diagram

Picture yourself explaining your feature to a fellow developer who just joined your team using nothing but a whiteboard. What are the essentials that you will share? Your drawing should show:

  • which components are involved
  • what each component does
  • how they communicate and what the flow of communication is
  • what data they manage

With this approach, you’ll end up with something that fits on a single page and can be consumed by the reader in < 15 minutes.

To be clear:

  • Don’t describe your code. Add only the high level that is necessary to understand the code. People who can read code, prefer to read code anyway so that documentation doesn’t pay off.
  • Don’t write long texts. It is unlikely that you will be able to keep this up to date as your design evolves. Also, most people won’t be willing to read it.

Given such a diagram, I would go as far as to claim the following: If a developer or a team still claims that it takes them too much time, then they don’t have their design under control!!

How detailed you create these design diagrams will be dependent on the maturity of your team and the state of your product/project. For greenfield development with a new team you may require additional diagrams like a class diagram, UML diagrams… For brownfield development with a mature team, one simple drawing may suffice. One size does not fit all!

How does such a design diagram save time?

Here’s how it saves time DURING the development:

  • fundamental design flaws can be spotted very early, even before any development has been done
  • the design can be challenged with other people very easily and efficiently
  • misalignments within the team are significantly reduced
  • code reviewers will have to ask less and can ask more focused questions because the intent of the code will be clearer. Code only shows you how something happens, it does not show you the WHY nor does it show you the high-level flow at a glance.
  • the chances the organization is not receiving what it expected because of misunderstandings if significantly reduced. This eliminates rework
  • testers can identify the weak points easier and focus their testing on the weak points

Here’s how it saves time AFTER the feature is developed:

  • Customer Support people who need to analyze a customer defect, can better understand the design and therefore better direct their analysis
  • Trainers can better understand the inner workings, and this can benefit their training
  • Developers who need to change or extend this feature 12 months from now can better understand how it was designed, why it was designed this way and how their changes fit in the design
  • The Scrum team that created this feature will have to explain their intent/design less

Fixing a bug in production is expensive, but – once the bug has been found – fixing a small code issue may not be too bad. The expensive bugs are the ones where the design was flawed from an architectural perspective impacting performance, availability, runtime cost, scalability…. Those are the ones requiring a severe refactoring. Luckily, very often, these can be identified by just looking at the design diagram!

Give me an example!

Imagine the following example: suppose we have an e-commerce site in which customers can write reviews about our products. So far, we have been reviewing these comments manually but our site became so popular that we can't process the load anymore, so we want to automate this process more.

Every time a review is added to a product, we want to analyze automatically whether it is a positive or a negative comment. Products that got too many bad reviews are then flagged accordingly so that our product managers are made aware of this.

A design that could be proposed by the team for such a feature is this:

No alt text provided for this image

I will not claim that this design may be the ideal solution for this problem, but it does already show me some essentials:

  • I can clearly see the order in which all operations are done
  • I can assess the performance of this solution
  • I can see potential problems with rate limitations in Azure Machine Learning
  • I can start to estimate the run-time cost
  • When I or somebody else needs to review a pull request for this feature, we can better judge the code because we now also know its intent and how it will be called.
  • I can see in which data store which information will be persisted
  • I can see that we will be able to configure the sensitivity
  • And when I want to ask additional questions, I can make them very targeted and clearly highlight which component I am talking about to avoid any confusion!

There is a lot that I can learn from this very simple diagram that has very little text and that I made in PowerPoint in under an hour.

Which tools you could use

You don’t need expensive tools to create design diagrams. Here are some tools that I sometimes use:

Two things are important:

  • Use tools that everybody in your organization has access to. Everybody in the team should be able to create or modify a design diagram.
  • And always make design diagrams digitally. People should be able to extend or adapt the design diagrams as the project evolves at any time.

When to create them?

If your feature involves multiple components, multiple services, a complicated algorithm, remote calls… a design diagram should be created.

Create a design document BEFORE any development starts. The sooner you have the document, the sooner you can reap the benefits. Only creating a design document after the development means that you lose many of these benefits.

And in case you are wondering, no this does not smell like waterfall. Working agile does not mean that you shouldn’t think about where you are heading upfront.

Who should create them?

For more mature scrum teams, it is the team developing the feature that should create the document. For less mature teams, there may be an architect preparing the designs for them to get them familiar with the thought process, but that should not be a permanent solution.

Conclusion

The key thing I want you to take away from this article is this:

  1. motivate people to create designs upfront, but don’t expect detailed documents. Find the thing that brings you the biggest bang for the smallest buck
  2. don’t try to cover all risks with documentation but do cover those risks that would be the most expensive to fix
  3. “a picture is worth a thousand words” very much applies here. A well thought drawing with the right level of detail, is worth gold!
Dean Goddard

Creative Ideas - Creative Solutions

5 年

One key limiting factor of ALL diagrams is the Minds Limit, and it's not mentioned here.? Our short term memories can only handle 7 objects at a time, +/- 2.? I don't know but I suspect clever developers are in the +2 category.? However critical analysis often involves non-technically minded folk, so any diagram that contains more than 7 objects, becomes a challenge to understand quickly without explanation.? You need diagrams to be self explanatory.? In my experience when a diagram starts to exceed 10 objects, it quickly becomes over whelming to everyone except the author.? Your example above has 8 objects in 3 steps so it's in the sweet spot.? If you stick to this principal, you get an immediate engagement with the intended audience, rather than the TL;DR response.

Ron Crocker

Principal Software Engineer at Overjet

5 年

+1. I love when teams draw pictures of what they're going to build, for all the reasons you say. I don't really care so much about tools, I'll take a picture of a whiteboard sketch. One downside of pictures is that the picture and the system that is _actually_ built are different but the picture doesn't get updated to reflect reality. This seems no different of a risk as "writing design docs", with a little less overhead.

回复
Jim Macdonald

System Engineer at Newport News Shipbuilding, A Division of Huntington Ingalls Industries

5 年

Using PowerPoint for diagrams is like using a screwdriver to drive a nail.? Much better to use Visio that's what it is designed for and it produces cleaner diagrams.

回复
Christopher Kutsch

Vice President Of Design Engineering at Assurant

5 年

Great article! Teams that are moving quickly still require a roadmap to show them the direction they are traveling and to maintain sight on the destination. These documents help convey that at various levels and are invaluable in my mind.

回复
David Bullock

Managing Diretor at Little Health Teams

5 年

Some resources I have found useful in this domain are both old (and maybe out-of-print) books: 1) Effective Requirements Practices by Ralph R Young (Addison Wesley, 2001) 2) Problem Frames by Michael Jackson (no, not that Michael Jackson) (Addison Wesley, 2000) (and probably R. Young's follow-up 'The Requirements Engineering Handbook' (Artech House, 2004)? though I've not read it yet). Jackson presents an intuitive diagrammatic way to tag how a requirement touches various parts of the system (seen through a lens of 'here are phenomena we are connecting' and 'we are responsible for configuring these machines which connect the phenomena''), Young on the other hand presents a rigorous approach to ensuring that requirements are generated and tracked throughout the development life-cycle.? Both books are written by practitioners.? They're very out-of-vogue now because 'Big Upfront Design' is frowned on, but there is actually nothing about their advice which prevents you from using an iterative 'a version is always ready to run' approach (which is the main technical risk of the much-maligned 'waterfall'), and it help the iterations have purpose and direction.? As for modern development and quickly putting something concrete into the face of users (not quite the situation you're addressing, but more a tool for requirements solicitation) is a 'low-fidelity wire-framing tool' called Balsamiq - it can save a bunch of time (compared to generic drawing tools) for quick UI-sketches.? I find it helps a lot to come to terms with business flows, states, what will actually fit on a screen, and even what sort-keys are most pertinent to the user-task.

要查看或添加评论,请登录

Michael Vanhoutte的更多文章

  • Reconciling an Agile Plan with a Long-Term Roadmap

    Reconciling an Agile Plan with a Long-Term Roadmap

    An agile plan is not the same as a waterfall plan, just like an agile roadmap is not the same as a traditional roadmap.…

    15 条评论
  • Creating Effective Presentations

    Creating Effective Presentations

    We often struggle to present information to other people who don't have the same knowledge as we do or don't see the…

  • Transitioning from on-premise to SAAS

    Transitioning from on-premise to SAAS

    Transitioning an on-premise deployed application to a (potentially multi-tenant) SAAS application running in the cloud…

    1 条评论
  • Understanding Quantum Computing for Software Developers

    Understanding Quantum Computing for Software Developers

    Quantum computers are a new generation of computers based on the principles of quantum mechanics. It is a technology…

    6 条评论
  • Don't let imposter syndrome choke you

    Don't let imposter syndrome choke you

    Here's a little secret. I suffer from imposter syndrome.

    3 条评论
  • Creating a Test Plan

    Creating a Test Plan

    Does this sound familiar? As a developer in a dev-team Have you ever wondered if you've created sufficient test cases?…

    2 条评论
  • Complex Problem Solving

    Complex Problem Solving

    People often struggle when trying to solve complicated problems. This may be while preparing a plan for a large…

  • Becoming a Technical Leader

    Becoming a Technical Leader

    This article is for software developers who aspire to take up more of a leading role within their organization. It…

    4 条评论

社区洞察

其他会员也浏览了