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?"
Practice
Solution
Step 1: Understand story points concept
Story points are used to estimate how much effort a task will take compared to other tasks, not exact hours.Step 2: Differentiate from time estimates
Unlike hours, story points are relative and help teams compare tasks easily.Final Answer:
A relative measure of effort required to complete a task -> Option CQuick Check:
Story points = relative effort [OK]
- Confusing story points with hours
- Thinking story points count tasks
- Mixing story points with deadlines
Solution
Step 1: Identify velocity meaning
Velocity is the sum of story points completed by the team in one sprint.Step 2: Exclude unrelated options
Team size, task time, and meetings do not define velocity.Final Answer:
The total story points completed in a sprint -> Option AQuick Check:
Velocity = completed story points [OK]
- Confusing velocity with team size
- Thinking velocity is task duration
- Mixing velocity with number of meetings
Solution
Step 1: Add all completed story points
Sum = 3 + 5 + 2 + 8 = 18Step 2: Confirm velocity definition
Velocity is total story points done in sprint, so 18 is correct.Final Answer:
18 -> Option BQuick Check:
3+5+2+8 = 18 [OK]
- Adding incorrectly
- Choosing highest single story point
- Confusing velocity with number of tasks
Solution
Step 1: Identify velocity from completed points
Velocity equals story points actually completed, which is 22.Step 2: Interpret velocity vs plan
Since 22 is less than planned 30, team completed fewer points than expected.Final Answer:
Velocity is 22; team completed less than planned -> Option AQuick Check:
Velocity = completed points = 22 [OK]
- Using planned points as velocity
- Adding planned and completed points
- Using difference as velocity
Solution
Step 1: Calculate number of sprints needed
Divide total backlog points by average velocity: 120 รท 25 = 4.8 sprints.Step 2: Round up to whole sprints
Since partial sprints are not practical, round up to 5 sprints.Final Answer:
5 -> Option DQuick Check:
120/25 โ 5 sprints [OK]
- Rounding down instead of up
- Using velocity as planned points
- Ignoring partial sprint calculation
Ready to prove it?
Pass the test and this pattern moves unknown
