chaoss / grimoirelab-sigils

Panels from GrimoireLab dashboards
https://chaoss.github.io/grimoirelab-sigils/
GNU General Public License v3.0
35 stars 85 forks source link

BMI is incorrect #502

Open canasdiaz opened 1 year ago

canasdiaz commented 1 year ago

The current calculation we do to offer the BMI is wrong according to this paper (see page 8 of the pdf)

In the current calculation we are not multiplying by 100. This new value will help us to explain the result, as it shows the percentage of tickets you are being able to digest per week. So it is more easy to be explain that if BMI is 90%, it means that you are being able to close 90% of the tickets and a 10% goes to the backlog.

The current calculation of the Timeline/Timelion chart is below:

.es(index=github_issues, q='pull_request:false', timefield=closed_at).divide(.es(index=github_issues, q='pull_request:false', timefield=grimoire_creation_date)).label('BMI').color(#99af5d),
.es(index=github_issues, q='pull_request:false', timefield=closed_at).divide(.es(index=github_issues, q='pull_request:false', timefield=grimoire_creation_date)).movingaverage(8w, 'left').label('BMI Moving Avg. (8 weeks)').color(#c83d32),
.es(index=github_issues, q='pull_request:false', timefield=closed_at).divide(.es(index=github_issues, q='pull_request:false', timefield=grimoire_creation_date)).trend().label('BMI trend'),
.es(index=github_issues, q='pull_request:false', timefield=closed_at).divide(.es(index=github_issues, q='pull_request:false', timefield=grimoire_creation_date)).aggregate(avg).label('Avg. BMI').color(#e6b740)
sduenas commented 1 year ago

Is it really a bug or is just a problem about how users can understand this metric better?

canasdiaz commented 1 year ago

If you look for papers or even web sites where the Backlog Management Index is explained, the standard definition is: ´(closed issues / opened issues) * 100`. This is not what we have in the GrimoireLab metrics

alpgarcia commented 1 year ago

Percentage means divided by 100. Percentage sign "%" then means divided by 100. Thus, 100% = 100 / 100 = 0,1.

It's not a bug, just two ways of expressing the same. If they multiply by 100 for any other reason, then it's a matter of scale.

GeorgLink commented 1 year ago

This means that when we close issues but don't open new issues, our BMI should be infinite!!! (breaking the chart :-D )

canasdiaz commented 1 year ago

Two questions for you:

alpgarcia commented 1 year ago
  • where is the BMI defined as closed/open without being multiplied by 100? If you think it should be closed/open then we need to publish this specification somewhere: blog post, research paper, whatever ..

As I said, 100% = 1. It's not any specification, it's math. If you specify to multiply by 100 and then you say the result is 100%, then you are saying the result is 100/100 = 1.

  • don't you think it is more easy to be understood, that if you get 100% you are closing the same amount of tickets you are getting?

This is a different question and I'm not against it, I'm against to consider this a bug because it complies with the metric definition.

canasdiaz commented 1 year ago

I've found the place where the BMI was defined in 2002. The book is "Metrics and Models in Software Quality Engineering, 2nd Edition" By Stephen H. Kan

Find below the definition: imagen

More info at https://www.informit.com/articles/article.aspx?p=30306&seqNum=3

canasdiaz commented 1 year ago

As @fioddor pointed out, the definition of the metric is not coherent. For one side, the factor is multiplied by a percentage. It does not make sense. Second, the author mentions the value without the percentage but multiplied by 100.

As a minimal consensus, I believe we can agree that the BMI must be displayed in percentage. Do you agree?

alpgarcia commented 1 year ago

Yes, I agree. Please, remove the bug label and add enhancement instead for clarity. One might think the metric is not displaying the right value when that's not the case, is just a matter of mathematical terminology.