# Assessment of the complexity of tasks

When assessing the complexity of tasks, it is often difficult to give an absolute score. It is much easier to estimate the relative size of two tasks, i.e., for example, to say that task A is twice as large as task B.
During the agile development process, you have to evaluate many user stories.
Using pairwise comparison, the error in determining the estimates is reduced, and moreover, this error can be calculated.

### Theory

Suppose we need to evaluate n stories. Denote the size of each story by s i .
To find the size of each story, we estimate the size of each story relative to all other stories and write the result a ij in the matrix A nxn : I note that only the upper part of the matrix is ​​to be filled, because a ij = 1 / a ji .

### Story Sizing

To calculate the average relative size of the history mrs i you need to find the geometric mean for the i-th row of the matrix, i.e. (1)

Average relative size of the history a little about what we said, so the size of the history, we need units, calculated on the basis of history, the size of which we know s ref : (2)

where s ref - the size of the reference history in the required units ( history points, hours, etc.), mrs reference - the relative size of the reference history, calculated by the formula (1).

### Numerical example

Imagine that we have four user stories for evaluation, which we briefly describe as follows:
1. Registration / Authorization
3. Show list of posts
4. Post classification

Fill in the matrix with relative estimates:
1234Relative size mrs iScore s i
1. Registration / Authorization *10.332.003.001.1910
3. Show a list of posts0.500.3310.500.544.52
4. Post classification0.330.202.0010.605.08

We took history No. 1 as a reference value and rated it at 10 story points. The size of stories No. 2, 3, 4 was calculated by the formula (2).

### Convergence Index and Confidence Interval Calculation

The variance of estimates in the matrix A nxn is calculated by the formula : The square root of the variance is called the convergence index: The smaller the convergence index, the more consistent our estimates.
However, the convergence index is difficult to interpret. Better if you translate it into a confidence interval for estimates.
For this, we make the assumption that each story in our assessment makes the same contribution to the total variance, then the error and the confidence option are calculated using the following formulas:  #### Implementation

I tried to implement this functionality in Javascript. I posted here estimateit.ru .

#### Future plans

An obvious drawback when using this method is that with an increase in the number of evaluated stories, the number of necessary comparisons grows. This can be avoided by using not all comparisons, but only minimally necessary ones.
There is also a technique for finding inconsistent estimates in matrix A.

###### Literature:

 Sizing User Stories Using Paired Comparisons // Eduardo Miranda, Pierre Bourque, Alain Abran