Inside Paulo Abrantes' head
[ start | index | login or register ]
start > 2007-06-16 > 1

Software Developing: Documentation

Created by pabrantes. Last edited by pabrantes, one year and 161 days ago. Viewed 796 times. #1
[edit] [rdf]
labels
attachments

Software Developing: Documentation

Finally after two months without writing anything related with software developing here I am once again, this time to write about documentation. I've chosen this topic because besides being interesting we are currently deploying new documentation techniques at work.

Like I >>once read: Software developer documentation is like weather: everybody talks about it, but nobody does anything about it. Even if it sounds funny it is actually true, this happens - probably - for two main reasons:

  1. The developers don't like to write documentation, it takes time, it's hard to write good documentation and once done it involves maintenance.
  2. The managers sometimes see that the effort of writing documentation a waste of time (at least when it's not user oriented).
Seeing those two reasons just reminds me why most of the time software tests aren't developed.

Although there are always teams who document their work, and when talking about software documentation we can actually be talking about three distinct types:

1. Architectural Documentation

This kind of document shows the major picture of the application.
The idea is to identify sub-systems within the application and document the design of each one. Such design should be well explained showing all the needed requirements, the implementation details should be left out although, a few guidelines on what should be done in an implementation level may be present sometimes.

This documentation is most of the time written by the software architect and then presented to the developer team in order for the team to lay out a way of implement such requirements.

Such documents can contain UML explaining why each entity represented needs to exist and how they are related.

2. Technical Documentation

This kind of documentation is probably the one everyone is most used to write and talk about. Most of the time it's present on the source code explaining what a certain piece of code does.

There are automatic tools that help developers writing this kind of code like >>javadoc or >>doxygen - among others - the problem with this is that sometimes people start documenting the obvious… How many times haven't been writing the following code:

/** * Gets the X * @return: X */ public X getX() { return this.x }

In my opinion such things are just a waste of time. Such situation - among others - just show another problem in software documentation, the quality of documentation. Even if sometimes it's rather easy to find documentation for a given application, it's rather difficult to find good documentation about it. But, what is good documentation?

3. User Documentation

Like the name indicates this is user oriented documentation in order users can successfully use the application.
This kind of documentation - most of the time written in a >>use-case basis - isn't always written by the developers, sometimes a new team tests the application and writes the documentation. This is done to avoid having developers that already know the system writing documentation for users - who know nothing about the system.

Most of the time this kind of documentation is presented to the user in form of user manual or tutorials.

These are the main types of documentation that can be present in an application's context, but most of the applications do not have the three, sometimes they don't even have one… I've been lucky because I've came across all the three at work.

Like I said before we are currently our architecture at >>FenixEdu. Since it's an application developed using Domain Driven Design our main effort is to be documenting the application domain.

The main idea is to achieve a white paper about our application's architecture, that can help other developers that aren't in the core team.
In other words we are documenting our architecture on a class basis. To do this we are using a wiki (MoinMoin) with a plugin developed by some guys from >>FEUP that allows us to render navigable UML directly from our domain modelling file. An example can be seen >>here. It's an interesting way of documenting - not to mention fast - and since the UML and source code is shown from a SVN checkout when the source code changes the documentation is automatically updated. Unless, of course, the logic of the object changes.

It's not a perfect solution - there is no such thing - but it's definitely a good way of documenting. Maybe documenting on a class basis is over documenting and we should focus on each sub-system that we have - after all that's how we explain things between each other - but that's something that time will say.

Until now there had been other documentation efforts but they all died - showing our hard is to actually produce good documentation for such a big project - but this time it seems things will be different.

I can't really say what's the best way to write documentation or how does actually good documentation looks like, but I can say that being able to navigate through the domain in an easy way helps me a lot on my daily development - well maybe not daily but it gets handy every time I'm starting to look to a part of the domain I'm new to.

Interested in Software documentation? My advice is to take a few minutes and read >>Software Documentation by Ian Sommerville.

Icon-Comment jpmsi, one year and 158 days ago. Icon-Permalink

Well, I must say you tackled the issues surrounding documentation pretty well. You division of areas of concern is right on the spot, and (short of missing one important one) is pretty much the standard division.

However, concerning the usefulness of documentation, I myself have mixed feelings. Overall, I must say that the effort putting into documentation should vary between projects. Large projects that require large teams should, I believe, invest more in documentation than smaller projects. Architectural documentation in small systems is sometimes so obvious that it need no written documentation.

But from my developer point of view, I must say that technical documentation should be replaced by contract documentation. And this type of documentation is precisely the type of documentation that you left out.

I say this because no one needs to reinvent the wheel, and most of the time we use Components-of-the-Shelf in our projects. And nothing upsets me more than a undocumented, completely not obvious behavior that someone decided to implement. And because we always think that these things do not break, we spend most of our time chasing what we think are bugs in our side of the code.

Contract documentation ensures that the client code (we) can learn about every exit situation that we must explicitly handle (or disregard). This, of course, assuming that the documentation is well written.

The next step would be writing these rules in some form of language, meta-code style, that can take us to the next form of formal validation of code. But I digress.

On a final note, I must say I was quite impressed with that MoinMoin plugin, and that it is quite useful for domain driven architectures. Assuming the DML part is dynamically generated, though, I would perhaps suggest the navigability in the documentation by adding links to the proper pages. What say you?

Icon-Comment pabrantes, one year and 158 days ago. Icon-Permalink

However, concerning the usefulness of documentation, I myself have mixed feelings
jpmsi

You're no the only one, believe me.

But from my developer point of view, I must say that technical documentation should be replaced by contract documentation. And this type of documentation is precisely the type of documentation that you left out.
jpmsi

You are right, contracts are a good way of documenting the application. After all they are the best system specification you can have.

The next step would be writing these rules in some form of language, meta-code style, that can take us to the next form of formal validation of code. But I digress.
jpmsi

There are already such languages and even tools for automatic proofs. I currently remember one called >>STeP - The Standford Temporal Prover - but this one can only be used to prove contracts in parallel programming. It's an interesting application but yet, hideous to use.

On a final note, I must say I was quite impressed with that MoinMoin plugin,
jpmsi

It really is something, isn't it? The guys at FEUP really did an awesome work.

I would perhaps suggest the navigability in the documentation by adding links to the proper pages. What say you?
jpmsi

I'm sorry but I didn't quite understand you're idea. You are suggesting that besides having the UML image with navigation, also present the explicit links somewhere in the page, is that it? If is that, I really prefer the links on the image for a better "visual navigation".

Icon-Comment jpmsi, one year and 157 days ago. Icon-Permalink

I'm sorry but I didn't quite understand you're idea. You are suggesting that besides having the UML image with navigation, also present the explicit links somewhere in the page, is that it? If is that, I really prefer the links on the image for a better "visual navigation".
pabrante
Well, I did not know that images were linked. Amazing, I must say.

Nevertheless, what I was saying is in the DML section, you could have the object relations, and the entities present there could be linked to the appropriate pages. But that is kind of irrelevant now, since the diagram provides just that :)

