Please create an account to participate in the Slashdot moderation system

 



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:
  • Existence (Score:2, Insightful)

    by Soskywalkr ( 617860 ) on Monday April 18, 2005 @12:13PM (#12270372)
    As opposed to some napkin smudged with barbeque wings...
  • Duh (Score:5, Insightful)

    by Erwos ( 553607 ) on Monday April 18, 2005 @12:16PM (#12270405)
    Figure out which class from your local university deals with software engineering, find the book(s) for the class, and buy it.

    Writing a good design doc is mostly tedious work interspersed with lots and lots of communication with your programmers and customer.

    -Erwos
  • Be agile (Score:2, Insightful)

    by kabdib ( 81955 ) on Monday April 18, 2005 @12:16PM (#12270412) Homepage
    Who needs documentation? Just wade in with something like Scrum. Most documentation is out of date anyway (about a month after you're coding, it's useless).
  • by nietsch ( 112711 ) on Monday April 18, 2005 @12:16PM (#12270413) Homepage Journal
    This story has no posts, just when I tought it would be nice to read from others how they think about design problems.

    All I can suggest is: keep a strict separation between features and implementation.
    do some use cases that describe how the most important part (the user) will handle the program.

    And think ahead, your designs will change while building/deploying. How are you going to accomodate that?
  • by amichalo ( 132545 ) on Monday April 18, 2005 @12:17PM (#12270422)
    Be sure your DD includes:
    - Sitemap (web) or screen map (desktop app)
    - Feature matrix with columns for features, rows for pages/screens and indicators where a page/screen has a feature.
    - Detailed feature specs need to be written kinda like function documentation - "preconditions" that state what is expected as in the user is authenticated or the DB has products and "post conditions" that say what gets set or hwat the user can do.
    - Style documents greated by graphics designers who understand the medium (web/Windows API/etc) are invaluable for refering back to when someone doesn't like a font size.

    All this documenting is no fun, but it is more fun then dealing with the lake of the document.
  • by blueZ3 ( 744446 ) on Monday April 18, 2005 @12:17PM (#12270423) Homepage
    I document software for end users, and get some of my information in the early stages of development from design docs. I have to say that the most useful design documents that I've seen are ones that contain diagrams, flowcharts, and other "pictures" of how the system (or the module, component, whatnot) functions.

    If I have to choose between a 50-page design document and three pages of clear diagrams, I'd pick the pictures.
  • Audience == People (Score:4, Insightful)

    by mike_the_kid ( 58164 ) on Monday April 18, 2005 @12:18PM (#12270424) Journal
    Overly rigid structure and formatting are not helpful. Often times I think programmers are so used to writing for compilers that they forget that humans are much better parsers.

    Design documents should be easilly written and easilly updated. I prefer a text editor to something where I can have 'really nice' formatting. Its just easier and quicker, and that leads to the documents being more likely to be kept up to date.

    If the docs aren't up to date, no matter how well written or well designed they are, they are misleading and unhelpful.

  • by wiredog ( 43288 ) on Monday April 18, 2005 @12:18PM (#12270433) Journal
    The source, especially the comments. Assuming there are comments, and they don't read (I really saw this once) "Why did I do this?"

    A good design document often duplicates the actual programming process. It starts at a high level (What are we trying to do? How do we do it?) and drills down to the level of what each function (or class method) should do. It should define acceptable inputs and outputs, both overall and for each method. It should also define the unacceptable ones. You should be able to generate the unit tests from it as well as the actual program.

    It should leave room for changes if you find out that using methodology Bar to implement Foo doesn't work.

    The Final Document should be based on a reading of the code, and any differences between that and the pre-code spec should be documented as to their cause.

  • by davidwr ( 791652 ) on Monday April 18, 2005 @12:18PM (#12270435) Homepage Journal
    The biggest problem I've had with design documents is that they aren't updated.

    When first written, they are good and complete.

    As the project moves along and the design changes, the design documents aren't updated. If you are lucky, new features will be covered in errata documents, but old features that were found to be not feasable remain in the document, without any indication of why they were removed from the project.
  • Interfaces (Score:4, Insightful)

    by dsplat ( 73054 ) on Monday April 18, 2005 @12:20PM (#12270453)
    There are lots of things that can, and arguably should, be documented in a design document. One category that should never be omitted is the interfaces. Whenever a system or subsystem interacts with something else, you need to know how. This includes:

    • Database schemas. Unless your DB is so well hidden that no one will ever find it, someone will want to read it some day.
    • APIs you support or use. If there's a standard or a 3rd party product, just list it and the version.
    • Command line parameters for those little maintenance tools you don't tell the users about. This is a design doc, not a users' guide.

  • There are a lot of things that can be said, but I think the biggest problem with design docs is that they aren't kept up-to-date.

    If you're really serious about having useful design docs, the only way to do it is to have a dedicated staff whose job it is to keep it current, accurate and useful. Coders are rarely good writers, and even if they are, it's almost impossible to get them to keep docs in sync.

  • by PIPBoy3000 ( 619296 ) on Monday April 18, 2005 @12:24PM (#12270493)
    . . . is a prototype.

    To be honest, I find that customers have a hard time visualizing how something will work unless they can interact with it. I'll take some internal design notes for myself, then whip up something and reiterate.

    This approach doesn't work well with some projects, but for the small web applications I make it works great.
  • by nietsch ( 112711 ) on Monday April 18, 2005 @12:24PM (#12270502) Homepage Journal
    Write them before you write the new features, to test for the new features.

    This will save you eons when you are actually coding. Way too many testers are still wasting their time with manually going through the ssame maotion again and again to make sure it all works as expected.
  • by mveloso ( 325617 ) on Monday April 18, 2005 @12:24PM (#12270508)
    If your product has a UI, then the design document should start by describing the UI and how all the features work.

    If you don't have a UI, then start from the configuration file or command line switches, and do the same thing.

    Then you're done. If you can't configure a feature, or can't trigger it from the UI, then it shouldn't exist...unless there are other interaction points.

    If you have a network app, document the wire protocol, range of input values, and expected behaviors (of your app and its clients) and outputs.

    If it's a distributed system, figure out the different states and document them.

    It's actually a pretty simple, though tedious, process. Starting from the UI is a great place, because it shows you instantly how complicated your app is. If it's too complicated, this type of document will show that pretty quickly.
  • by Anonymous Coward on Monday April 18, 2005 @12:24PM (#12270510)
    Existence.

    At least for most of the projects I've worked on.
  • by tcopeland ( 32225 ) * <tom&thomasleecopeland,com> on Monday April 18, 2005 @12:25PM (#12270515) Homepage
    Don't document every function and class. That's useless; let Doxygen or Javadoc do that.

    Instead, document why you chose PostgreSQL over [foo]. Why you chose to roll your own templating system. Why you fork off jobs in a separate process rather than doing them in one process. Why you wrote this particular thingy as a C extension.

    Documenting that stuff will be helpful to folks down the road when requirements/environments/whatever changes and they wonder why things were done this way in the first place.
  • Re:Duh (Score:5, Insightful)

    by JackAtCepstral ( 870238 ) on Monday April 18, 2005 @12:28PM (#12270563) Homepage
    "I doubt many software engineers got into the business to write documents."

    No, that's just it. People often ask the difference between a Software Engineer and a Computer Scientist. This pretty well covers it. Ideally, a Software Engineer is an Engineer like any other. A major portion of their work is designing and documenting. Like how a Structural Engineer would create blueprints. Also ideally, a Computer Scientist is a scientist like any other. He investigates the world of computer software - experimenting and recordign the results.

    In the real world, the roles of both blurr into "the customer wants this, code it." But to live up to the title of Software Engineer, you need to be much more proactive and be very involved in the non-programming aspects such as requirements gathering, documenting, designing, documenting, prototyping, documenting, and documenting.
  • by jcomeau_ictx ( 696704 ) on Monday April 18, 2005 @12:29PM (#12270576) Homepage
    I don't know, but then, I've never seen one of these rumored documents, so I can't say for sure.
    Sure, you have. RFCs are my idea of what makes a good design document: tell me what I have to do to make this software interoperable with the rest of the world, what you want this software to accomplish (including sample gozintas and gozoutas), and that's it. Short and sweet. Now get out of the way and let me code. :^)
  • by Loitl ( 876962 ) on Monday April 18, 2005 @12:31PM (#12270602) Homepage
    The most importnat part of a design document is to document what is NOT going to be implemented.
  • by rjh ( 40933 ) <rjh@sixdemonbag.org> on Monday April 18, 2005 @12:36PM (#12270657)
    ... the "this is how it really works" document. That's what you're really interested in. There's nothing wrong with the design documents you've seen.

    No, I'm not kidding.

    The design documents which have driven you mad probably weren't incomplete. They were probably quite complete design documents. But a complete design document isn't supposed to cover everything. If you had a design document that was fully specified in every significant detail, you could run the design document through a compiler and generate your code. (This isn't as far-fetched as it sounds; there are tools to automatically generate large amounts of code just from simple UML diagrams. That's an example of design documents being translated directly into running code.)

    A design document can best be viewed as the development team's prejudices regarding the best way to solve the problem. There will be holes in the design document, mostly in those areas where the programming team doesn't really have a good grasp on what the best thing to do is.

    A good design document is a like a good steak; they're best when served a little bit rare. You want to give the guy who comes after you a game plan, but you don't want to commit yourself to doing things in one particular way when you don't know if that one particular way is going to work. After all, once the design document has had every stakeholder sign off on it, going back to the drawing board and saying "uh, this isn't going to work, let's try something else" means all the stakeholders get back on board again. But if the design document has some room to move--what you think are "holes"--then that gives the programmers freedom to get the job done without having to go through the entire design approval bureaucracy again.

    Most serious software engineering shops worship at the altar of requirements and architecture documents. Hackers in the trenches add the "this is how it really works" document to that list. There's nothing quite as valuable as stumbling across some prior hacker's notes when you're trying to grok the system.

    Stop looking at the design document for the 'missing' stuff. It might very well have been deliberately omitted. Start asking around for the "this is how it really works" documentation, instead.
  • by mikesmind ( 689651 ) on Monday April 18, 2005 @12:38PM (#12270681) Homepage
    You can write the best design document around, but if it doesn't address the requirements, it won't produce a good result.

    I think that most requirements gathering activities don't involve the right people. Most importantly, they should involve the developer. I have seen requirements sessions involving only the business analyst, an IT lead, and the project manager. They leave out the developer! Usually it is done because the developer is busy with other things.

    If you leave the developer/programmer out of the requirements work, they never get the opportunity to understand the requirements and ask questions as the requirments are formed. If you do these two things, you will get much better designs.

  • in English (Score:3, Insightful)

    by kin_korn_karn ( 466864 ) on Monday April 18, 2005 @12:40PM (#12270700) Homepage
    Having someone that can speak and write English do it will go a long way. My current project is working from a design generated by an Indian guy that has no clue what half the words in the language mean. I resent having to rely on half-assed work when I'm not in a position to advise on the design. It's not hard to run the grammar checker.
  • by yagu ( 721525 ) * <{yayagu} {at} {gmail.com}> on Monday April 18, 2005 @12:40PM (#12270704) Journal
    Unfortunately, templates and standards for design documents rarely are left to the hapless development staff but are instead left to the people who don't have to read them... Oh, they have to look at them, bind them, distribute them, and related "business" machinations, but they don't really have to READ them, and thus far too often technical teams are left having to shoehorn designs into inappropriate, rigid, and non sequitor documents. If this were an only-one-time experience in my career, I'd have more hope, but I've encountered this phenomenon over and over.

    For the record, I agree: Design documents should be easilly written and easilly updated. I prefer a text editor to something where I can have 'really nice' formatting. Its just easier and quicker, and that leads to the documents being more likely to be kept up to date...., but ability and common sense about what documents SHOULD look like is far less likely to be the obstacle than the policy governing design documents.

    Your mileage may vary. Good luck! We're counting on you.

  • by ring-eldest ( 866342 ) <ring_eldest.hotmail@com> on Monday April 18, 2005 @12:40PM (#12270705)
    How does the classic quote go? If it was hard to write it should be hard to understand.
  • by __aaclcg7560 ( 824291 ) on Monday April 18, 2005 @12:40PM (#12270708)
    Video game design documents are tricky beasts.

    If the design document is underweight, it was good enough to trick the bean counters into giving up the first check. But you really can't use it to build test cases out of it since the developer can add or subtract whatever they want.

    If the design document is overweight, you can build test cases with a fair degree of accuracy over the life of the project. The problem is that some developers will bristle at being held accountable for every detail promised and don't like their milestone checks being held up until they deliver the goods.

    The ideal design document that lays out what to expect without too much overwhelming detail and the developer delivering to full spec on time probably doesn't exist. At least, not in the video game industry.
  • by gvc ( 167165 ) on Monday April 18, 2005 @12:41PM (#12270713)
    Much of software engineering is received wisdom. It involves little engineering and even less science.

    I draw the analogy to medicine in the 19th century because at that time physicians were finally trying to investigate the causes of disease and developing insight that, more than a century later, would lead to their interventions improving rather than diminishing life expectency.

    Nobody knows what "best practice" should be, yet we're codifying a process. The design document is one aspect of this process. Rarely is the purpose of a design document to convey design. Rather, it is a "deliverable" presented to a PHB or client as evidence of progress. To this end, the larger and prettier it is, the better.
  • by jmh_az ( 666904 ) * on Monday April 18, 2005 @12:43PM (#12270732) Journal
    A good design document starts with good requirements. It also requires that your process have some way to capture and fold changes back into the documentation as necessary.

    A good place to look is "Software Requirements--Revision" by Alan Davis (1993). I don't agree with everything Davis has to say, but the book is full of good ideas and potential "gotchas" to watch out for. Another good reference is DO-178B, the guidelines used for the development and testing of safety-critical software in commercial aerospace applications. It is available from the RTCA [rtca.org] for about $50.

    If you're doing an OO project, then you might want to look at Booch's book: "Object Oriented Analysis and Design" and the UML 2.0 specification .

    But, most importantly, you MUST have some kind of design documentation (requirements, at a minimum) and that documentation needs to be flexible enough to accomodate changes without causing everything else to grind to a halt while the revisions happen. Expecting to get good software with inadequate formal documentation, minimal planning and insufficient requirements is why 70% of all commercial software projects end in failure (documented and published statistic).

    Anyone who says you can do good software by shooting from the hip is nuts. And they don't work for me.

  • Re:Duh (Score:3, Insightful)

    by smittyoneeach ( 243267 ) * on Monday April 18, 2005 @12:44PM (#12270745) Homepage Journal
    C2 [c2.com] lays it out.
    School is about learning the terminology and trying to get the most egregious errors out of the way, so that, after graduation, real work can commence.
  • Hate to Say It (Score:3, Insightful)

    by Stormcrow309 ( 590240 ) on Monday April 18, 2005 @12:52PM (#12270813) Journal

    Read Wieger's Software Requirements [amazon.com] from Microsoft. It is a very good book to work on. Mainly, our process is:

    1. Get User Requirements By Process Reviews, Functionality Studies, and User Panels
    2. Translate Everything into Use Cases
    3. Write User Requirements Document, specifying everything into Must Haves, Nice Haves, and Too Bads
    4. Have technical team review and impose technical requirements and organizational standards
    5. Write Software Requirements Document from User and Technicals Docs

    At least that is what we try to do. Half the time, it is 'You bought what?'

  • by brett77 ( 808513 ) on Monday April 18, 2005 @12:54PM (#12270833)
    I believe very strongly in a formal Requirements Analysis (RA) document that the end user will sign off on before any development begins. The RA document is a means for the developer to thoroughly document and understand the problem, and also for the client to understand what he/she will receive at project completion. The various projects I have worked on have had differing RA documents but they all have some boiler plate sections:

    Purpose

    Requirements

    Definitions

    Business Rules

    Use Cases

    Wire Frames (UI)

    All of the terminology within the document is non-technical and basically describes the said business process and the proposed technical solution. In my experience the clients always flip to the wire frames section of the document, since this is the easiest thing for them to understand (pretty pictures!). A wire frame is really just a stencil of a screen created in any modeling tool.

    So now you must be thinking why is he mixing design with definition work? I'm sure some would argue that the wire frame need not be in the RA document, since this is really design. However, a client may find it easier if they can walk thru the use case while looking at a screen representation.

    Once client sign-off has been obtained that's when we get into the fun design stuff. Depending on the said tasks complexity you can utilize UML to further document the process. Any design documentation will be separate from the RA documentation but it will accompany the RA document when handing off to a developer. To me the single most important design document is the class diagram, and depending on complexity possibly a sequence diagram. I use UML on an as needed bases, you'll never need it all, but pick and choose different pieces as you see fit.

    The 5 D's of software development:

    Discover (Business Briefs)

    Define (RA Document)

    Design (UML)

    Develop

    Deploy

  • Re:Duh (Score:5, Insightful)

    by CastrTroy ( 595695 ) on Monday April 18, 2005 @12:55PM (#12270851)
    This is where my classmates coined the phrase UML Nazi. Some professors were so obsessed with producing "proper UML" that the diagrams the professor asked for didn't really explain how things worked, and the documents that explained how things actually worked, got shot down as not being proper UML.

    A lot of the time, we just put diagrams that made sense to us, and that worked a lot better than trying to make proper UML documents.
  • by couch_warrior ( 718752 ) on Monday April 18, 2005 @12:59PM (#12270905)
    Here's a cynical view of a system lifecycle
    1) A company has a business process that isn't working well because it is understaffed by poorly trained and unmotivated personnel
    2) The company decides to automate the business process to make it "more efficient". In the project charter, they justify the project by promising further staff cuts.
    3) A project team is formed, and the IT department interviews the poorly trained unmotivated users to gather "system requirements". Which end up covering only a small fraction of the actual business process because the users don't care.
    4) The IT department realizes the project is hopeless, and uses lack of resources as an excuse to bring in "consultants".
    5) The consultants poor concrete on the system requiremnts to avoid "scope creep", ensuring that the resulting system will be functionally useless.
    6) The consultants carefully build a system that meets a minimal interpretation of the sparse requirements.
    7) In testing it becomes obvious that the system meets the paper requirements, but is functionally useless to the actual users.
    8) The IT department offers the consultants follow on work in return for helping IT blame the users. The users get a staff cut.
    9) The system is declared a victory, and bonuses go to the executives who weren't involved.
    10) The consultant is hired to fix the system, now called "Phase Two"
  • by CatGrep ( 707480 ) on Monday April 18, 2005 @01:01PM (#12270923)
    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

    Exactly. I used to work at a company that had a 50+ page document that was supposed to be used as a template for design documents - a sort of meta-design document, I suppose. Problem was that things rarely fit into their preconceived ideas. It definately led to unreadable documents. The other problem was that the procedure to change the design document was so draconian that everyone was hesitant to change anything even though it would become clear that things needed to be changed when the real world crept in. (BTW: this company allowed absolutely no prototyping prior to finishing the almighty design document - for those of us who like to prototype, it was frustrating)

    I'm thinking that wikis are the best way to both communicate and develop a 'design document'. The design document should be flexible and wikis fit the bill. The design document should show the history of thinking about the design and again, Wiki's fit the bill quite nicely as you can look back and see the discussions that took place that led up to various decisions.
  • by jimbro2k ( 800351 ) on Monday April 18, 2005 @01:11PM (#12271057)
    In addition to a design doc, which you may or may not need to update, depending on how I interpret your immediate task, you really should have a maintenance document.

    Design Docs tell the reader how you intend to build something. In many shops (depending on the SDLC version, if any, that they use), it has little value after the design review.

    As a roving consultant, I've seen a lot of crappy documents and SDLC (et.al.) procedures, and what has the greatest value for the programmers who come later is a Maintenance document that specifies:

    1. The overall philosophy of the design: Why specific design choices were made.

    2. What things did you want to implement (and why) but were postponed to a later version.

    3. What design decisions were specifically rejected (and the reason).

    4. Where are the system's weaknesses?

    5. What are the coding standards specific to this particular project?

    The Maintenance Doc provides guidance to the people who have to work on this stuff after you're gone (and to you, unless your memory is perfect). More than anything else, they will need to know the why of the design, not the what.

    In my perfect world, the maintenance doc would be the main appendix to the design doc.
    However, in most shops, the SDLC & its policies & procedures will prohibit that, and usually acknowledge neither the existance nor desirability of a Software Maintenance Document.
    Good Luck.

  • by damacus ( 827187 ) on Monday April 18, 2005 @01:15PM (#12271101) Homepage
    Start a Wiki from the get-go of the project and keep your notes. Over time, as the implementation changes, it'll be easier to keep the information (as your own reference) up to date as things proceed. Once you consider things usable, you can start forming official documentation using your Wiki as a guide.

    As another said, "All I can suggest is: keep a strict separation between features and implementation. do some use cases that describe how the most important part (the user) will handle the program."
  • by aziraphale ( 96251 ) on Monday April 18, 2005 @01:22PM (#12271183)
    Maintenance coders typically get asked to do things like this:

    - add a button to screen A that does function X
    - change the layout of screen B so that it shows ALL of the widgets in chronological order

    etc.

    To do that, you want to start off with a nice diagram of the screens showing which UI elements come from which classes/controls/include files/etc. so that you know where to go and start looking at code.

    90% of software design is about putting code in the right place. That means architecture consists, mostly, of telling codemonkeys where to go and put their code. When an architect is attached to a project, they can tell the codemonkeys directly - 'make a class called Foo, give it these methods'. Once the architect's gone, and the codemonkeys are maintaining it, the design documentation is the only hint any of them will get as to where is the _right_ place to put code.

    In those situations, nice block diagrams showing which bits of code make which bits of which screens can be a real help.
  • by sconeu ( 64226 ) on Monday April 18, 2005 @01:49PM (#12271486) Homepage Journal
    The problem is when the prototype becomes the final product because TPTB don't want to waste money re-doing it.
  • K. I. S. S. (Score:2, Insightful)

    by marcus ( 1916 ) on Monday April 18, 2005 @01:51PM (#12271499) Journal
    The Fundamentals: Interfaces and Constraints and that's about it.

    The bare minimum is often the best. So, include precise definitions of the interfaces that the code has to meet, including any tests that it must pass and the constraints within which it must fit.

    If it is firmware, then hardware interface specs must be included as well as whatever interface the firmware must provide for other system code. Add to this performance constraints or requirements and you are done. Leave implementation for later.

    If it is module constructed in isolation, again the interfaces must be clearly defined and performance requirements declared.

    Constraints define the resources allocated to the code. Performance requirements are a sort of constraint on time and hardware allowed. There are also other constraints that are usually implied but not stated like how long the engineer has to implement, test, debug, etc. This is effectively a cost constraint.

    Implementation can also be documented, but is not fundamentally a part of a design spec. Sometimes code comments can be enough. Sometimes a few notes about competing implementation ideas and why one was chosen over the others can be helpful, but not as part of a design spec.

    Keep It Simple Stupid - define what the module(s) must do, what tests it(they) must pass and that is it. If you do this right, then the implementation can speak for itself.
  • Re:Duh (Score:3, Insightful)

    by rleibman ( 622895 ) on Monday April 18, 2005 @01:51PM (#12271502) Homepage
    That's why you go to school. Much of the learning is formative, you'll use little of it in "the real world", but you'll learn "how to learn". Do I use all those years of integrals and derivatives? No, but they trained my mind into the proper engineering mode. While in school, follow the excercises, once you are outside you'll quickly figure out what works and what doesn't, and sometimes, you'll find yourself coming back to things you learn in school a long time ago.
  • Re: Duh (Score:5, Insightful)

    by gidds ( 56397 ) <slashdot.gidds@me@uk> on Monday April 18, 2005 @01:53PM (#12271519) Homepage
    Indeed. For me, the most important thing to remember about UML, and other methodologies, is this: They are tools to be used, not rules to be followed. Too many PHBs (and colleagues) don't seem to understand this.

    The most important thing for a document is to communicate. UML is a very good way to communicate that sort of information (when everyone understands it). But it's not the only way. Use whatever's best. If a few lines of text on a scrap of paper, or an ad-hoc diagram you've just invented, will communicate better (with your memory, with your immediate colleagues, and with anyone who might be maintaining the system in future), then by all means use it! Anyone who insists on UML or whatever for the sake of it is missing the point.

    The main problem with these methodologies is that there's no way to force people to think clearly. You can encourage it, certainly; you can make it easier to do, easier to communicate, and easier to spot its absence; but you can't force it. Following the procedure is no guarantee of clear thinking -- and it's that clear thinking which gets projects designed and built.

  • by rjh ( 40933 ) <rjh@sixdemonbag.org> on Monday April 18, 2005 @02:25PM (#12271949)
    This is not an insult. I want to make that very clear, right up front. That said:

    Go take a software engineering course. There's a lot of wisdom that's been accumulated about how to write reliable software, and while (IMO) about two-thirds of it is utter rubbish, one-third is really good advice. Learning software engineering is like eating pufferfish: really cool, but be careful what you swallow. You'll learn about requirements analysis, drafting a coherent requirements document, architectural analysis, drafting a coherent design document, interpersonal skills needed to get people to sign off on your ideas, time management, resource allocation... computer programming isn't the same as software engineering. Very little software engineering is concerned with computer programming--less than a quarter, in my experience.

    It's a fun subject. It teaches you how to tackle big projects, and have a reasonable chance of success at them. 70% of all software projects fail, but the 30% which succeed include some of the most fun projects you'll ever see. Take a software engineering course. It's fun, and you'll be hunting much bigger game once you're through. :)

    Now, that said... you ask reasonable questions, you get reasonable answers. Design documents aren't exercises in futility. In fact, they're essential. For any nontrivial software project, at least 75% of the codebase is trivial--and since it's trivial, that means there are a few thousand ways to do it. A design document lets the entire team know precisely how the trivial parts are going to get solved, so that the team can all be on the same page when it comes time to tackling the big stuff.

    In a good design document, the hard parts are underspecified for exactly the reason you mention; you go through a lot of bad ideas on the way towards finding the Right Thing.

    Design documents come in two varieties: the kind which is written by one person who has final authority, and the kind which is written by committee. If it's the former, the design document will have in big boldface letters at the header and footer of every page, SUBJECT TO CHANGE. If you've got one of these and your copy of the design document is more than 24 hours old, go check another one out of CVS. These design documents change very quickly as the development teams try different approaches. Unfortunately, the latter is more common--in which case just getting everyone to agree on the design document is a labor of Hercules, so usually the middle is left underspecified so that the programmers can do whatever the hell they need to do without needing to go back to the committee.

    After the project's done, one day should be set aside to document "okay, now this is how it really works...". That document stays inside the engineering pit. When people need to learn how the package works, they read the requirements (to learn what it does), the design (to learn how the trivial parts work), and the How It Really Works (to learn how it really works).

    Hope this sheds some light on the documentation issue. :)
  • by astavans ( 876998 ) on Monday April 18, 2005 @02:35PM (#12272070)
    One thing that stuck with me after Fred Brooks' book was something to the effect of "A good design document doesn't just specify what the program does, but also, as importantly, what it doesn't do". And that, I can vouch from experience, is a very useful thing to have in a design document. Ruchir Astavans
  • by Jboy_24 ( 88864 ) on Monday April 18, 2005 @02:43PM (#12272185) Homepage
    Reading through some of the comments it seems that other engineers and those that havn't progressed to that level, don't indicate who should be reading the design documents. The audience for design documents are your collegues. Before you begin your document you should start by reading theirs. A good PHB should force you to.

    A good design document should describe what you want to build, what you need to change in the existing system and what your dependancies are to name a few. It should spell out how you want to order you classes (UML!), most importantly how you will use the global classes (like an user class).

    Therefore, if any one of your colleagues can read your document and think one of the following thoughts your document was a success:

    "Oh Joe wants to use the user class like this, I guess I won't change it to stop that from happening"

    "I don't think Joe knows that I'm building a Foo class since he thinks he's going to build one, I'll email him and we'll decide who's going to do it"

    "I see that Joe has this great system designed, but he seems to be forgetting the requirement that we have to let the end-users configure it through the app and he's only using property files. I'll email him and make sure he didn't forget that."

    "Uh... what the hell is Joe thinking, there's an existing class that does exactly what he wants to do, why did he waste his time writing this document?"
  • by BigOrangeCup ( 827350 ) on Monday April 18, 2005 @03:13PM (#12272582)
    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).
    While, I agree with the rest of your post, I have to disagreee with this. Code is just a more detailed level of design. Any time I write any code to implement any specification or higher level design description, I make many "design decisions". Just because code requires that you conform to a certain specification and is usually (more or less) the last step before testing doesn't make it the implementation. The implementation of software is the actual running program - there are many other layers of "processing" that must occur between code and a running program (compilation or interpretation and execution by the computer itself). Each of which can give you different results depending on how the code was written.

    I often consider code the "detailed blueprints" of a piece of software. To use the construction analogy:

    An architect describes a new building at a high level. (high level design)

    A civil engineer designs the building generating the blueprints (aka code).

    Contructions workers implement the design by putting up the building (compile and run).

  • by israfil_kamana ( 262477 ) <christianedwardg ... l.com minus poet> on Monday April 18, 2005 @03:18PM (#12272640) Homepage
    The five steps enumerated here are, sadly, rather untenable. In particular, points one and two make a fundamental assumption that I believe is invalid - get your requirements first. If we have learned nothing in the past 40 years of software, and especially in the last decade, it's that we will never have "the requirements." We will have subsets, or views of the requirements, true. The fact, however, is that requirements change during the life of the product development.

    Skipping to point four for a moment: I would argue that the requirements should be expressed in the form of tests - functional, unit, or otherwise, and that these tests be executable. The design MUST therefore meet the requirements. This then means that point number three may or may not apply.

    I agree that code is not design. Design is abstract, and code is not. And pure-code-no-design folks go overboard in my view, but if you can't have complete requirements (and you can't) then you certainly should document that which is not obvious from a structural breakdown of the code itself. Particularly, documenting risky or unusual features of the code, such as tortured relationships and their semanitcs. To me that is the limit. Document what is not obvious, do not document what is structurally implicit, or otherwise explicit. Documentation covers risk, and risk mitigation points (ie. person hours) are best spent making better software, except when documenting something that, if left unsaid, might lead other developers to an incorrect assumption or conclusion.

    As to point number five, your experience may vary. In my experience, it's quite the reverse. But in the example I'm thinking about, we didn't have each individual designing - the whole team designed together, and the whole team coded and tested, and never alone. Also, design changes, or any changes to assumptions (or APIs, or etc.) were well published throughout the team, so that there was ongoing restatement of context. If anyone thought that something was an odd or interesting design feature/artifact, they mentioned it, and the author clarified it and documented it. I don't think having individuals altering design outside of a process of consultation is wise, and I think this "cowboy" flavour of agile developent is abortive and a throwback to no-process development. However, small teams that are engaged collectively produce, in my experience, excellent design. You then need to capture what is not obvious, or somewhat obfuscated, and especially capture assumptions.

    Where ThosLives and I would agree, however, I think, is that you need to trace design aspects to requirements. You may not have final requirements, but you always have some, and you shoulnt' make design decisions without a requirement to trace to. In this sense, you absolutely must have tracability from requirement to design to implementation to proof (test). And if requirement can be expressed as a test (not all requirements can), then that is, in my view, the best way.

  • by ThosLives ( 686517 ) on Monday April 18, 2005 @03:22PM (#12272686) Journal
    I think people misunderstand what happens when code is compiled. Compiling is not "the compiler uses the source code as instructions to produce an executable"; it's merely a translation of human-readable instructions into computer-readable instructions. I can "read" code and produce the same results by stepping through by hand; the executable code does the same thing (generally much faster). In this sense, the code *IS* the final product; the Reeves article incorrectly equates compiling to building. The "building" is the writing of the code. Compiling is more like translating a book from English to some other language.

    When I use the blueprints for an automobile to build the automobile, I get something different than the blueprints. I cannot use the blueprints to emulate the functionality of the vehicle. The blueprints are instructions to build the vehicle.

    In software, the design is the thing which tells me how to write the code (have you ever tried to read code and find out what the function is supposed to do? generally you can only know what it does, not what it's supposed to do. Sometimes you get lucky and the design is written in the comments, but that's rare; generally comments just say "we watch out for overflow here" or something like "use pointer rather than array lookup to avoud some tricky thing" - comments are usually descriptive of what is going on, not why). If I have a good design I can write it in any language and meet the same requirements. That's a good litmus test for software: if it depends on a language, it's not a pure design. If you have to figure out what's going on to translate into another language, you're in implementation rather than design.

    I will grant, however, that there are some difficult situations when you have a requirement "you shall use language X for this project", or "we decided to use language X to meet these requirements" - what happens if that requirement changes halfway through and your "design" was language specific? You're hosed. Good designs are language transparent.

    Remember, the goal isn't to produce an application, the goal is to meet the requirements. The design tells you how you are going to meet the requirements ("have a text grid input box" and, at the next level, "have a function that draws a text grid input box") and the code fulfills the design ("textgrid.draw()"). (Note that some design decisions become requirements for a lower level, such as function calls, interfaces, etc.). Code should only be implementation.

  • by zorander ( 85178 ) on Monday April 18, 2005 @03:37PM (#12272906) Homepage Journal
    All of this talk seems to assume that there's at least some excess manpower to be thrown at the problem, that the customer knows what they need at the time of specification, etc. It doesn't allow the softare to become what it was meant to be, but only what the potentially narrow mind of one designer allows for early in the process.

    I work in control systems. We have in-house motion control software that we use to do weird jobs. This software is not as featureful or complete as the packaged solutions, but it is cheap to deploy, and designed to be expandable and flexible. A project might entail anywhere from a few hundred to a few thousand lines of custom code that sits on top of the 30-40klocs of core code.

    When a customer requests a CNC retrofit of an old or weird machine, they seldom have any idea how the machinist on the floor actually uses the equipment. They see the problem as a basic one--the machine takes too long at X or the machine lacks capability Y. The machinist is not really a programmer and isn't mentally prepared to make the leap to writing a specification.

    The solution to the problem was for me (a programmer) to go into work with the machinist for a few days when the software was about half done and help him make the parts he needed to. Even though the software was incomplete, I could at least step around any immediate problem by throwing a little bit of prototype code at the problem and get the operator's feedback regarding the process as a whole and how it could be changed to make his life easier.

    I guess the point I'm making isn't fully formed, but all this talk about design processes seems to be missing the essence of that project, which was only possible by allowing the sole user of the software and the programmer to spend time collaborating. For much of the coding, I brought my workstation to the factory floor and worked right there. It made testing much easier and let me ask the operator questions whenever an issue arose that hadn't been forseen by my boss or his when they planned out this task and designed the system. I would, of course, run major changes by my boss first, but he pretty much trusted what the operator and I were figuring out.

    We've been providing custom software to this company for several years. It's pretty much run without issues and has saved them huge amounts of money, essentially by optimizing a handful of machines in there shop. The project would never have gotten off of the ground if we'd been caught up in these sorts of formal processes. We don't have the manpower, or the timeframe.
  • by RodRandom ( 734200 ) on Monday April 18, 2005 @05:41PM (#12274638) Journal
    You have to come up with as objective and purely functional a set of requirements as possible, if only for the reason that (most of the time) you have a customer and a contract, and the requirements are what the customer signs off on after testing instead of suing you or witholding payment(and believe me, they'll try it).

    Clear requirements are your protection against politics in the client's office, using your project as a stalking horse, and many other unfair surprises of the business world.

    If you have responded to an RFP, the requirements process allows you to restate over-specific, vague, or non-optimal customar requirements into a form that is testable and clearly specifies the functionality that is to be encoded. You restate what the client gives you, and negotiate until agreement is reached.

    You have to have enough requirements to specify the functionality that you are committed to providing so it can be verified, and not so many that you wind up with a government ashtray that does work but costs five times (or five thousand times) what it should because it is over-specified.

    This presumes a process of iteration and clarification that may well continue throughout the development cycle, and may be formalized in a number of different methodologies. But the principle of agreeing on requirements and proceeding on the basis of the agreement is essential to any productive business process, no matter how iterative.

  • by jschrod ( 172610 ) <{jschrod} {at} {acm.org}> on Tuesday April 19, 2005 @04:17AM (#12279360) Homepage
    I'm a CEO, and my company is profitable since 1995 -- I know the risks and the opportunities of projects and associated contracts.

    But I also know that non-insistance on precise, predefined requirements got us lots of contracts; in especially the circumstances that our customer doesn't know exactly what he wants and that it is part of our job to find that out.

    There are other ways than technical or functional requirement specs to bring this shared understanding in a contract and manage the risk for both sides.

    Good IT projects don't react or ride the waves of change, they create them. And these are typically projects where one doesn't have functional requirements up front.

  • by Sir Tristam ( 139543 ) on Tuesday April 19, 2005 @08:46PM (#12287965)
    "Users without such-and-such authorisation may not change property yada".

    "Only users with such-and-such authorisation may change property yada"

    Don't try and tell me those aren't functionally equivalent.

    Okay, but they aren't functionally equivalent. In the first spec, are users with such-and-such authorization allowed to change property yada? Although it implies it, the specification doesn't actually say that they can. The permission is actually undefined; the "unboundness" that the parent is talking about. The second specification is unambiguous about users with such-and-such being allowed to change the property.

    Chris

Happiness is twin floppies.

Working...