Grade by Grade
B. Software Development · Software Development: Problem Solving, Design, Testing and the Life Cycle

Planning a Project: Gantt Charts, Critical Paths, PERT and Status Reports

B4.3 B4.6About 75 minutes
Learning goals
  • I can break a project into tasks with durations and dependencies.
  • I can draw and read a Gantt chart that shows tasks and milestones over time.
  • I can find the critical path of a project and the slack of tasks that are not on it, and use a PERT estimate for uncertain tasks.
  • I can write a clear status report that gives milestones, work completed, work outstanding, issues and next steps.

Words to know

task
One piece of project work with a duration, such as "design screens: 2 days".
dependency (predecessor)
A task that must finish before another can start. Integration testing depends on both coding tasks.
Gantt chart
A bar chart with time across the top and one bar per task, showing when each task starts and ends. Milestones are shown as diamonds.
critical path
The longest chain of dependent tasks from start to finish. Its length is the shortest possible project time; any delay on it delays the whole project.
slack (float)
How long a task can be delayed without delaying the whole project. Critical tasks have zero slack.
PERT chart
A network diagram of tasks and dependencies (Program Evaluation and Review Technique). PERT also gives a time estimate: (optimistic + 4 × most likely + pessimistic) ÷ 6.
status report
A short written update on a project: milestones, work completed, work outstanding, issues and next steps.

Plans beat panic

Two days before a big assignment is due, many students discover that the parts depend on each other: you cannot test code that is not written, and you cannot write it before you know what it should do. Professional teams avoid this panic with project management tools.

The curriculum names three: the Gantt chart, the critical path diagram and the PERT chart. Your teacher will use them on a class project (a teacher-led project), and you will use them in this unit's final project. It also asks you to report on a project's status in writing, throughout the project.

Step 1: List tasks, durations and dependencies

Here is the plan for the Winter Carnival ticket app from the last lesson. Durations are in school days. "After" lists the tasks that must be finished first.

TaskDescriptionDaysAfter
AInterview client2none
BWrite specification3A
CDesign screens2B
DDesign structure (structure chart, data)3B
ECode interface4C
FCode calculations5D
GIntegrate and test3E, F
HWrite user guide2C
IInstall and train1G, H
Task list for the carnival app. This is the starting point for every chart below.

Step 2: Earliest start and finish times

A task can start only when all of its predecessors are finished, so its earliest start is the latest finish among them. Work down the list:

  • A: 0 to 2. B: 2 to 5. C and D both start at 5: C ends at 7, D at 8.
  • E (after C): 7 to 11. F (after D): 8 to 13. H (after C): 7 to 9.
  • G needs E and F: it starts at the later of 11 and 13, so 13 to 16.
  • I needs G and H: starts at 16, ends at 17.

The whole project takes 17 days. This calculation is itself an algorithm, so a program can do it, using a maximum-finding loop:

names = ["A", "B", "C", "D", "E", "F", "G", "H", "I"]
days = [2, 3, 2, 3, 4, 5, 3, 2, 1]
after = [[], [0], [1], [1], [2], [3], [4, 5], [2], [6, 7]] # indexes of tasks that must finish first
finish = []
for i in range(len(names)):
start = 0
for p in after[i]: # start after the latest predecessor
if finish[p] > start:
start = finish[p]
finish.append(start + days[i])
print(names[i], "days", start, "to", finish[i])
print("Project length:", max(finish), "days")

Output: one line per task, from A days 0 to 2 down to I days 16 to 17, then Project length: 17 days. The inner loop finds the latest finish among the predecessors.

Step 3: The Gantt chart

A Gantt chart draws each task as a bar on a timeline, from its start day to its finish day. Milestones (zero-length checkpoints, such as "specification approved") are drawn as diamonds. Anyone can see at a glance what should be happening on any day, and which tasks run at the same time.