Icon-Comment pabrantes, one year and 156 days ago. Icon-Permalink

Now our next step is to create an eclipse plugin that does the exact same thing as that MoinMoin plugin allowing us to navigate through the DML inside the IDE smiley

Icon-Comment jpmsi, one year and 151 days ago. Icon-Permalink

Now our next step is to create an eclipse plugin that does the exact same thing as that MoinMoin plugin allowing us to navigate through the DML inside the IDE
pabrantes
Ahaha! I trust you will consult with Mr. Gil (I know, I know… Thou shalt not invoke His name in vain) to achive that. He has initiated in the art of eclipse plugin development.

Icon-Comment m4ktub, one year and 151 days ago. Icon-Permalink

Well, I intended to but considering that the base code of "Plug-in with an editor" is about 600 lines of code through 13 Java files, a plugin.xml, and a MANIFEST.MF with everything connected indirectly … I never went very far.

I'm still checking how to develop a editor plugin with coloring, outline and auto complete. It's a steep learning curve, at least in the beginning.

Anyway, creating such a plugin would facilitate the understanding of the model and it's manipulation. It could progressively be extended to include contracts, domain restriction, documentation, access control, ...

This however does not make developers want to write documentation and I think that's the main bottleneck. New ways of visualizing information always help in the communication process but until the day that lack of proper documentation generates compilations or runtime errors people will prefer to hack than to document.

