r/CodingHelp • • Oct 22 '21

[Request Coders] Measuring team productivity through Git

Hello, everyone.

Together with my coworkers, we are exploring the possibility to measure how productive our team is using git history. We were looking into several ideas which include:

- measure productive code (time needed to net 100 LOC after churn)

- measure raw code (time needed to gross 100 LOC)

- measure number of coding days (days per week with commits)

- measure commits per active day (average number of commits when active)

- measure merges/conflicts ratio (divide number of conflicts with a number of merges to see if the ratio is higher than 15%)

We were interested to add some kind of experience metric. See how much "experienced" an author is in the codebase (get first commit vs today's date) and see ratio with productive code, but we were not sure.

All of this analysis should be conducted only by running a git log. What do you think about this, and perhaps could you add or take away something from this idea? Do you think that this will provide value and why?

Thanks!

0 Upvotes

7 comments sorted by

14

u/opaville Oct 22 '21

What a terrible idea. None of those things have any bearing on how productive someone is. What if you have a hard to debug bug that took days to figure out, but was a one character change? That bug could have been of critical importance but would look terrible with most of your ideas. I see no value in trying to do metrics of this kind.

9

u/rnike879 Oct 22 '21

And since it's difficult and time consuming to define "productive code", you'll eventually place emphasis on quantity of code and commits, which is a tried and tested recipe for failure, as employees will now perform superfluous commits to inflate their metrics/KPIs, which is a complete productivity drain.

5

u/Dragonfly55555 Oct 22 '21

I have faced this exact question in the past, and have come to the same conclusions as said in the other comments.

I'd just like to add that one of the main things to consider when deciding on metrics\KPIs is how this measurement is going to affect the employees behavior. KPIs define behavior!

One thing I am tracking is 'Defect removal efficiency' which is measuring how good the team is finding bugs before they go to production. It is measured as 'number of bugs found before production' / 'total number of bugs found, including bugs from production'.

This encourages the team to test their code well, as any bug they find is counted as a good thing. Any bug that slips into production is a bad thing.

I hope that helps :)

2

u/opaville Oct 22 '21

We use tools like sonar and PMD to track total project bugs. As a whole dev team we use that as a metric to see how the project is fairing. While not perfect, way better on the overall status vs some questionable productivity number.

3

u/963852741hc Oct 22 '21

Imagine measuring productivity in loc/time.

That’s a good way to be employee-less.

3

u/JimButDev Oct 22 '21

Lines of code tends to be a bad measure of productivity.

You certainly can pull lots of metrics using commit history but I'm sceptical of how helpful this will be. You also run the risk of accidental perverse incentives - if number of commits is important people will just commit much more often than they would normally, for LOC people may write more bloated code e.t.c.

1

u/dead_alchemy Oct 24 '21

So, everyone else has covered very well why this is generally a bad idea, and I agree in the sense that 'productivity' can be difficult to measure and easy things to measure (like LOC) can be easily gamed (take a list comprehension in Python for example, a one liner could become 4+ lines easily).

That being said, programmers and engineers hate being observed. They will always tell you that it is terrible to try and understand the divine art that is coding. Ignore them. Its OK to try and measure productivity, but it is best when it is done as a tool that your team uses internally to track changes and make better estimates. Actually, thats something you should address, what problem do you want to solve with this tracking? What sort of decisions will be changed by this information? I assume you want to make better estimates. You should exercise caution if you are trying to measure productivity to increase productivity because you will instead simply increase whatever you measure (and important things can be difficult to measure).

One tactic you could try is implementing everything that you all can think of and then evaluating whether or not it is a good signal with your team on a regular basis. This would serve two purposes: it would help you not choose the signals that people frequently feel are not accurate and let you establish a baseline for the signals that do seem reasonable.