0
0
Software Engineeringknowledge~5 mins

Story points and velocity in Agile in Software Engineering - Time & Space Complexity

Choose your learning style9 modes available
Time Complexity: Story points and velocity in Agile
O(n)
Understanding Time 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.

Scenario Under Consideration

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 Repeating Operations

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).
How Execution Grows With Input

As the number of sprints increases, the number of additions grows linearly.

Input Size (sprintCount)Approx. Operations
1010 additions
100100 additions
10001000 additions

Pattern observation: The work grows directly with the number of sprints.

Final Time Complexity

Time Complexity: O(n)

This means the time to calculate velocity grows in a straight line as the number of sprints increases.

Common Mistake

[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.

Interview Connect

Understanding how effort scales with work size helps you explain Agile metrics clearly and shows you grasp practical software planning.

Self-Check

"What if we stored a running total of completed points instead of summing each time? How would that change the time complexity?"