This somewhat reminds me of literate programming (Donald Knuth). I wonder if there are revamps of this concept to the modern world? I have to check on that.

Icon-Comment jpmsi, one year and 151 days ago. Icon-Permalink

Eclipse plugin development is, I believe a very powerful thing. So powerful and so generic, in fact, that it almost resembles a window manager/platform for any type of application you may wish to create. Indeed, I remember seeing when Mr. Gil was conducting some preliminary research on this, that the benefits gained may come short of the effort needed.

Perhaps a simpler tool? Something designed from the ground up, in Java/Swing? Or perhaps .NET? I hear Mono does wonderful things these days!

Edit: Am I really the only one who thinks that sometimes, the effort of creating a small tool that fits some very specific need is less than trying to integrate a new functionality in the existing application?

Icon-Comment m4ktub, one year and 151 days ago. Icon-Permalink

Assuming that the existing application is reasonably well structured, once you pass a certain threshold developing for an existing platform is always easier. The same pattern appears everywhere and when you decide to create a separate application you are already developing on top of existing frameworks that you need to understand.

I would say that, it's easier to start developing a solution based on technology we already know than it is to develop in a far superior platform that when don't yet comprehend.

(At this point I could present a graph with no values but with 2 lines that intersect at some point, and say that it depends on either you project is placed before the intersection or after and then would have no answer to the question "How do I calculate the intersection?")

Icon-Comment pabrantes, one year and 150 days ago. Icon-Permalink

Eclipse plugin development is, I believe a very powerful thing. So powerful and so generic, in fact, that it almost resembles a window manager/platform for any type of application you may wish to create.
jpmsi

The trade-off of this is the complex development of any plugin, even if it's a simple one that will only create a new view.

At this point I could present a graph with no values but with 2 lines that intersect at some point, and say that it depends on either you project is placed before the intersection or after and then would have no answer to the question "How do I calculate the intersection?"
m4ktub

This might be a naive thought, but I would say that the two lines would be:

  • An exponential function, representing the "amount" of know-how about the platform you using - since most of the times learning is an exponential curve
  • And a linear function that would represent the amount of money spent on the project.
Although this is my idea of possible trade-offs on a proj ects, but I'm sure others would just suggest other variables that would fit well…
Please login to www.pabrantes.net.
Who am I?
paulo-roca2My name is Paulo Abrantes AKA pabrantes and I'm a software developer. I'm currently employed at >>CIIST working as a Java developer in >>FenixEDU.

This blog is mostly about Java programming, domain driven design and snipsnap bliki developing. Everything written in this blog is my personal opinion and it may not reflect the opinions of my employer and co-workers.


Blog subscription
subscribe by rss subscribe by email

Links
>> Home
>> Paulo's Profile
>> Post History
>> Add to Technorati Favorites
>> Paulo's Photo Gallery
>> WishList
>> Posting without Login

Search Blog
Fellow Bloggers

Recent Posts

Java Programming: Bytecode Injection
Intermission: Sorry For Downtime
Software Developing: Studying The Bliki Domain Model
SnipSnap Developing: Trying to settle a roadmap
System Administration: Load Balancing with Apache
Blogging: Two years have passed
Software Developing: The SnipSnap Saga
Java Programming: Getting your code spicy with Groovy
Software Developing: Fluent Interfaces
Software Developing: Implementing a ShoutBox on SnipsSnip
Software Developing: SnipSnap, SnipIt and SnipSnip
Java Programming: Proxies and Access Control
Java Programming: Proxies and References
Java Programming: References' Package
YALM: Yet Another Layout Modification

For older posts, please refer to post-history for a complete Post History

Logged in Users: (0)
… and 3 Guests.
This is a modified version of snipsnap.org created by >>Paulo Abrantes