📚 Course contents
AI & Computer Vision, lesson 36 of 52
Automation Stress Test: A Fire Drill for Your System
Introduction
Your system works in the classroom. Will it work at dusk, on a shaky camera, with a player in a yellow bib that looks like the ball? A school runs a fire drill so the real emergency holds no surprises. Today you'll run one for your system: make conditions worse step by step, find where it breaks, and decide what to fix first.
By the end of this lesson you'll be able to:
- Design a stress test that changes one thing at a time
- Measure detection rate, position error and goal correctness, and say what each hides
- Name the breaking point of each stress
- Distinguish a missed goal from a false alarm and say which matters more for their product
- Explain boundary flicker and one fix
- Write a failure policy: stop, warn, or carry on
Working principle
A system is only as good as its worst day
You have built a detector, a trigger, an API and a light. They work on your clean test clip. A match day has low sun, lens smudges, a cheap camera and a yellow bib. A stress test finds out which of those breaks you, before match day.
How to stress test
- Start with a clean clip where you know the truth (the ball's real positions, or at least the real goals).
- Make it worse in one way at a time, in steps from mild to terrible.
- At each step, measure: how often is the ball found, how far off is it, and are the goals right?
- Write down the first step where it breaks. That is the breaking point.
One change at a time is the key: otherwise you cannot tell which one broke it.
Three numbers, not one
| Number | What it tells you | What it hides |
|---|---|---|
| Detection rate | How often something was found | Whether it was the right thing |
| Position error | How close the found thing is to the truth | Nothing, but needs ground truth |
| Goals correct | Whether the whole system still works | Why it failed |
In our test a yellow bib gave 100% detection and 354 px error. The detection rate alone says "perfect".
Two kinds of failure
| Meaning | Cost | |
|---|---|---|
| Missed goal | A real goal was not detected | The fans are unhappy |
| False alarm | A goal was announced that did not happen | Everyone loses trust |
Which is worse depends on the product. A goal alarm that cries wolf will be switched off. A highlight reel that misses one goal is forgiven. lesson 19 gave you the words (false positives and false negatives); now you see them in action.
Failures come from different places
| Layer | Example | Fix |
|---|---|---|
| Picture | Dark, bright, blurry, noisy | Better camera position and settings |
| Detector | Colour clash with a bib | Different colour, a trained model (lesson 24), shape checks |
| Trigger | Ball on the zone line | Hysteresis, more frames |
| Hardware | Cable unplugged | Fall back (lesson 35) |
Know when you can't trust the picture
A cheap check can warn you. The health check (Cell 6) looks at brightness and sharpness every second. If the picture is bad, show a warning light rather than a wrong score. A system that says "I'm not sure right now" is more trustworthy than one that is confidently wrong.
Decide the failure policy
For each failure, choose in advance: stop, warn, or carry on. A dark picture: warn. A lost ball for three seconds: carry on. Ten seconds with no ball at all: warn. Write the policy in a table and put it in the product notes (lesson 47, lesson 50).

