views:

208

answers:

4

Stackoverflow is the first time I've seen this badges concept. It's oddly motivating, and that's pretty cool. Has anybody seen it applied to source control change sets?

I envision a data mining system that monitors a source repo and maybe a continuous integration system and flags significant deltas in various code centric metrics. The flags ultimately manifest as badges assigned to committers.

Here's a few badge ideas off the top of my head:

  • The Hatchet Man - for largest reduction in overall LOC
  • Detangler - for reducing cyclomatic complexity by N points (probably applied to class or method level)
  • Obfuscator - for increasing cyclomatic complexity
  • Judas Priest - for checking in code that violates the chosen FxCop rules (Breaking the law! Breaking the law! - get it?)
  • Owner - for having the most LOC attributed to you (via blame)
  • Risky Business Badge - for a check in that results in lower test coverage
  • Fixer - for a check in resulting in a previously failing test passing
  • Wrangler - for bringing previously untested code under test

It seems a great deal of my career has been spent on old hoary codebases in need of some heavy duty refactoring. Along with those codebases are the programmers stuck maintaining them, who more often than not don't understand the consequences of unnecessary complexity, or if they do, they don't know what to do about it. This is a way to help them educate themselves, and kind of fun too.

+2  A: 

From my experience just publishing the statistics (i.e. reputation/karma) makes people try to improve their rating. This said, one has to be very careful choosing what to publish. For example, ranking people by their LOC is probably a bad idea as it promotes copy/paste behaviour. On the other hand, ranking showing who contributed a biggest increase in code coverage would be a great motivator.

And raw ranking, without discrete points, does not seem to be so stimulating. People seem to be geared towards powerleveling ;-)

skolima
+1  A: 

Yes it's the first time I've seen it applied to websites like this, but it's very common in RPG's (as in 'Role Playing Game', not 'Rocket Propelled Grenade ;) ) - but there it's called 'quest'. Look at World of Warcraft or Fable, for example. This here on StackOverflow is an awesome new application though.

Roel
+3  A: 

Any measurements based off numerical things like LOC (especially most contributed) are doomed to failure, even if they give no particular reward other than bragging rights. TheDailyWTF has a few rather amusing stories about companies that did this sort of thing with LOC or used LOC as a metric of progress. Even worse is the legend of the company that used number of commits... it led to people committing one line at a time to maximize commits.

Dark Shikari
A: 

You may find some of Joel's thoughts relevant and interesting:

It's not exactly the same, but definitely in the same ballpark.

Jonas Kölker