views:

32

answers:

1

Hi,
What is the best practice to link code & documentation and let them being up to date ?

Actually, in my work, business rules are unfortunately not well specified so we discover them during the process of coding. I know it is not so good but our boss providing them is like a ghost...

I'm test infected & we are using the wiki Trac.

I have noticed that mainstream framework (spring etc) tight their test code & bug wit just the id of the bug on jira.

You may propose to just simply comment my code.

But let say that you are designing an application for aliens that take care of humans. And some of them dont have a single clue of what is a human. An you know that you might work in the future with some aliens developpers.

So we have a HumanFactory that create a human with bones, flesh...
I can like always comment the class but i know that it will take a LOT of comments to fully explain what is a human. And it might evolve.

My example might sound humorous but i have experiment that on a project of 2 years where all the business rules are inside some IT people and no where else. And they see them like trivial or natural because they are so used to them.

So like any test link with a bug reported on jira, i have tought of this process.
* A page on the wiki will list all the business rules (BR) with a unique number: BR1... BR101. And any BR have to be as minimalist as possible. If it is not the case it will be split in more BR.
* Any test will have just a short description and a link to the rule in the comment : See #BR45

What do you think about that ? Any other pratice ?
Thanks in advance

A: 

"What is the best practice to link code & documentation and let them being up to date" - strive to make the code the documentation.

Update: you mention that you are "...talking about business rules not the technical implementation". Many companies are going down the path of making the business rules 'runnable' using tools like SpecFlow (in the .NET world)

Mitch Wheat
I must say that this works more in theory than in practice. Unless, you mean inline documentation via comments. Even then, this is only good for low-level and, at best, "mid-level" documentation.
Michael Goldshteyn
And when you want to understand a concept you have to dig in the code that, contrary to a document doesnt contains a table of contents? I think it will be good on a litlle project only. Im talking about business rules not the technical implementation.
FrenchGuy
The aim of programmers should be to right correct, self-documenting code. If you have more than one source of truth, you will eventually find them out of sync.
Mitch Wheat
@FrenchGuy: what do you deem to be a small project?
Mitch Wheat
FrenchGuy