# Auto Diagnostics

Sunday, May 25, 2014

First step to a cure is acknowledging the problem. Thing that cannot be done if we don't know we have a problem at all. So let's diagnostics our selves shall we.

## Master - Details

At Kode Meister GmbH we created a simple application with a several master -details screens. All of our features were either. Then we had trivial bugs about mainly about drawing issues (text overflows and so), medium size ones, about wrong data processing and some very hard ones with different origins.
After 10 iterations it looked like our performance was going down. If you look first iteration then last its kind of obvious.

Data was generated with this.

## Estimate the performance waste

The actual performance ($p$) a team generates in all iterations is constant. People performance is always about the same. If your team is growing or shrinking this number would vary. But we could take per capita instead without loosing generality.

We first need to assign each feature and bug arbitrary weights based on relative effort needed to be completed or solved. e.g: a Grid is 5, a Details is 7, a Trivial is 1, a Medium is 3 and a Big is 5.

## The Math

Let's say the effort (weight) needed to complete a feature is $e(f)$, the effort needed to solve a bug is $e(b)$. Let $f i j$ be the feature $j$ in the iteration $i$, $F i = { f i j }$ the set with all features of the iteration $i$, $b i j$ the bug $j$ in the iteration $i$, $B i = { b i j }$ the set with all the bugs of the iteration $i$ Then the first iteration could be expressed as:
$p = ∑ e ( F 0 ) + ∑ e ( B 0 )$
As time passes and it becomes more and more difficult to complete features and solve bugs we want to measure how much more difficult it is now than before. We will call it $Δ p i$. The general formula will be:
$p = ∑ e ( F i ) + ∑ e ( B i ) + Δ p i$
If we put $Δ p i$ on a graph we will see:
Although it might look pretty bad is not the worst. It's linear. Worry when it gets a higher degree, and call for help if it becomes exponential.

## What next?

Grab your ITS and start collecting data of your code in the past. You could use VCS as well if it helps. If you don't have defined iteration, take segments of equal length of time. Create as many categories as you need for your features and bugs, the assign the weights accordingly.
Sometimes it's easier if you work backwards.
Mr. Jennings in Paycheck
Look at the past. See how you've been doing, a year ago, 6 month ago, now. If you are not doing good: Hang on, well get to that.