Hands up all you developers out there who document your in-house IT projects properly. I thought so! Almost nobody does. Good documentation makes software projects easier to use and maintain, but is seldom written well, and sometimes not written at all. Documentation is usually left to the end of the project when interest has wained, and not seen as adding much value. It is something developers would rather not do, something that is put off as long as possible, hoping the need for it will fade away. Unfortunately all that fades is the memory of the project, making the code yet harder to maintain.
An ounce of prevention is worth a pound of cure. Let me illustrate that with a personal experience from last winter in San Diego, California, when we had the 3rd wettest winter on record. For some time I had suspected my roof might be developing problems, and early in the previous summer I had hired a roofing company to check out and fix the roof. During this process my neighbor (who has the same house design) asked the price. Being neighborly I told him, and got a look that said... "You haven't got leaks - you must be nuts!". In due course my neighbor was transferred to Japan for a 3 year tour of duty, and he let his house to tenants. Came the winter rains and water started pouring though his roof, damaging dry wall inside. Of course tenants don't get problems fixed as fast as home owners, which made it even more expensive. I'm guessing, but he probably paid at least 5 times what I spent for his repairs. Had he been proactive in fixing his roof, his costs would have been much lower.
Likewise, good documentation significantly reduces the cost of using and maintaining software down the line. Timing is everything. The sooner documentation is written, the less effort it takes (because it is fresh in peoples' minds) and the better the result. But the real trick for producing good documentation with minimum effort is to turn it into a collaboration project between developers and users.
Collaboration to the rescue
If we in the IT world are so interested in electronic collaboration, why don't we harness it to help us solve the documentation problem? The secret to improving documentation is to efficiently harness the thoughts and input of all involved in the project when they have thoughts and input. The labor of writing the documentation is not so much the actual writing of the text, as knowing what to write. Timing is everything, for example developers should document the purpose of a field when that field is created. And if end users have a problem with that documentation, they must be able to add comments, ask questions while they are working with the software. A good example of a collaborative documentation project is Wikipedia, the on-line encyclopedia. You could consider collaboratively maintained documentation a moderated wiki project.
Essentially the idea is to turn every page into a collaborative effort. To implement this, end users and developers must be able to add comments to a page while they are reading it, because that is when they see the problems. Typically users will find that...
- Documentation is ambiguous. Other people don't make the assumptions the author made, and immediately see ambiguity problems that the author will never notice. And as more users from different cultures mix, the potential of ambiguous writing increases.
- Documentation is wrong - it is out of date, or there is a bug in the code - and it does not behave as expected.
- Documentation is incomplete, either partly or totally missing.
Every page of documentation has an owner. When users add comments to that page, the owners are notified by email. After reading the comment the owner then initiates an action, e.g. posting a potential bug to development, correcting the documentation etc. Once the problem is taken care of, the comment discussion is archived and the updated page is ready for use again. In this way documentation becomes almost "self maintaining". You can see simple examples of this on the web at the bottom of technical pages, e.g. on the Lotus Notes Knowledgebase they ask several questions and solicit you input. While this is a step in the right direction, it usually is a very weak implementation of collaboration because there is no ways for the doc owner to contact the person who made the comments.
One further collaborative though it to use IM (Instant Messaging) in the documentation. This is an intriguing idea that I have yet to try in a meaningful way. However, if you use the Lotus Notes client and Sametime together it is trivial to add.
What is software documentation?
Let's begin by defining what we mean by software project documentation: It is a collection of documents related to a software project, aimed at a target audience for specific purpose. Any software project has several kinds of documents associated with it. At a high level these are...
Document Type | Target Audience | Purpose / Description |
Requirements | Software architects, end users. | Defines what the end users want, and is the"target" the development team aims for. |
Software Design | Software developers | Describes how the requirements will be met with the developed software, and how that software will be built. |
The code itself | Software developers | (special case) |
Test cases | Software developers | Describes how to verify that the user requirements have been met. |
User instructions and help | End users | Describes how to use the software. |
Development Standards (usually not projectspecific) | Software Developers | Describes conventions adopted by the organization,and the reasons for those conventions. |
Most important is what documentation is not: Documentation is not a story. Many people approach documentation as though they were writing an essay at school. This bad approach is positively encouraged by the page layout of word processors, e.g. MS Word. It is important to realize that documentation is NOT a story, but is a collection of many documents, all related to the same subject.
When should you write documentation?
One mistake that is often made is to leave the documentation to the end of the project, which invites problems. Documentation is a continuous process that starts before the official start of the project, and continues after the official end of the project. The tail end of the documentation can be considered part of the project maintenance.
The raw materials for documentation are notes, questions, ideas etc. To get the highest quality documentation content it is very important to capture that raw material while it is fresh in people's minds, so make it easy for them. Some examples are:
- Suppose Mike is a software developer working on the project, and adds a field to a form. He should immediately add that field to the help documentation and explain the high level purpose of that field, for example why that field was required. (No need to add where it is used etc., as an up to date version of that is best extracted from the code). He can do it in point form, and flesh it out later. But capturing that information early is vital, because it is fresh in his mind. Even leaving it to the next day will cause him to occasionally forget important details and subtleties.
- Suppose Jack is using the software and finds a problem. He adds a comment to the manual, which emails Mary, the owner of that page. Having a free moment, Mary reads Jack's comment, contacts Jack and has a short discussion about the problem. Since the problem is fresh in Jack's mind, the two of them can effectively resolve the problem quickly. As an added bonus, Jack feels that the software development team is really "on the ball", and they are all one team working together for the good of their company. Of course, had Mary taken a month to get back to Jack he would only remember the frustration with the software, and would have forgotten all the details. Not only is it more difficult to resolve the problem, but the "on the ball" team building effect has been lost.
At the project start take a very high level approach to documentation by developing an outline. Realize that the outline is very fluid, and will change substantially as the project proceeds and the documentation is fleshed out and refined. An initial outline will typically cover requirements, design and architecture. A useful technique is to flesh out the end user manual before the code is written. Of course as the product is developed, the user manual is updated. This forces a number of design decisions to be considered early, and results in a higher quality end product.
When writing the documentation always capture the reason why a decision was made. You are capturing the context of a decision, which makes it easier to maintain. Later on people forget the context of that decision, and then have difficulty deciding to change it. For example, I was recently trying to fix a problem with some code I had written a few years back. I had not recorded the reason why it was written using such a peculiar way. Having forgotten the context, I rewrote it in a more convectional way to fix a problem and add an enhancement. When testing the modified code I discovered why the other peculiar approach was used, and had to rewrite it the original way (due to the nature of the change, I could not simply roll back to an earlier version). Of course, the code now includes the reason why this peculiar approach was used so I won't make that mistake again!
Managing documentation
As mentioned above, the problem with using word processor for documentation is that it forces you into "story" or "book" mode, whereas project documentation is a large collection of relatively short, related documents. If you don't use MS Word for documentation, what do you use? I have found a Notes database to be a very good tool. Potentially there are other ways to do this, but because Notes works so well, I have never needed to explore any further.
Once you realize that project documentation is a collection of many related documents that are collaboratively maintained, project documentation becomes a mini document management project. This naturally leads to the document lifecycle: create, publish, collaborate and update, retire and archive, something that is well handled by standard workflow techniques in a database. Managing project documentation as a collection of documents in a Notes database makes the whole task much easier.
All documents should have an audit trail or revision history so that you can go back to old versions. This audit trail should be entirely automatic, requiring nothing from the user except possibly the reason why the document is being updated. Disk space is cheap - you can keep almost any number of old version for as long as is required. Again this is relatively easily implemented in a Notes database.
One of the biggest mistakes we make is to think that documentation is complete. It very rarely is. Since the documentation is a database, updating one page does not require re-issuing the entire package. Actually, if the documentation is really "alive", it will be being updated continuously. Since documentation is a collaborative "living" effort, it must be on-line, and can't be on paper. While it can be printed out, paper is obsolete the moment it is printed (but realize that it can be hard to get people off paper). One very useful concept I have employed is to track the "percentage done" of each page. You create a few set "percentage done levels", e.g.
- 0% - Title done (placeholder, used to build the outline)
- 25% - Started work
- 50% - About half way
- 75% - Nearly complete
- 100% - Done
You assign one of these levels to each document. To start, you create the outline by creating pages for each logical heading in the documentation. Don't worry if you create too many or too few - the pages changes as the documentation is worked on. At the document level this is a very crude indicator of the work done, but at the chapter and database levels (i.e. in a categorized Notes view) it provides a very good indication of how much work still needs to be done. It also shows where effort must be focused to complete the work.
Where do you document?
As mentioned earlier, I like to use Notes databases for project documentation, which allows me to keep most related information on the project in one database. Typically requirements, design, and user and code documentation exist in that database, and this forms the bulk of the documentation. Documentation with a specialized workflow such as bugs, enhancement requests, ownership etc. is better managed in a project management database. (See also Thoughts on Managing In-House Software Development Projects in this blog.) And of course the best place to document the code is in the code itself. If you have a tool to generate the documentation from the code even better. Best of all is to use such a tool to create the documentation on demand (because the documentation is always up to date), but that isn't always practical.
User Documentation for Notes Projects
This is a section specific to Notes, and Notes application development. Once developers decide to use Notes for on-line user documentation (i.e. help) they must decide where to put it. The worst place is to put the help in documents in the database. Reason? - at least 2 versions of the help must be maintained - one in the production database, one in the development database. And if the database design is ever cloned, the problem compounds. As we know, it is impossible to manually keep nontrivial collections of documents in sync.
This leaves two choices - either hard code your help into the database design, or put it in a separate database. Both of these allow you to maintain only one version of help. For small, relatively simple database,adding the help as design elements is a reasonable approach. Typically if I was create a template that formed part of a database design, e.g. config documents - I might put the help docs in the design. But in recent years I have all but moved away from this approach.
For anything substantial (i.e. more that 2 or 3 days work) it makes a lot of sense to put the help into a stand alone documentation database. This database should be a standard template developed for the purpose and reused across multiple projects. As the design elements are created, the programmer can add notes to the help documentation database. For example, if the developer creates a field on a form, he can jot down a few notes on why that field was created as he creates it. As the project develops, so this documentation gets fleshed out. Finally, documentation can be upgraded as required, e.g. if a users has a problem, add the answer to the documentation and send a link. Thus the documentation is continuously improved.
Conclusion
To sum up, the main points to consider are:
- Documentation is a continuous process that starts before a project formally starts, and continues well after the formal end of the project.
- Timing is critical: capture documentation content when raw content is fresh in people's minds.
- Project documentation is not a story; it is a collection of related documents that must be managed.
- Treat documentation as a collaborative effort, much like a wiki to reduce costs and improve quality.
I trust this gives you some ideas on how to effectively create and manage project documentation.