Story points and velocity in Agile in Software Engineering - Time & Space Complexity
When using story points and velocity in Agile, it's helpful to understand how the effort to complete work grows as the amount of work increases.
We want to see how the total time or effort changes when the number of story points changes.
Analyze the time complexity of calculating velocity from completed story points over sprints.
int calculateVelocity(int[] completedPoints, int sprintCount) {
int total = 0;
for (int i = 0; i < sprintCount; i++) {
total += completedPoints[i];
}
return total / sprintCount;
}
This code sums story points completed in each sprint and calculates average velocity.
Identify the loops, recursion, array traversals that repeat.
- Primary operation: Loop through the array of completed story points.
- How many times: Once for each sprint counted (sprintCount times).
As the number of sprints increases, the number of additions grows linearly.
| Input Size (sprintCount) | Approx. Operations |
|---|---|
| 10 | 10 additions |
| 100 | 100 additions |
| 1000 | 1000 additions |
Pattern observation: The work grows directly with the number of sprints.
Time Complexity: O(n)
This means the time to calculate velocity grows in a straight line as the number of sprints increases.
[X] Wrong: "Calculating velocity is instant and does not depend on the number of sprints."
[OK] Correct: The calculation must look at each sprint's points, so more sprints mean more work.
Understanding how effort scales with work size helps you explain Agile metrics clearly and shows you grasp practical software planning.
"What if we stored a running total of completed points instead of summing each time? How would that change the time complexity?"