Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

ESP task 1 (1 of 4): Break a big problem into small jobs

The whole lesson, free. Read it and have a go at the activities. To work the tasks and labs in the real lesson, press Start lab, with no account needed.

40 minutes

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

Lunch for 30 people

You must make lunch for 30 people by 12 o'clock. It feels too big.

So you split it: make a shopping list, buy food, cook, serve, clean up. Each job is small. Each job has one owner.

Developers do the same with a big brief.

Key words

WordWhat it meansExample
DecompositionSplitting a big problem into small parts.booking tool: book, cancel, price
SubtaskA small job inside a bigger job.check the hour
User storyOne need, told from the user's side.As desk staff, I want to see the day's bookings
FunctionA named piece of code that does one job.cancel()
AbstractionLeaving out details you do not need.a booking is a name, court and hour
RefinementAdding more detail to a part, one level at a time.check the hour: 9 to 20 only
DependencyA job that must finish before another starts.design before build

The cells students fill in are left blank in this preview.

The Hillside tool, split into parts

flowchart TD
  tool([Booking tool])
  tool --> book[Make a booking]
  tool --> cancel[Cancel a booking]
  tool --> show[Show a day]
  tool --> price[Work out the price]
  book --> hours[Check the hour]
  book --> free[Check the court is free]
  book --> save[Save the booking]

Match the job to the part

Have a go

Loading…

Your answers are marked here and are not kept. A college account keeps every student’s marks.

A good piece does one thing

A good piece is small enough to do in one sitting. It does one thing. You can test it alone.

Ask: "Can I say what this piece does in one short sentence?" If you cannot, split it again.

Refinement adds detail in rounds

Do not write every detail at once. Work in rounds. This is refinement.

Round 1: "Make a booking." Round 2: "Check the hour, check the court, save." Round 3: "The hour must be from 9 to 20."

Each round adds detail and hides nothing. Write one line on why you split the problem that way. A marker rewards a reason for the split, not only the split.

Try it: each part is a function

Code: python
def check_hour(hour):
    return hour >= 9 and hour <= 20


def price_for(is_member, hours):
    if is_member:
        rate = 4
    else:
        rate = 6
    return rate * hours


print(check_hour(10))
print(check_hour(21))
print(price_for(True, 2))

# Call price_for for a visitor for 3 hours.

Make a free account to save your work and track your progress.

User stories: needs from the user's side

A user story is one sentence. It has three parts: who, what, why.

"As a desk worker, I want to see all of Saturday's bookings, so that I can tell a caller which hours are free."

One story is one need. Stories are easy to test.

Check: split a problem

Have a go

Check: split a problem

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Stage 1: split the brief

This is stage 1 of the Hillside practice project. Finish the diagram. Add the missing parts of the tool. Then split Make a booking into at least three smaller jobs. After the diagram, write three user stories (who, what, why) in a short list.

flowchart TD
  tool([Booking tool])
  tool --> book[Make a booking]
  tool --> cancel[Cancel a booking]
  %% Add more parts below: show a day, work out the price, count a member's bookings.
  %% Then split "Make a booking" into at least three smaller jobs.

Make a free account to save your work, or press Start lab to work through the whole lesson.

Order matters

Tip

Some jobs cannot start until another one finishes. You cannot test a function that does not exist. Mark these links. They decide the order of your plan in the next lesson.

Key words crossword

Have a go

Loading…

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Final check

Have a go

Final check

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Teach this lesson with your class

On a college account your students work the tasks and the labs as well, and every mark is kept for you.