Ayende @ Rahien

Hi!
My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 5,953 | Comments: 44,409

filter by tags archive

Idle musing while commuting: The ownership index


While driving to work today, I started wondering what pieces of code are owned by someone, and how you can detect it. Owned means that they are the only one that can touch that code. Whatever it is by policy or simply because they are the only one with the skills / ability to do so.

I wonder if you can use the source control history to figure it out. Something like:

  • Find all files changes within the last year
  • Remove all files whose changes are over a period of less than two weeks (that usually indicate a completed feature).
  • Remove all the files that are modified by more than 2 people.
  • Show the result and the associated names.

That might be a good way to indicate a risky location, some place that only very few people can touch and modify.

I started to think about how to do this in Git, but I got lost. Anyone want to try and take that up?


Comments

Scooletz

What about forks which were not pulled back?

Ayende Rahien

Scooletz, This assume that you are doing this check on a single branch

Daniel Lidström

Another way to find troublesome code is to analyze which file(s) are being changed most often. This could indicate a violation of SRP, perhaps other things too. There are tools that do this already, but I can't remember any names right now.

Alexander

Interesting idea. I found this (http://stackoverflow.com/questions/6572728/svn-list-of-files-changed-exclusively-by-1-user) solution for SVN. I guess it is pretty simple to port it to Git.

Alexander

Actually the code need a small modification as it solves the task "to find files modified exclusively by specific user" but not "to find files modified exclusively by one user". But the general idea is the same: retrieve the list of current files by "list" command and then pass this list to "log" command which returns modifiers.

Ivan

What about automatic code reformatting that could be made by anyone but is not an indication of knowledge sharing?

Eber Irigoyen

This can only mean one thing, Ayende is about to create his own DVCS xD

David Thibault

I can see it already: RavenVC, running on a RavenDB backend. A "second generation distributed version control system"!

:)

tobi

Nice idea. Btw, I would be interested in how you handle code ownership in you company. Does every developer own a piece? Microsoft does it this way.

Remco Ros

Define a nice model around this question, create a git hook which updates some ravendb docs (curl) on each commit and let indexing do the rest?

Lorin Hochstein

There's prior academic research in this area. As a starting point, here's a paper by some smart folks at Microsoft Research: http://research.microsoft.com/en-us/um/people/abegel/papers/codebook-icse2010.pdf

More generally, there's the Mining Software Repositories conference: http://2012.msrconf.org/

Michael Chandler

Michael Feathers has a couple of interesting blog posts very similar to yours: http://michaelfeathers.typepad.com/michaelfeathersblog/2011/01/measuring-the-closure-of-code.html http://michaelfeathers.typepad.com/michaelfeathersblog/2011/03/data-rich-development.html http://michaelfeathers.typepad.com/michaelfeathersblog/2011/09/temporal-correlation-of-class-changes.html

Maybe get in touch with him?

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. The RavenDB Comic Strip (3):
    28 May 2015 - Part III – High availability & sleeping soundly
  2. Special Offer (2):
    27 May 2015 - 29% discount for all our products
  3. RavenDB Sharding (3):
    22 May 2015 - Adding a new shard to an existing cluster, splitting the shard
  4. Challenge (45):
    28 Apr 2015 - What is the meaning of this change?
  5. Interview question (2):
    30 Mar 2015 - fix the index
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats