Lesson plan

Software capstone: your own project lesson plan

The end of the Coding track: design and ship a project of your own on a Raspberry Pi, milestone by milestone, from the problem and the spec through modules, slices, tests and polish to a demo you can share.

4 chapters, 7 lessons, about 8 hours, on the Raspberry Pi 4 Model B. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • Pick a problem worth solving and write a spec the program can check.
  • Give every job a module, then grow the product one working slice at a time.
  • A test suite with fakes that finds bugs first, then polish a stranger can use.
  • A demo that cannot go wrong, a write-up, and a link to share.

Materials for the whole unit

  • Eight-channel ADC, MCP3008
  • Half breadboard
  • LED
  • Potentiometer
  • Raspberry Pi 5
  • Resistor

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 2 h 20 min

Plan

Pick a problem worth solving and write a spec the program can check.

LessonTimeWhat students do
Pick a problemStart the capstone: what makes a problem worth a portfolio project, evidence that a sensor can see it, the smallest program that helps, the edge case that would fool it, and a one-sentence problem statement for your own project.65 min
  1. Run it: the brief
  2. Evidence first: can the sensor see it?
  3. The smallest thing that helps
  4. An output a person acts on
  5. The case that would fool it
  6. Your version: pick your problem
Write the specTurn the problem into a written spec with user stories and an out-of-scope list, then into acceptance checks the program prints: a boundary bug the spec catches, a spec change made test first, and the spec run against the hardware.75 min
  1. Run it: a spec you can read
  2. A story becomes a check
  3. Predict: which check fails?
  4. Fix it, and count
  5. Change the spec first
  6. Predict: the spec on the hardware
  7. Your version: write your spec

Materials

  • Eight-channel ADC, MCP3008
  • Half breadboard
  • LED
  • Potentiometer
  • Raspberry Pi 5
  • Resistor

Check for understanding

Each student finishes "Write the spec" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Your version: write your spec".

Chapter 2. About 2 h 20 min

Build

Give every job a module, then grow the product one working slice at a time.

LessonTimeWhat students do
ArchitectureSplit the working script by job: pure care rules, a sensor adapter behind a read() interface with a fake for tests, JSON storage, and a report layer, so each part can change, or be tested, without touching the others.65 min
  1. Run it: one file, four jobs
  2. Decide: care.py
  3. Sense: an interface, and a fake
  4. Remember: store.py
  5. Tell: report.py
  6. Your version: draw your modules
Build in slicesGrow Sprout one vertical slice at a time, each a command that goes from typed text through every layer to a result: status, water, history and a setting, with bad input answered instead of crashing.75 min
  1. Run it: a shell with one command
  2. Slice 1: status
  3. Slice 2: water
  4. Slice 3: history
  5. Slice 4: a setting
  6. Bad input gets an answer
  7. Your version: plan your slices

Materials

  • Eight-channel ADC, MCP3008
  • Half breadboard
  • LED
  • Potentiometer
  • Raspberry Pi 5
  • Resistor

Check for understanding

Each student finishes "Build in slices" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Your version: plan your slices".

Chapter 3. About 2 h 20 min

Prove

A test suite with fakes that finds bugs first, then polish a stranger can use.

LessonTimeWhat students do
TestsA test suite of plain asserts with a tiny runner that counts: boundary tests from the spec, the command handler tested through a fake probe and a fake lamp, a test that finds a real bug before you fix it, and a gate that will not start the app until every test passes.75 min
  1. Run it: a runner in twelve lines
  2. Test the boundaries
  3. Test a command with fakes
  4. Predict: a test that finds a bug
  5. Make it pass
  6. A missing sensor, and a gate
  7. Your version: your test suite
Polish and docsMake Sprout feel finished: a version string and --help from argparse, options that change behavior, logging with levels, errors that are logged instead of crashing, help text that documents itself, and a README and docstrings for the next reader.65 min
  1. A version and a --help
  2. Options that do something
  3. Logging, not print
  4. Errors are logged, never fatal
  5. Help that documents itself
  6. Your version: polish and a README

Materials

  • Eight-channel ADC, MCP3008
  • Half breadboard
  • LED
  • Potentiometer
  • Raspberry Pi 5
  • Resistor

Check for understanding

Each student finishes "Polish and docs" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Your version: polish and a README".

Chapter 4. About 1 h 5 min

Ship

A demo that cannot go wrong, a write-up, and a link to share.

LessonTimeWhat students do
Demo and write-upFinish the capstone: a scripted --demo mode that runs every command, a live moment with the lamp, the spec's acceptance checks run against the finished code, a one-line share card, then your README, a 60 second demo script and the Mokxi project link.65 min
  1. A demo that cannot go wrong
  2. The live moment
  3. Prove the spec, one more time
  4. Predict: the share card
  5. Your version: the write-up
  6. Your version: demo it and share it

Materials

  • Eight-channel ADC, MCP3008
  • Half breadboard
  • LED
  • Potentiometer
  • Raspberry Pi 5
  • Resistor

Check for understanding

Each student finishes "Demo and write-up" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Your version: demo it and share it".

Your class

Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.