Test it, improve it, present it
Your machine works perfectly in your head. How do you prove it works in every situation, and convince someone else?
About 40 min · 3 goals · Checked by automated tests; not yet reviewed by an educator
1.Why should I care?
A design isn't finished when it's drawn; it's finished when it's tested and explained. Engineers who test every path, admit what failed, and improve because of it build machines people can trust.
- ◇ Write a test plan that covers every path of your machine's decision rules, including edge cases.
- ◇ Record test results honestly and make at least one evidence-based improvement.
- ◇ Present a design clearly: objective, components, decisions, evidence and next steps.
Safety: Keep your machine simulated or conceptual. If you make a physical model, an adult must review it first; no mains power, blades, heat or water near electricity.
2.Predict
Your smart fan design has 4 paths through its flowchart. What's the minimum number of test runs to try every path?
Guess first. Being wrong here is how the surprise works.
3.Discover
Treat the smart fan as a client's design. Test all four paths, then change the rule's temperature and test the edge (temperature exactly equal to the rule). Write down one improvement you would suggest, with the test that convinced you.
Smart fan decision runner
A machine decides by asking yes/no questions in order. Set the sensors, then run the flowchart one step at a time. A good engineer tests every path, not just one.
Someone in the room?
Window open?
- Start: read the sensors
- ◇ Is someone in the room?yes
- ◇ Is it hotter than 26 °C?yes
- ◇ Is the window open?no
- Fan HIGH
- ○ nobody home → OFF
- ○ cool enough → OFF
- ○ hot, window open → LOW
- ○ hot, window shut → HIGH
Path: Is someone in the room? yes → Is it hotter than 26 °C? yes → Is the window open? no → fan HIGH. Paths tested: 0 of 4.
Can't use the interactive? Read a description instead
The decision runner lets you set a smart fan's inputs, step through its flowchart and tick off each of its four paths in a test log. Changing the rule's temperature limit and testing a room temperature exactly equal to it shows the edge case: 'hotter than 26' is false at 26, so the fan stays off.
4.Understand
Plan the tests
Make a table: test number, inputs, expected result, actual result, pass/fail. Include:
- one test for every path through your flowchart or rule table,
- edge cases at each threshold (just below, exactly on, just above),
- one 'something breaks' case: a sensor stuck at 0 or 1. What does your machine do?
Test honestly, then improve
Run each test in your simulation or walk it through on paper, and record what actually happens, even when it fails. A failed test is useful: it tells you what to fix. Make at least one improvement, then re-run the tests to check you fixed it without breaking something else.
Present like an engineer
A short presentation (or poster) covers: the problem and objective → how it works (sketch, mechanism, ratio) → how it decides (flowchart or truth table) → test evidence → the improvement and why → what you'd do next. Use your diagrams. Say clearly what is simulated or assumed (no friction, perfect sensors) and what you'd need to check in real life.
Explain it another way
Testing is like checking every door in a house before you leave, not just the front one. The back door you forgot is the one that matters.
Path coverage plus boundary-value testing catches most logic errors in small controllers. A fault-injection test (forcing a sensor to a fixed value) checks fail-safe behaviour. Regression testing re-runs earlier tests after every change.
Before a lift, car or medical device is approved, engineers present test evidence to independent reviewers. Being clear about assumptions and limits is part of the job, not an admission of weakness.
Worked example 1
Write edge-case tests for 'IF moisture < 30 THEN water'.
Moisture 29 → water (just below). Moisture 30 → don't water (exactly on: 30 < 30 is false). Moisture 31 → don't water. Sensor stuck at 0 → it would water every cycle! Improvement: add a daily limit of 200 ml so a broken sensor can't flood the pot.
Common mix-ups
- A failed test means a failed project.
✓ Failed tests are evidence that drives improvement. Recording them honestly is a strength. - Testing the normal case is enough.
✓ Most bugs hide at edges (exact thresholds) and in rare paths, so test them deliberately.
5.Practice
Practice, not a test. Wrong answers get a hint and another try.
Practice 1
A rule says IF distance < 10 cm THEN stop. Which set of distances is the best edge-case test?
Practice 2
A plant waterer's moisture sensor gets stuck reading 0 (bone dry). Which design change makes the machine safest?
Practice 3
You changed a threshold to fix a failed test. What should you do next?
Practice 4
Your flowchart has 5 paths and 2 thresholds. You test every path once plus 3 edge values per threshold. How many tests is that?
Practice 5
Your simulated machine assumes no friction. What should your presentation say?
6.Apply it
Finish your term project: write and run your test plan (every path, every edge, one broken-sensor case), make one improvement and re-test, then prepare a 3-minute presentation or one-page poster using your sketch, flowchart and test table.
7.Reflect
Concepts: The design cycle and prototyping · Testing and debugging · Constraints, budgets and trade-offs