Week 5 · Lesson 4 · 55 minutes

Design the whole system

I can justify a system using requirements and trade-offs.

Planned lesson. Follow your teacher’s teaching order.

Source workbook pages: 33.

Resources

Vocabulary

Vocabulary
requirement: something the system must do; constraint: a limit on the design
55-minute lesson sequence
  1. 0–5 · Retrieve local control.
  2. 5–15 · Model the measurable logging requirement and a failure plan.
  3. 15–25 · Guide a labelled data path without drawing the students’ complete design.
  4. 25–45 · Students write requirements, justify choices and plan a simulated outage test.
  5. 45–50 · Peer review checks one requirement against one proposed test.
  6. 50–55 · Collect the evidence exit statement.

Try before notes

Give one reason to keep the control loop local.

Build the idea

Start with requirements that can be tested. “Reliable” is too vague on its own. “Record valid readings locally while the network is disconnected” names a behaviour and a condition that a test can check.

Draw separate paths for immediate control and for reporting. The local controller should not wait for a dashboard response when the requirement says control must continue without internet. Persistent local storage can hold a backlog for later upload.

Every design choice has a limit. Local storage has finite capacity. Remote copies depend on a connection and access control. Retried uploads can create duplicates unless records have an identity or another deduplication rule.

sensor → local decision → actuator
   └──→ persistent log → upload queue → dashboard
              works offline      needs connection

See the method

Example requirement: “Record each valid temperature with a time label.” A design needs an input, a rule, an output, storage and a failure plan. A useful justification links a feature to a requirement: “Local storage keeps recent records during network loss; it needs enough capacity and a later sync rule.”

Predict then reveal

Requirement: record one reading each minute for a 15-minute outage. What minimum record capacity covers exactly that outage, assuming no earlier backlog?

Reveal reasoning

15 records. This assumes one record per minute and an initially empty backlog. A real design should state a margin and what happens if an outage lasts longer.

A report upload succeeds but its reply is lost. The device retries. What can go wrong and what design idea helps?

Reveal reasoning

The server may store the same report twice. Give each record a stable unique identity and handle a repeated identity as the same record rather than a new reading. The identifier must survive retries.

Work one step together

Read the first task. Each learner predicts the first step privately. Compare the method, then complete one intermediate row or one code iteration together. Do not display a finished workbook answer.

Practice

  1. Design a room monitor that controls locally, records readings and shows a remote dashboard. Draw its data paths. State three measurable requirements: normal control, invalid reading and network loss.

Your turn

Complete the remaining steps of task 1 alone, then the next tasks. Predict before running code. Save your own evidence before comparing.

Practice

  1. Design a room monitor that controls locally, records readings and shows a remote dashboard. Draw its data paths. State three measurable requirements: normal control, invalid reading and network loss.
  2. Choose primary memory, persistent storage and a cloud service model. For each, give one reason and one limitation. Explain how you would test a lost connection without using real personal data.

Check and explain

A diagram is not a justification until its features are connected to measurable requirements.

Point to the first step, row, condition or requirement that supports your answer. If results differ, find the first different state and repair one cause.

Show what you know

What makes a test result useful evidence for a requirement?

HL challenge when ready

How could duplicate records appear after a failed upload is retried?

Week 5 homework

Show working. Keep code and output. Stop at 25 minutes and mark where you reached.

  1. Draw a closed-loop automatic door system. Label sensor, controller, actuator, controlled process and feedback. Explain one possible fault.
  2. Trace the hysteresis rule from off for 20,18,21,22,19. Explain both exact-boundary cases.
  3. Choose a cloud model for a team that must configure its own OS. Explain what extra work this choice brings.
  4. Retrieve memory: why must a log be written to persistent storage if it should survive power loss?

Source workbook pages: 35.

Weekly homework (Word)

Python practice · two short prompts

Spend about 3 minutes on each during practice time. Predict, run, change one thing, then explain. These prompts do not add homework.

A starter is runnable code to explore or complete. If the playground restores your saved code, the linked starter is selected in Example: use Load example when ready. Download your work before confirming replacement.

Prompt 1

Keep local control working when a simulated upload is unavailable.

No imports needed.

Hint and starter code

Local control and network upload are separate decisions; this code makes no network request.

# Local control and network upload are separate decisions; this code makes no network request.
temperature = 29
network_available = False
fan = temperature > 28
print("fan", fan)
print("upload", network_available)
Open this starter in Python playground →
Prompt 2

Queue an unsent reading and inspect the oldest queued value.

No imports needed.

Hint and starter code

A queue preserves arrival order; a real design also needs a storage limit.

# A queue preserves arrival order; a real design also needs a storage limit.
pending = []
pending.append(26)
pending.append(29)
print(pending[0], len(pending))
Open this starter in Python playground →