When a fix breaks something else
Give the main road a longer green and its queue shrinks. What happens to the side road, and the people waiting to cross?
About 30 min · 3 goals · Checked by automated tests; not yet reviewed by an educator
1.Why should I care?
In real systems the parts are connected, so a change in one place ripples through. The most common way to make a design worse is to fix one thing and forget to check the rest. Re-testing everything is how engineers stop that happening.
- ◇ Re-test every requirement after an improvement, not just the one being fixed.
- ◇ Recognise a side effect: an improvement in one place that causes a problem elsewhere.
- ◇ Compare design versions across all requirements to choose the best one.
2.Predict
Version 4 of the plant waterer adds a pump and soil sensor. Water use drops from 1.8 L to 1.1 L. Is v4 better than v3?
Guess first. Being wrong here is how the surprise works.
3.Discover
Start from a timing plan that passes the safety audit. Lengthen one road's green and watch the other measures: the other road's wait, pedestrians, queues. Find a change that lowers the average wait without failing any target.
Can't use the interactive? Read a description instead
The traffic level: tune the greens, clearances, crossing mode and emergency pre-emption for 15 minutes of rush hour, with one road twice as busy as the other and four ambulances. The server checks safety, waits, queues and pedestrians together, so lengthening one road's green can pass one check and fail another.
4.Understand
Side effects
A side effect is an unintended change somewhere else. A longer green for one road means a longer red for the other. A bigger tank lasts longer but might not fit the windowsill. Whenever you change something, ask: what else is connected to this part?
Re-test everything
After each change, re-run the tests for every requirement, not just the one you were fixing. This is regression testing: checking that nothing that used to work has gone backwards. Keeping your tests written down makes it quick.
Compare versions honestly
Lay versions side by side: one row per requirement, one column per version, with pass or fail in every cell. The best version isn't the newest or the cleverest; it's the one that meets the requirements best. Sometimes that's an earlier one.
Explain it another way
Squeeze a balloon on one side and it bulges out on another. Connected systems often behave like that.
Regression testing re-runs earlier tests after a change. Software teams often automate it so every change is checked against every earlier test.
In the traffic Build, the server re-simulates your whole plan and checks safety, waits, queues and pedestrians together: regression testing done for you.
Worked example 1
v2 → v3 of the plant waterer: what changed across all four requirements?
Pots 5 → 6 of 6 (better; now meets). Water 2.6 → 1.8 L (better; now meets). Cost $9 → $11 (worse by $2; still meets). Refill 1.5 → 1.5 min (no change; meets). The cost side effect is acceptable, so v3 is a clear improvement.
Common mix-ups
- The newest version is the best one.
✓ The best version is the one that meets the requirements best, whenever it was made. - If you changed one part, you only need to re-test that part.
✓ Connected parts can be affected. Re-test every requirement.
5.Practice
Practice, not a test. Wrong answers get a hint and another try.
Practice 1
You fix a feeder jam by widening the chute. What should you re-test?
Practice 2
Which version should you present? v3 meets 4 of 4 requirements; v4 meets 3 of 4 but looks more impressive.
Practice 3
v3 costs $11, v4 costs $24 and the budget is $20. By how many dollars is v4 over budget?
Practice 4
What is regression testing?
6.Apply it
Take your last capstone improvement and re-test every requirement, not just the one you fixed. Add a column to your results table for each version. Did anything get worse? If so, decide whether the side effect is acceptable and write down why.
7.Reflect
Concepts: Constraints, budgets and trade-offs · Testing and debugging