← Back to course
Code Crew G5 / Week 11 / Crew Quest
6/6
Week 11 Β· Plan your capstone

Crew Quest

Crew Quest: Plan on paper
// Choose, break it down, test it first
⏱ about 15 min

Crew Quest: Plan on paper

The night before the big build, the crew spreads paper across the observation deck.

Rocket draws his plan as a tree, with the whole project at the top and small parts below.

He shows it to Raven. "What do you notice that is missing?" she asks.

"The tests!" Rocket says. He adds a box for them right away.

Nova glows warmly. "Here is a hint. Show your plan to someone else. A fresh pair of eyes finds gaps."

  1. Pick a project with its users in mind.
  2. Decompose it into small parts. Give each part its own function.
  3. Choose a container for each piece of data.
  4. Write test cases, with expected answers, before the code.
  5. Use comments to explain why. The rubric checks ideas, working code, tests and explaining.
β—‡ PLAN ON PAPER
Choose one capstone idea: planner, quiz game or inventory tracker.
Draw the project as a tree: the whole project at the top, small parts below.
Write one function name for each part.
Write two test cases: one normal and one edge case.
Show the plan to your partner. Ask what they would change, and change one thing.
Draw your capstone plan as a tree.
For a grown-up
Your feedback is part of the plan. Ask one question about who will use the program, and one about what happens with an empty list.
RECAP QUESTION
  • Read the question.
  • Tap your answer.
When should you work out the expected answer for a test?
Bonus recap statementTrue or false?
Decompose means break a problem into parts.?
Tests should be written after the code is finished.?
An empty list is a good edge case.?
A comment starts with #.?
WHY THIS EXERCISEPlan, pick data, test first and explain. That is how engineers build.
What does sorted({"rope": 1, "maps": 2})[0] give?
What does len({"x": 4, "y": 5, "z": 6}) give?
What should a running total start at?

Quest complete! Next week we build the Fleet inventory tracker and ship it.

← Friday