024681012141617dayA Interview clientB Write specificationC Design screensD Design structureE Code interfaceF Code calculationsG Integrate and testH Write user guideI Install and trainspec approvedlivecritical path taskhas slackmilestone
Gantt chart for the carnival app. Bars run from each task's earliest start to its finish. Highlighted bars are on the critical path; the diamonds mark the milestones on days 5 and 17.

Step 4: The critical path and slack

Follow the chains of dependent tasks from start to finish and add their durations:

  • A → B → D → F → G → I: 2 + 3 + 3 + 5 + 3 + 1 = 17 days
  • A → B → C → E → G → I: 2 + 3 + 2 + 4 + 3 + 1 = 15 days
  • A → B → C → H → I: 2 + 3 + 2 + 2 + 1 = 10 days

The longest chain is the critical path: A, B, D, F, G, I. If any of these tasks is late, the whole project is late. The other tasks have slack:

  • E must finish by day 13 (when G starts) but finishes at 11: slack = 2 days. C shares that path (and H's), so C also has 2 days of slack.
  • H must finish by day 16 (when I starts) but finishes at 9: slack = 7 days.

A project manager watches critical tasks closely and can move helpers from tasks with slack onto them.

A2 dB3 dC2 dD3 dE4 dF5 dG3 dH2 dI1 dCritical path A → B → D → F → G → I = 17 days (thick arrows)
A network (PERT-style) diagram of the same project. Each box is a task with its duration; arrows show dependencies. The thick arrows and highlighted boxes form the critical path.

PERT estimates

Nobody knows exactly how long coding will take. PERT asks for three estimates for each uncertain task: optimistic (O), most likely (M) and pessimistic (P), and combines them with a weighted average:

Expected time = (O + 4M + P) ÷ 6

The most likely value counts four times as much, but the pessimistic value pulls the estimate up when things could go badly.

Worked example

Example 1: Using a PERT estimate

For task F (code calculations) the team estimates O = 3 days, M = 5 days, P = 10 days. Find the expected time. What happens to the project length if F really takes that long?

  1. Expected time = (3 + 4 × 5 + 10) ÷ 6 = 33 ÷ 6 = 5.5 days.
  2. F is on the critical path, so every extra day on F adds a day to the project.
  3. The project goes from 17 days to about 17.5 days.
  4. Good response: plan for 18 days, or start F with two people.

F is expected to take 5.5 days, which pushes the project to about 17.5 days because F is critical.

Worked example

Example 2: What-if questions

(a) Task E takes 5 days instead of 4. (b) Task D takes 4 days instead of 3. What happens to the project length in each case?

  1. (a) E is not critical and has 2 days of slack. One extra day uses up 1 day of slack. The C-E path becomes 16 days, still less than 17. The project still takes 17 days.
  2. (b) D is critical (zero slack). Its path becomes 2 + 3 + 4 + 5 + 3 + 1 = 18 days, so the project is one day late.
  3. Lesson: a delay on a critical task always delays the project; a delay on another task matters only if it is longer than that task's slack.

(a) 17 days (no change); (b) 18 days.

Writing status reports

Throughout a project, teams report their progress in writing: to the teacher, the client, or each other. A good status report is short, honest and specific. It covers:

  1. Milestones: which have been reached (on time?) and which is next.
  2. Work completed since the last report.
  3. Work in progress and outstanding, compared with the plan (on schedule, ahead or behind).
  4. Issues and risks: problems, and what might go wrong.
  5. Next steps: who will do what, by when.

Here is a status report for the carnival app at the end of day 9.

Sample status report

Status report: Winter Carnival app (Week 2, end of day 9) · Team: Ana, Ben, Mei

Milestones: Specification approved (day 5) ✓ reached on time. Next: "all code done" planned for day 13.

Work completed: A Interview client; B Specification; C Screen designs; D Structure chart; H User guide (finished on day 9, as planned).

In progress: E Code interface: 2 of 4 days done, on schedule. F Code calculations: 1 of 5 days done; it was due to start on day 8 and is on schedule, but the discount rule is more complex than expected.

Work outstanding: finish E and F; G Integrate and test; I Install and train.

Issues and risks: F is on the critical path, so any delay moves the whole project. Risk: the client may change the discount rule.

Next steps: Ben will confirm the discount rule with the client by day 10. Ana will help with F once E is finished (day 11).

Just for fun

The Gantt chart is named after Henry Gantt, an American engineer who popularized it in the 1910s. More than a hundred years later, project managers still argue in front of his bars every morning.

Hands-on activity

Plan a family event like a project

You need: paper (graph paper is ideal), a pencil and a ruler.

  1. Choose a real event: a holiday dinner, a birthday party or a weekend move. List 8 to 10 tasks with durations (in hours or days) and what each task must wait for. For example: plan menu → buy groceries → (cook main, make dessert) → set table → serve.
  2. Work out every task's earliest start and finish, and the total time.
  3. Draw a Gantt chart with at least one milestone diamond.
  4. Find the critical path and the slack of two non-critical tasks. Who could help whom?
  5. Pick one uncertain task and give it a PERT estimate (O, M, P).
  6. Halfway through the real event (or imagine it), write a status report with all five parts.

What to look for: no task starts before its predecessors finish; the critical path is the longest chain; slack is calculated from the earliest start of the next task; the report says what is done, what is left and what is at risk.

Your turn

1

What does a Gantt chart show?

2

What is the critical path, and why does it matter?

3

In the carnival plan, why does G start on day 13 and not on day 11?

4

What is the slack of task H? Show how you know.

5

Find the PERT expected time for a task with O = 1, M = 2, P = 3 days.

6

If task F took 7 days instead of 5, how long would the project take?

7

List the five parts of a good status report.

More practice: warm-up

1

How is a milestone drawn on a Gantt chart?

2

What is the slack of a task on the critical path?

3

What does PERT stand for?

4

Task B takes 3 days and starts on day 2. When does it finish?

5

Is "Things are going OK" a useful status report? Why?

More practice: on your own

1

Tasks: P (2 days, no predecessor), Q (4 days, after P), R (3 days, after P), S (2 days, after Q and R). Find the project length and the critical path.

2

Find the PERT expected time for O = 2, M = 4, P = 12 days. Why is it more than 4?

3

In the carnival project, task C is delayed by 3 days. What is the new project length? Explain.

4

Write the "issues and risks" and "next steps" parts of a status report for this situation: the team's tester is sick for two days during testing (a critical task).

5

Why should status reports be written throughout a project, not just at the end?

Challenge

1

Add a new task J, "Client review of screens" (1 day, after C), and change E so it comes after J. Find the new project length and critical path.

2

The team has one extra programmer for the carnival project. Which task should they help with to shorten the project the most, and by how much at most?

3

Explain how the computer program in this lesson finds each task's start time, and why the task list must be in an order where every task comes after its predecessors.

Check your understanding

Quiz

1.

Which tool shows tasks as bars along a timeline?

2.

A project's chains of tasks take 12, 15 and 9 days. How long is the project?

3.

Task X has 3 days of slack and is delayed by 2 days. The project is:

4.

PERT expected time for O = 4, M = 6, P = 14:

5.

Which belongs in a status report?

6.

A task needs tasks finishing on days 6 and 9. Its earliest start is:

For parents and teachers

Big idea: B4.3 asks students to use project management tools (Gantt chart, critical path, PERT chart) to show tasks and milestones in a teacher-led project; B4.6 asks them to communicate the status of a project effectively in writing throughout the project.

How to help: Plan a real family event together with a Gantt chart; it is a skill useful far beyond computer science. Ask for a short written status report on a long assignment once a week: what is done, what is left, what is worrying them.

Common difficulties:

  • Starting a task after only one of its predecessors, instead of the latest one.
  • Choosing the shortest chain as the critical path (it is the longest).
  • Calculating slack against the project end instead of the next task's start.
  • Vague status reports. Ask for numbers, dates and names.