Chapter 3 · Planning and Risk
Planning, Estimation and Scheduling
- Page 9 of 18
- 21 min read
Sooner or later, someone asks the question every software team dreads: "When will it be ready?" Nadia, the clinic manager, needs an answer because she has to tell her staff when online booking starts. A guess said with confidence is not an answer. A good answer comes from a plan: the work broken into pieces, each piece estimated honestly, the pieces put in order, and the whole thing checked again when reality changes.
On the previous page, Project Management and the Roles in a Software Team, you saw that scope, time, cost and quality pull against each other. This page is about the "time" corner. You will plan the first release of ClinicQueue, estimate it three different ways, and use two short Python scripts to find which tasks decide the launch date. Every number in the ClinicQueue examples is invented.
What you will learn
- How to break a project into a work breakdown structure (WBS) of pieces small enough to estimate.
- Three ways to estimate: expert judgement, the three-point (PERT) formula, and relative sizing with story points and planning poker. And why every estimate is really a range.
- How dependencies create a critical path, and how to compute it with a small Python script.
- How to turn the plan into a schedule with milestones, a text Gantt chart, buffers and (in Scrum teams) velocity.
- What to do when work slips, and why adding people late often does not help (Brooks's law).
Break the work down first
You cannot estimate "build ClinicQueue". It is too big and too vague. You can estimate "write the API endpoint that saves a booking". A work breakdown structure (WBS) is a tree that splits the whole project into smaller and smaller pieces until each leaf is a work package: a piece of work one person or pair can finish, check and call done.
A WBS for ClinicQueue v1
Lena, the project lead, sits with Farhan, Aiko, Omar and Kwame and splits the first release. They start from the product backlog you built on User Stories, Use Cases and Prioritising and group the work by deliverable, not by person.
Example:
ClinicQueue v1
|-- 1 Booking
| |-- 1.1 design Design the booking and queue screens (Omar)
| |-- 1.2 schema Database tables for patients, slots, bookings (Farhan)
| |-- 1.3 booking_api API to list free slots and save a booking (Farhan)
| |-- 1.4 booking_ui Booking pages in the browser (Aiko)
| `-- 1.5 cancel Patient cancels a booking (Farhan, Aiko)
|-- 2 Reminders
| `-- 2.1 sms_reminder Send an SMS reminder the day before (Farhan)
|-- 3 Front desk
| `-- 3.1 queue_screen Today's queue for Rina at reception (Aiko)
`-- 4 Release
|-- 4.1 testing System and acceptance tests with Nadia (Kwame)
`-- 4.2 launch Deploy, train the front desk, go live (whole team)Notice that testing and launch are in the tree. A WBS should hold all the work, not only the coding. Work that is missing from the tree is missing from the estimate, and it will still need doing.
How small is small enough?
- Small enough to estimate with some confidence. The people who will do it should be able to give a short range they believe in. If someone says "no idea, maybe a month", split it again.
- Has a clear "done". "Booking API saves a booking and rejects a taken slot" is checkable; "work on the backend" is not. The acceptance criteria from earlier pages help here.
- Not so small that tracking costs more than doing. Nobody needs a package for "rename a variable".
Estimating: three common ways
An estimate is a forecast of how much effort or time a piece of work will take, made with the information you have today. It is not a promise. Teams mix the following methods.
Expert judgement
The simplest method: ask the people who will do the work, ideally more than one of them. Farhan has built booking forms before, so his "about four days" for the booking API is worth a lot. Expert judgement is fast and uses real experience. Its weaknesses: experts are often optimistic, they forget the boring parts (error handling, tests, deployment), and one loud voice can set the number for everyone. Two fixes help: ask people separately before discussing, and compare against similar past work ("the clinic login took five days, and this is bigger").
Three-point estimate (PERT)
Instead of one number, ask for three: Optimistic (everything goes well), Most likely, and Pessimistic (things go wrong, but not a disaster). The PERT technique, which came from the US Navy Polaris programme in the late 1950s, combines them with a weighted average:
Template:
Expected time E = (O + 4 x M + P) / 6
Spread SD ~ (P - O) / 6 (a rough standard deviation)
Chain of tasks: add the E values; add the SD squared values, then take the square rootThe most likely value counts four times, so it dominates, but a long pessimistic tail pulls the expected time up. The script below applies the formula to the tasks that, as you will see later, decide the launch date.
import math
def pert(o, m, p):
"""Three-point (PERT) estimate: expected time and a rough standard deviation."""
expected = (o + 4 * m + p) / 6
sd = (p - o) / 6
return expected, sd
# (optimistic, most likely, pessimistic) in working days, from Farhan and Aiko
estimates = {
"schema": (1, 2, 3),
"booking_api": (3, 4, 7),
"booking_ui": (2, 4, 8),
"testing": (2, 3, 6),
"launch": (1, 1, 2),
}
total, variance = 0.0, 0.0
for name, (o, m, p) in estimates.items():
e, sd = pert(o, m, p)
total += e
variance += sd ** 2
print(f"{name:<12} O={o} M={m} P={p} expected={e:.2f} sd={sd:.2f}")
print(f"chain expected={total:.2f} sd={math.sqrt(variance):.2f}")
print(f"best case {sum(o for o, _, _ in estimates.values())}, "
f"worst case {sum(p for _, _, p in estimates.values())} days")schema O=1 M=2 P=3 expected=2.00 sd=0.33
booking_api O=3 M=4 P=7 expected=4.33 sd=0.67
booking_ui O=2 M=4 P=8 expected=4.33 sd=1.00
testing O=2 M=3 P=6 expected=3.33 sd=0.67
launch O=1 M=1 P=2 expected=1.17 sd=0.17
chain expected=15.17 sd=1.42
best case 9, worst case 26 daysHow to read it: the most likely values add up to 14 days, but the expected chain is about 15.2 days, because most tasks can go much worse than they can go better (booking_ui could take 8 days, but never less than 2). The best case is 9 days and the worst case 26. That gap is the honest message to Nadia: "most likely about 15 working days, and it could be several days more".
Treat PERT as a simple tool, not a precise model. A white paper on PERT itself calls the standard-deviation shortcut "a very simplistic approximation". The three numbers are still guesses; the formula only makes the guessing more honest.
Relative sizing: story points and planning poker
People are poor at saying "this takes 13.5 hours" but fairly good at saying "this is about twice as big as that". Story points use that: the team gives each user story a number that compares its size (effort, complexity and uncertainty together) with other stories. If "Patient cancels a booking" is a 2, then "Patient books a slot" might be a 5. The number has no unit of hours; it only means something inside one team.
Planning poker is a way to agree on those numbers without one person anchoring everyone. James Grenning described it in a 2002 paper; Mike Cohn later made it widely known. In Grenning's version, the customer reads a story, each programmer writes an estimate without discussing it, all cards are turned over together, and if the estimates differ the team discusses and tries again. Many teams use a deck like 0, 1, 2, 3, 5, 8, 13, 20, 40, 100. The growing gaps are deliberate: for big items, arguing about 14 versus 15 is false precision.
Example:
Story: "As a patient, I want an SMS reminder the day before, so that I do not miss my slot."
Round 1 cards: Farhan 5 Aiko 3 Kwame 13 Lena (does not vote)
Discussion: Kwame: "Who handles a failed SMS? And patients without a phone number?"
Farhan: "I assumed the SMS provider retries for us. I have not checked."
Round 2 cards: Farhan 8 Aiko 8 Kwame 8 -> agreed: 8 pointsThe valuable part was not the final 8 but Kwame's question, which exposed a hidden piece of work. The disagreement did its job. The first backlog had this story at 3 points; the team updates it to 8 and Lena tells Nadia that release 1 has grown.
Story points, velocity and planning poker are common practices in Scrum teams, but they are not part of the 2020 Scrum Guide, which mentions none of them. A team can follow Scrum fully and estimate in hours, in item counts, or not at all.
Why an estimate is a range
At the start of a project you know least: requirements will change, some tasks are new to the team, and some problems are not visible yet. As work progresses, you learn, and estimates get better. So a single date given early is almost always wrong in one direction or the other. Saying "between 15 and 18 working days, most likely 16" is not weakness; it shares the uncertainty with the person who must plan around it.
Practitioners disagree about how much estimating is worth:
| View | Argument | When it fits |
|---|---|---|
| Estimate carefully | Customers need dates and budgets; estimating forces you to understand the work. | Fixed-price contracts, launches tied to an event, new teams. |
| Estimate lightly | Estimates cost time and are often wrong; split work into small, similar-sized items and count how many finish per week instead. | Stable teams with a steady flow of small items, such as Kanban teams. |
For a beginner team like ClinicQueue's, a sensible middle path is: estimate in ranges, keep items small, and compare the plan with reality every week.
Dependencies and the critical path
A dependency means one task cannot start until another finishes. Aiko can build the booking pages only when Omar's design exists and Farhan's API works. Dependencies decide the shortest possible schedule, even with enough people for everything else.
The critical path is the longest chain of dependent tasks from start to finish. Its length is the shortest time the project can take. A task on the critical path has zero slack (also called float): if it is one day late, the launch is one day late. A task off the path has slack: it can slip a little without moving the end date.
Computing it with Python
Lena puts the WBS into a dictionary, using the team's most likely values in whole days. The script does a forward pass (each task starts when its last dependency finishes) and a backward pass (from the end date, how late can each task finish without delaying the end?). Slack is the difference.
# ClinicQueue v1: task -> (duration in days, tasks that must finish first)
tasks = {
"design": (3, []),
"schema": (2, []),
"booking_api": (4, ["schema"]),
"booking_ui": (4, ["design", "booking_api"]),
"sms_reminder": (3, ["booking_api"]),
"queue_screen": (3, ["design", "schema"]),
"testing": (3, ["booking_ui", "sms_reminder", "queue_screen"]),
"launch": (1, ["testing"]),
}
def schedule(tasks):
"""Earliest start/finish (forward pass) and slack (backward pass)."""
start, finish = {}, {}
for name in tasks: # tasks are listed after their dependencies
duration, deps = tasks[name]
start[name] = max((finish[d] for d in deps), default=0)
finish[name] = start[name] + duration
end = max(finish.values())
latest = {name: end for name in tasks} # latest finish that keeps the end date
for name in reversed(list(tasks)):
duration, deps = tasks[name]
for d in deps:
latest[d] = min(latest[d], latest[name] - duration)
slack = {name: latest[name] - finish[name] for name in tasks}
return start, finish, slack, end
start, finish, slack, end = schedule(tasks)
print(f"{'task':<13} {'start':>5} {'finish':>6} {'slack':>5}")
for name in tasks:
print(f"{name:<13} {start[name]:>5} {finish[name]:>6} {slack[name]:>5}")
critical = [name for name in tasks if slack[name] == 0]
print("project length:", end, "days")
print("critical path:", " -> ".join(critical))task start finish slack
design 0 3 3
schema 0 2 0
booking_api 2 6 0
booking_ui 6 10 0
sms_reminder 6 9 1
queue_screen 3 6 4
testing 10 13 0
launch 13 14 0
project length: 14 days
critical path: schema -> booking_api -> booking_ui -> testing -> launchDay numbers count from the start of the project: "start 6, finish 10" means the task runs during days 7 to 10. The critical path goes through the database schema, the booking API, the booking pages, testing and launch. The design has 3 days of slack because Aiko cannot use it before the API is ready on day 6 anyway. The queue screen has 4 days of slack, and the SMS reminder 1 day. The cancel story (1.5, about 1 day after booking_api) has plenty of slack, so the script leaves it out to stay short.
What the critical path tells you
- Where to watch. Lena checks progress on Farhan's API every day; a slip there moves the launch.
- Where speeding up helps. If Farhan finishes the API a day early, the launch can move a day earlier. Finishing the queue screen early changes nothing.
- Where people can move. Omar's design has slack, so he can help Kwame write test cases first without risk.
Real projects have more tasks and more than one person per task, so project tools do this calculation for you. The idea stays the same, and this short script shows there is no magic in it.
From plan to schedule
A text Gantt chart
A Gantt chart shows each task as a bar on a timeline. It is the most common way to show a schedule to people outside the team. This small function draws one from the numbers the script already computed.
def gantt(tasks, start, finish, slack, end):
"""One row per task: '#' = critical, '=' = other work, '.' = free days."""
print(" " * 13 + "".join(str(day % 10) for day in range(1, end + 1)))
for name in tasks:
mark = "#" if slack[name] == 0 else "="
row = "." * start[name] + mark * (finish[name] - start[name])
print(f"{name:<13}{row:.<{end}}")
gantt(tasks, start, finish, slack, end) 12345678901234
design ===...........
schema ##............
booking_api ..####........
booking_ui ......####....
sms_reminder ......===.....
queue_screen ...===........
testing ..........###.
launch .............#The top row shows the day number (its last digit). Hash marks are critical tasks, equals signs are tasks with slack, and dots are days when the task is not running. You can see at a glance that testing cannot start before day 11.
Milestones and buffers
A milestone is a checkpoint with zero duration that marks something important being done. Good milestones are things you can show or test, not "50% of coding". For ClinicQueue v1:
| Milestone | Done when | Planned |
|---|---|---|
| M1 Booking API ready | A test booking is saved and a taken slot is rejected | end of day 6 |
| M2 Ready for testing | A patient can book in the browser; reminders and queue screen work; Kwame starts system tests | end of day 10 |
| M3 Go live | Nadia accepts, front desk trained, patients can book | end of day 14 + buffer |
A buffer is extra time added on purpose for things that go wrong. The PERT run showed the critical chain is expected to take about 15.2 days, not 14, so promising day 14 would be promising the lucky case. Lena adds a visible 3-day project buffer at the end and tells Nadia "go live by working day 17". Two habits make buffers work:
- One visible buffer, not hidden padding. If everyone secretly adds 50% to their own task, the padding is used up by slow starts and nobody knows how much safety is left. A shared buffer at the end is honest and can be tracked ("we have used 1 of 3 buffer days").
- Size it by uncertainty. A chain with a wide pessimistic tail needs a bigger buffer than a chain of familiar tasks.
Velocity in Scrum teams
Teams that estimate in story points often track velocity: the number of points of work that met the Definition of Done in a sprint. Unfinished stories count zero. After a few sprints, velocity helps forecast: if ClinicQueue's team finished 18, 22 and 20 points in its last three sprints and 60 points remain in the backlog, the forecast is about 60 / 22 to 60 / 18, that is between 2.7 and 3.3 sprints, so plan for 3 to 4 sprints.
Use velocity with care. It is a planning aid for one team, not a score. Comparing velocities between teams is meaningless (their points mean different things), and pushing a team to "raise velocity" mostly makes the estimates grow.
When things slip: re-planning
Plans change. That is not failure; ignoring the change is. In week two, Farhan finds that registering with the SMS provider needs a document from the clinic, which adds 2 days to the SMS reminder task. Re-plan with facts, not feelings: update the numbers and run the schedule again.
late = dict(tasks)
late["sms_reminder"] = (5, ["booking_api"]) # the SMS provider setup takes 2 extra days
start2, finish2, slack2, end2 = schedule(late)
print("project length:", end2, "days")
print("critical path:", " -> ".join(n for n in late if slack2[n] == 0))
print("booking_ui slack is now", slack2["booking_ui"])project length: 15 days
critical path: schema -> booking_api -> sms_reminder -> testing -> launch
booking_ui slack is now 1The SMS task had only 1 day of slack, so a 2-day slip moves the launch by 1 day and makes the SMS task critical. Now the booking pages have 1 day of slack. Lena takes 1 day from the buffer, still meets day 17, and tells Nadia at once instead of on day 16.
Options when the date is at risk
When a slip is bigger than the buffer, the trade-off from the previous page returns: something among scope, time, cost and quality must give. The usual options, in the order teams often try them:
- Reorder or overlap work: start tasks with slack earlier, or let Kwame write tests while the code is being finished.
- Cut or delay scope: launch booking and the queue screen first, add SMS reminders a week later (agree this with Nadia; it is her decision).
- Move the date, early and with a new range, not one day at a time.
- Add people, with care, as the next section explains.
Lowering quality ("skip testing") is the option to refuse: the time is only borrowed and comes back as bugs after launch.
Brooks's law: adding people late
Fred Brooks wrote in The Mythical Man-Month (1975): "Adding manpower to a late software project makes it later." He himself called it an "outrageous oversimplification", but the idea behind it is real. New people need time to learn the code and the domain, and the people who teach them are the experienced ones who were doing the critical work. More people also means more communication. In a team of n people there are n(n − 1) / 2 possible pairs who may need to talk: 5 people have 10 pairs, 7 people have 21. Some work also cannot be split: two people cannot make one database migration go twice as fast.
Adding people can help when it happens early, when the new person already knows the system, or when the work splits into independent parts (a second tester running a separate set of checks). It rarely helps in the last weeks before a deadline.
Where this shows up at work
- Freelancers write a WBS and a ranged estimate into every proposal; "3 to 4 weeks, depending on the payment integration" protects both sides.
- In sprint planning, teams use rough sizes and their recent pace to decide how much fits in the next sprint.
- Project leads show a Gantt chart with milestones to clients and managers, and update it when the plan changes.
- When a release is in danger, the conversation is about the critical path: which task decides the date, and what can be cut or moved.
Common mistakes
- Giving a single date on day one. It becomes a promise that the team cannot keep. Fix: give a range, say what it depends on, and narrow it as you learn.
- Estimating only the coding. Testing, review, deployment, training and meetings are real work. Fix: put them in the WBS so they are in the estimate.
- Treating story points as hours or as a performance score. Then people inflate them and forecasting stops working. Fix: use points only to compare stories inside one team, and never compare teams by velocity.
- Ignoring dependencies. Five people each with "4 days of work" does not mean the project takes 4 days. Fix: find the critical path and watch it.
- Hiding slips. Hoping to catch up silently turns a small slip into a surprise. Fix: re-run the plan as soon as something changes and tell the customer early, with options.
Try it yourself
- Easy: Kwame estimates the acceptance tests for the AI reminder-text feature as optimistic 2 days, most likely 5 days, pessimistic 14 days. Compute the PERT expected time and the rough standard deviation. Why is the expected time higher than the most likely value?
- Medium: Using the original ClinicQueue task list (before the SMS slip), suppose Aiko's queue screen turns out to need 8 days instead of 3. Work out the new project length and the new critical path by hand (or by changing the dictionary and calling
schedule). By how many days does the launch move, and why not by 5? - Hard: ClinicQueue's next release has 100 story points left. The team (5 people) finished 18, 22 and 20 points in its last three sprints. Nadia wants it in 3 sprints and offers to pay for two extra developers starting now. Write a short reply to Nadia: your forecast range, what adding two people would do, and two other options.
Answers
- E = (2 + 4 × 5 + 14) / 6 = 36 / 6 = 6.0 days. SD ≈ (14 − 2) / 6 = 2.0 days. The expected time is above the most likely 5 because the pessimistic tail is long (9 days worse than most likely, only 3 days better); the formula pulls the expected value towards that tail. A good answer gives Nadia "about 6 days, possibly 8", not "5".
- The queue screen starts when design (day 3) and schema (day 2) are both done, so it runs from day 3 to day 11. Testing must wait for it: day 11 to day 14, launch day 14 to day 15. The project is now 15 days and the new critical path is design → queue_screen → testing → launch. The launch moves by only 1 day, not 5, because the queue screen had 4 days of slack; the slack absorbed 4 of the 5 extra days. (Running
scheduleon the changed dictionary gives length 15 and that same critical path, with booking_api and booking_ui now having 1 day of slack.) - Model answer: "Based on the last three sprints (18 to 22 points each), 100 points will take about 100 / 22 = 4.5 to 100 / 18 = 5.6 sprints, so 5 to 6 sprints, not 3. Adding two developers now would not double our speed: they need time to learn the code, the current team would spend time helping them, and a 7-person team has 21 communication pairs instead of 10, so the next sprint or two would probably be slower. Two options that can help: (1) choose the most valuable 60 points for a release in 3 sprints and deliver the rest after; (2) keep the full scope and plan the release for sprint 5 or 6, re-forecasting after every sprint." A good answer contains: a range rather than one number, computed from the velocity figures; the ramp-up and communication reasons from Brooks's law (with the 10 versus 21 pairs); at least one scope option and one date option; and a respectful tone that leaves the decision about scope to Nadia.
Summary
- Break the project into a WBS whose leaves are small, checkable work packages, including testing and release work.
- Estimate with expert judgement, three-point PERT ((O + 4M + P) / 6), or relative story points agreed through planning poker.
- Every estimate is a range; share the range and narrow it as you learn.
- The critical path is the longest chain of dependent tasks; tasks on it have zero slack and decide the end date.
- A schedule needs testable milestones, one visible buffer, and re-planning as soon as something slips; adding people late usually makes things later (Brooks's law).
Next: Risk Management: how to spot what could go wrong with ClinicQueue before it does, and decide what to do about it.

