Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Communications Programming IT Technology

What Makes a Good Design Document? 461

dnnrly asks: "I've been writing software professionaly for a couple of years now for more than 1 company and I've noticed a recurring pattern: I get put on a new project that already has a bit of history and I get told to read the design documents and then implement XYZ. What happens is I read the document, find that it gives me a lot of information about certain aspects of the system we are building, but leaves huge gaps in others. We're going to be rewriting some of the procedures very soon and I'll be able to influence the software side so I wanted to ask Slashdot readers what sort of things have they seen in design documents that they've liked/thought are a good idea? What have they found works and what doesn't? If all else fails, where's a good place to find all this stuff out?"
"There's usually a very defined and rigid format for every design document and the writers have obviously tried very hard to make sure that procedure has been followed, generally leading to an almost unreadable doc or a design for the sake of it. Part of the issue is that these guys have written the design after 2 or more years exposure to the problem so they tend to forget just how much they know."
This discussion has been archived. No new comments can be posted.

What Makes a Good Design Document?

Comments Filter:
  • by tcopeland ( 32225 ) * <tom&thomasleecopeland,com> on Monday April 18, 2005 @12:14PM (#12270384) Homepage
    Here's the classic article [bleading-edge.com] by Jack Reeves.
  • by darthtrevino ( 812116 ) on Monday April 18, 2005 @12:20PM (#12270448) Homepage
    I've seen alot of design documents. Most of them fit into a sort of cookie-cutter as to what the company expects. If UML is standard, expect to see alot of crappy UML with substandard explanations.

    The best design documents are ones that aren't trying as much to fit the cookie cutter as much as they clearly convey the idea of the design.

    I'm not saying to throw design standards to the wind. I'm saying that your standard as a design document generator is to create something that is readable, decent to look at, and clearly conveys what is going on.

    Try to use vernacular vocabulary and language style when explaining what things do, and try to make your pictures look as pleasing and simple as possible.

    Hope that helps.

  • Find the Guru (Score:3, Informative)

    by StarWynd ( 751816 ) on Monday April 18, 2005 @12:28PM (#12270559)

    The primary problem is that there's too much information to document. I could create a document which included every design decision and every little facet of the project, but the document would wind up so huge, it'd be impossible to work with. The best resource I know of is the project guru. Every project has one -- the one guy who seems to know everything or at least can tell you where to find the details. Find this guy and pick his brain as much as you can. That'll carry you a lot farther than the documentation itself. However, if the guru is no longer around, you're up a creek without a paddle.

  • by rmerrill11 ( 308424 ) on Monday April 18, 2005 @12:34PM (#12270633)
    I think that Joel Spolsky addresses software design docs well. Among other things, at one time he was responsible for writing the software spec for Microsoft Excel.

    Summary:
    This series of articles is about functional specifications, not technical specifications. People get these mixed up. I don't know if there's any standard terminology, but here's what I mean when I use these terms.

    1. A functional specification describes how a product will work entirely from the user's perspective. It doesn't care how the thing is implemented. It talks about features. It specifies screens, menus, dialogs, and so on.
    2. A technical specification describes the internal implementation of the program. It talks about data structures, relational database models, choice of programming languages and tools, algorithms, etc.
    When you design a product, inside and out, the most important thing is to nail down the user experience. What are the screens, how do they work, what do they do. Later, you worry about how to get from here to there. There's no use arguing about what programming language to use before you've decided what your product is going to do. In this series, I'm only talking about functional specifications."

    One of his books: Joel on software [amazon.com]

    His blog: What's a Spec? [joelonsoftware.com]

    Highly recommended!

  • by rleibman ( 622895 ) on Monday April 18, 2005 @12:50PM (#12270798) Homepage
    I'm not totally sure what you mean by Design document, I've seen many software shops. Some call the requirements document design, while others define the design document as the document that describes the high level description of the internal architecture of the system (system diagram, major modules, client/server decomposition, class diagram).

    Either way, I like to start with some templates I created based on IEEE standards, a few come to mind, Here's the list:

    IEEE standards pertaining to sofware engineering [ieee.org]. In particular take a look at the Software Requirement Specifications and the software design descriptions.

    Some of these are very documentation intensive, but I find that at least reading through them when starting a new project helps me direct my thoughts and make sure I don't forget anything that might be relevant to the phase in question (what? I need to think about the maintainability? the stability? the robustness?) pick and choose those things that apply to your project.
  • by (nil) ( 140773 ) on Monday April 18, 2005 @12:52PM (#12270814)
    Painless Functional Specifications [joelonsoftware.com]--not precisely what you were looking for, but pretty close, I think.
  • by CatGrep ( 707480 ) on Monday April 18, 2005 @01:08PM (#12271013)
    . . . is a prototype.

    Exactly!

    But most 'old-school' outfits using heavy waterfall processes think that prototyping is evil if you do any of it prior to writing your 50 to 100 page 'design document' (I worked at a place like this a few years back).

    Of course the company that uses Agile processes and encourages prototyping will probably get to market way before the dinosaur company.
  • Joel Spolsky Says... (Score:3, Informative)

    by tommyServ0 ( 266153 ) on Monday April 18, 2005 @01:13PM (#12271078) Homepage Journal
    I really really enjoyed Joel Spolsky's series on writing Painless Functional Specifications [joelonsoftware.com] back in 2000. Granted, this doesn't refer to design docs (or technical specifications as Joel calls them), but I think some of the ideas carry over.

    You should read the entire series, but I'll give some of the highlights:

    • You should write the spec before you start the project, not during.
    • It should have one and only one author
    • You need to flag Open Issues and Side Notes by themselves so you can search for them later.
    • The functional spec should be a living document.
    • Be funny: specs are only good if they are read. The more funny anecdotes the better.
    • Be pithy and understandable.
    • Lots of screenshots, tables and diagrams to break up long pages of text.


    tS
  • Shorter is better (Score:2, Informative)

    by dirc ( 254647 ) on Monday April 18, 2005 @01:17PM (#12271125) Homepage
    I will assume that the audience for the design documents is other programmers who have not worked on the project since its inception. With that in mind, the most useful design documents are:

    1. Short. Hundreds of pages of detailed design are useless without context. Short documents can and should provide context and pointers to other documents (or code) that will explain the details. If the document is more than about six pages long, it will be ignored by most programmers.

    2. One of many. It is obvious that you cannot describe a complex system in six pages. Try to write many design documents that are short. The documents can be a hierarchy. There should be a top level document, that refers to the individual elements that make up the system. Each element can be described in its own document. Each element's subelements can be described in their own documents, and so on, down to the lowest level that it is interesting to document.

    3. Describe major functions and interfaces. The document should tell what the system (element or subelement) does, and where the reader can learn more about the elements that implement the functions and interfaces.

    4. Describe things that don't change much. One of the problems (as noted by other posters) with most design documents is that they are not kept up-to-date. The solution is to write documents about things that don't change much, such as the overall system design and interfaces. And if the overall system design or interfaces do change, then you can usually persuade people to update the documents.

    In my view, good software design documents provide context and pointers to the authoritative documentation. Most programmers (myself included) do not trust any documentation that is too detailed, since it is usually wrong.
  • by ThosLives ( 686517 ) on Monday April 18, 2005 @01:26PM (#12271227) Journal
    "The software design is not complete until it has been coded and tested."
    I would have to disagree with this; a design is complete when it meets all requirements. A design can only be shown to be complete when it passes all testing; a subtle difference, but one that's come to my attention as being very important.

    I have to agree with the statement about traceability though. One of the worst things I've had to deal with is getting a specification document that does some stuff and then have to write the requirements "that would result in this design if we started with those requirements." This is endemic to all industries: ill-formed or ill-stated requirements. I'm always amazed at how many "requirements" are either designs or implementations or are not testable or aren't requirements at all. Even more entertaining are tests that don't test in a way that proves requirements are met...

    If I had to enumerate what makes good design the list would have to include:

    1. DO NOT START DESIGN UNTIL YOU HAVE THE REQUIREMENTS (yes, I know there are exceptions, but you should at least have *most* of the requirements first).
    2. Have a good requirements document: everything is actually a requirement (not a design or implementation) and is testable (if you have the word "not" in it, it's not testable, for instance).
    3. Make sure the design is design and not implementation (design is "sum two numbers and check for overflow"; implementation is "temp32 = x16+y16; if temp32 > MAX16 then result16 = MAX16 else result16 = x16+y16;). Put another way, despite the popular writings I've seen lately to the contrary, CODE IS NOT DESIGN (any more than a car is the design of the car).
    4. Make sure you can test that THE DESIGN MEETS THE REQUIREMENTS (which is subtly different than "does the design do what I designed it to do?"). If the design doesn't satisfy the requirements, it can never be a "good design".
    5. Separation of responsibility. You mentioned XP above where "the designer is the coder is the tester" which is just bad practice in my experience. My company *strongly* discourages the designer to be the coder, or the coder to be the tester (the designer can be the tester though, and this often makes sense). This is because there are inevitable blinders that you put on when coding your own design or testing your own code.
    Ok, that wasn't an exhaustive list by any means, but I think those are the key points. To summarise: have good requirements, separate requirements from design from implementation, and have many eyes looking at things throughout the whole process.
  • 4+1 View Model (Score:1, Informative)

    by Anonymous Coward on Monday April 18, 2005 @01:33PM (#12271307)
    I tend to use the 4+1 View Model, originally introduced in 1995 by Philippe Kruchten at Rational Software. It uses a set of different views, in order to clearly communicate a system's design (or architecture).

    The 4 views are: Logical, Process, Physical, and Development. The +1 is the Use Case view, which describes the specific requirements that influenced the design.

    I sometimes add a Data view and/or Security view. In any case, I use the 4+1 approach as a starting point and tailor it to the system at hand.

    For more info: http://www-128.ibm.com/developerworks/wireless/lib rary/wi-arch11/?ca=dnt-65/ [ibm.com]
  • Software Engineers are pretty thin on the ground. I don't know of that many. Well, truth be told, I've not seen one since moving to the US. Real design work is rarely done, and documentation is something added on at the end.


    Getting back to the original question, a design document should be divided into three primary sections. The first section should always say what the problem is that the design document is trying to address. Any given design document should address only a limited set of problems, or it will become too complex. Ideally, any given document should be small, compact and address one or (at most) two issues.


    The second section should describe how to use the solution presented to solve the problem described. In programming terms, this is your API. That is all it should describe.


    The third section should then cover how the solution goes about solving the problem. Again, that is all it should cover.


    When projects or modules within those projects are updated, it should be possible to update/replace any one section in any one document without touching any other section or any other document.


    Documentation should also always stick to the level for which it is intended. Ideally, references should be to ever-more specific information, never the other way round. So, a project overview might point to the components of that project. Each component might then point to documentation on the low-level mechanics. On the other hand, a discussion on low-level mechanics is not the right place to talk about a specific project that uses those mechanics. That gets in the way of understanding and obstructs code reuse.


    That, I think, is the key to writing good documentation. Does it positively assist those who would need it? If the answer is "no", or is even a "not sure", then it doesn't matter what standards it follows, it is useless.


    The ideal length for a document is going to vary, project to project, but by building documents in a modular fashion it should be rarely necessary to have a document longer than about 20 sides of A4. Most should be around 10 sides. Anything longer likely covers unrelated topics and can be split up. (Remember, it is easier to open 20 books to one page each, than to open one book to 20 different pages.)


    This limit gives you about 3-7 sides per section per report. If you need more than 7 sides, the design is too complex and unmaintainable over the long-haul. On the other hand, any less than 3 sides likely means that the project has been over-designed with lots of redundancy, plenty of overhead and no possibility of meeting the requirements.


    Going by this description, virtually all documentation in existance is ghastly beyond all imagining. Which, by and large, is exactly how most people see it.

  • by Lodragandraoidh ( 639696 ) on Monday April 18, 2005 @02:21PM (#12271906) Journal
    I write seperate functional specifications. If the implementation requires new machines and installation by our operations department, then I might do a presentation showing why we need it, and how to hook it up (for most things this is pretty much standard boilerplate) - and perhaps how to pay for it in an appendix to the spec.

    The software design documentation is in the code in the form of a detailed comment at the begining of the main code module explaining my design choices for each piece. I like to use languages, such as Perl, that allow me to format and extract documentation directly from my source code. I also like it to be inside of the code so I can make changes to my documentation at the same time that I make changes to the code. This is much more efficient for me - things don't get lost in the shuffle.

    Going forward my goal is to generate XML documentation for not only the design document, but also the user manual, and other documentation from the same source code. I'll have a makefile sitting in my revision control archive that will generate all of my documentation for all apps in one command. BAM! I'm done, and can then read and edit my docs at my leisure.

    The hard part is getting everyone else who touches my code to follow the same procedures.
  • by bstil ( 652204 ) on Monday April 18, 2005 @02:26PM (#12271966)
    Joel on Software [joelonsoftware.com] has another set of relevant articles. See "Painless Functional Specifications" and "Don't Let Architecture Astronauts Scare You."
  • by James Youngman ( 3732 ) <jay&gnu,org> on Monday April 18, 2005 @03:27PM (#12272736) Homepage
    Assuming that you have separate documents that include the requirements that you've agreed with the users/client, the system test battery, how the system will be operated/managed/installed, you should include the following in your high level design document (hint: high-level desgin documents include pictures but not pseudocode)

    Not all of these things will be appropriate for all systems. This is not a table of contents!

    1. Purpose & Context
      • why are we doing this?
      • helps low-level designers (who read the high-level design) to make the inevitable trade-offs in the right way, and also helps them to recognise a gap when they see one
    2. how this fits in with everything else
    3. scope (that is, what are we not trying to do?)
    4. References
      • list your 'upstream' input documents
      • sources of extra information
      • ways to arbitrate conflicting statements or to help drive the process of feeding back reports of defects in this document
    5. what is the baseline? It's important to work from a consistent set of documents:
      Know what you are trying to build; otherwise you won't know when you haven't managed to build it
    6. Assumptions
      • Check these! Often the users needs to agree to these (but make sure they actually understand the implications!)
    7. System Overview
      • The Big Picture
      • what are the interfaces?
      • what smaller components make up the overall system?
      • within the components, what are the layers? e.g.
      • presentation layer
      • application-specifc ("business") logic
      • data access, protocol handling, etc.
      • migration to/from (this verstion of) the system
    8. Explain the end-to-end processing of requests (or whatever)
    9. Main body
      • pehaps one section per interaction
        or per group of web forms,
        or per batch process
        or per ... whatever is appropriate for the things your system does ...
      • include mapping to significant parts of other documents; for example, if you have a database, show how each thing described in your functional spec is stored in the database.
    10. Error handling, exception processing, resilience issues
      • user input validaiton
      • validation of other inputs
      • error conditions; how do we distinguish
      • data/business errors - the functional spec demands that these errors must occur when the system gets this input
      • technical errors - might be fixed by trying them again later
    11. handling environment problems
      • database went away
      • pneumatic drill through network cable
      • no response from remote system
      • cluster node failure
      • out of disk space
      • server obliterated by thunderbolt
      • ...
      • But not an error catalogue (since you will not yet know the full list of error conditions; don't try to put one in here otherwise when the code is written people will represent a new kind of error as some weird variant of an old one because the old one is in the error catalogue and the catalogue is carved in stone - bad idea!)
    12. likely failure modes - and how the design prevents things getting worse in each case
    13. Discussion of configurability, scalability, performance issues, user accessibility, compliance with standards, etc.
    14. Security
      • trust boundary (which things do we trust, what information are we trying to keep safe?)
      • authentication
      • authorisation
      • data integrity
    15. Compliance matrix
      • Shows how the design meets each agreed functional (or non-functional) requirement; cross-references the functional spec to each section of the design document
      • Handy when you change the design document - it shows you which functional spec requirement might be affected and hence which of the tests will need to be redone (you do have a test battery, don't you?)
      • what parts of the design should be included but are not yet complete?
  • Anyone idiotic enough to put MS Office in a single document is asking for trouble. In the same way that programmers learn quickly to break things down into managable procedures and functions, documentation writers need to look at one small compartment at a time.


    In the case of MS Office, for example, the requirements for loading and saving documents has nothing to do with the requirements for handling macros, and none of the above has anything to do with the way that the GUI is structured.


    All of these, then, should be separate in the documentation. They are separate in function, they are separate in nature, they should be presented as separate units, because that is what they are.


    Keep doing that for the rest of MS Office and I guarantee you will find that you can document the entire of MS Office without any given unit of documentation exceeding 20 sides. 10 sides if it is designed well. (Although we know the answer to that one. :)


    Documentation writers should be forced to learn EBNF and Jackson Structured Diagrams. Why? Because these force you to think in small pieces, to modularize and compartmentalize. If you don't, you'll go nuts. Besides, it should be possible to then take a JSD/EBNF description and map one simply-connected set of rules to one - and only one - document. One document should also map onto only a simply-connected set of rules, with no overlap.


    In this case, it is not a "generalization", it is simply a direct consequence of structured programming techniques. Redundancy and Bloat Are Evil, Satanic and Despicable. Clean Designs Are The Only True Designs. Documentation is no different.

Today is a good day for information-gathering. Read someone else's mail file.

Working...