David,

>Hi I'm a grad student in Computer Science at UC Berkeley who's working on a 
>statistical study of commenting. I'm hoping to shed some light on what 
>causes programmers to comment by studying the CVS repositories of existing 
>projects. I'm trying to answer questions like:

Sounds like a very interesting project.

The FLOSS report appears to have done a good job at
automatically deducing the author of source code (see part V).
http://www.infonomics.nl/FLOSS/report/ 

I would also suspect that you will need to break the source down 
by application domain.  My experience is that developers who have
to interface to hardware tend to use lots of comments (perhaps
because it is an interface to the outside world, not some invisible
internal goings on).

>- Do programmers comment source code files more often if other programmers are 
>likely to modify them? (So far, the answer appears to be "not really.")

Why should a developer invest time in helping others in this way?
Commenting is a cost paid by A for a benefit received by B.
Unless management provide an incentive for A to write comments, why
would want to comment?  Because they 'feel' they have to, professional pride,
peer pressure?

>- Do programmers tend to comment their changes more when they modify files 
>that are already thoroughly commented?

Hmm, do they feel guilty if they don't, or do they feel there are
enough comments there already?

>- Do programmers ever add comments without making substantial changes to the 
>actual program? (So far, not usually)

My view is that unless developers comment while they are writing
the code they will never comment it.  Of course people do retro-fit comments.
Perhaps after they have had trouble comprehending a program they
wrote some time ago, or a management edict comes down.

>I've been looking for related work, including:
>- similar statistical studies about comments

The following analyses the form of language used in comments.
"An Approach to Program Understanding by Natural Language Understanding"
http://www.cs.uah.edu/~letzkorn/pubs.html

I think you will find latent semantic analysis interesting.
http://citeseer.nj.nec.com/maletic00using.html

>- papers about what motivates programmers to comment

Nothing else better to do ;-)

>- studies about when comments become out-of-date, or other papers that support 
>or challenge my implicit assumption that "more thoroughly commented" means 
>"better commented"

You might like to check if there is a negative correlation between
commenting and 'readability' of identifiers.  Some developer do think that
a well written program does not need comments.

>So far I've only found one paper that has a statistical study of comments 
>(their finding was that indoctrinating programmers in Literate Programming 

You hit the nail on the head with indoctrinate.


derek

--
Derek M Jones                                           tel: +44 (0) 1252 520 667
Knowledge Software Ltd                            mailto:[EMAIL PROTECTED]
Applications Standards Conformance Testing   http://www.knosof.co.uk



- Automatic footer for [EMAIL PROTECTED] ----------------------------------
To unsubscribe from this list, mail [EMAIL PROTECTED]  unsubscribe discuss
To join the announcements list, mail [EMAIL PROTECTED] subscribe announce
To receive a help file, mail [EMAIL PROTECTED]         help
This list is archived at http://www.mail-archive.com/discuss%40ppig.org/
If you have any problems or questions, please mail [EMAIL PROTECTED]

Reply via email to