Sub topic 12
Verifying that the device works and cannot be skipped
This chapter assumes you know the difference between an error and a defect, the difference between prevention and detection devices, and the contact, fixed-value, and motion-step methods. You should also be able to read short Python snippets. Here you learn how to prove that a poka-yoke device works, and that people cannot get around it.
Why installing a device is not the finish
A poka-yoke device is a claim: "this error can no longer reach the customer." A claim needs evidence. Many devices are installed, announced as fixed, and never tested. Months later the defect returns, and nobody knows whether the device failed, was bypassed, or was never effective.
Verification answers three separate questions:
- Does it detect or block the error? When the error is deliberately introduced, does the device respond?
- Does it leave good work alone? When the work is correct, does the process still flow without false stops?
- Can it be defeated? Can an operator, a developer, or a tired person at the end of a shift skip it without much effort?
A device that passes only the first question is a trap for the next person. A device that passes the first two but fails the third works only while everyone is cooperating.
Test with known-bad and known-good inputs
The simplest test is to feed the device a deliberate error and watch what happens. This is sometimes called a challenge test, or a "red rabbit" test when a known-bad item is planted in the flow.
For a physical device, such as a fixture that accepts a part only in the correct orientation, you prepare:
- Known-bad samples: parts flipped, rotated, missing a feature, or with a feature in the wrong place.
- Known-good samples: parts that meet the specification, including parts near the edges of the tolerance range.
Then you run both through the device and record the result of each.
| Input | Expected result | Failure means |
|---|---|---|
| Known-bad part | Blocked or flagged | A miss: the error can still escape |
| Known-good part | Passes without delay | A false alarm: the device slows or stops good work |
| Known-good part at the tolerance edge | Passes | The device is too tight and will cause stoppages |
| Known-bad part just outside tolerance | Blocked or flagged | The device is too loose |
The edge cases matter most. A device that rejects only grossly wrong parts has little value, because gross errors are usually caught anyway.
Count both kinds of failure
Two numbers describe a detection device.
- The miss rate is the share of known-bad items that got through.
- The false alarm rate is the share of known-good items that were stopped.
For a control (shutdown) device protecting against a serious error, the target miss rate is zero in your test set. Any miss is a design problem, not noise. The false alarm rate is a trade-off. If it is high, people will start to resent the device and look for ways around it. This leads directly to the next section.
Test the device in software
The same method applies to code. Use known-bad and known-good inputs as automated tests. The state-transition table from earlier in this tutorial is a good candidate, because every allowed and forbidden move can be listed.
from enum import Enum
import unittest
class OrderStatus(Enum):
DRAFT = "draft"
PAID = "paid"
SHIPPED = "shipped"
ALLOWED_TRANSITIONS = {
OrderStatus.DRAFT: {OrderStatus.PAID},
OrderStatus.PAID: {OrderStatus.SHIPPED},
OrderStatus.SHIPPED: set(),
}
def change_status(current: OrderStatus, new: OrderStatus) -> OrderStatus:
if new not in ALLOWED_TRANSITIONS[current]:
raise ValueError(f"Cannot move from {current.value} to {new.value}")
return new
class ChangeStatusTests(unittest.TestCase):
def test_every_pair_matches_the_table(self):
# Check all 9 pairs, so no combination is left untested.
for current in OrderStatus:
for new in OrderStatus:
if new in ALLOWED_TRANSITIONS[current]:
self.assertEqual(change_status(current, new), new)
else:
with self.assertRaises(ValueError):
change_status(current, new)
def test_skipping_a_step_is_refused(self):
with self.assertRaises(ValueError):
change_status(OrderStatus.DRAFT, OrderStatus.SHIPPED)
def test_every_status_has_a_row_in_the_table(self):
# A new status added without a table row would raise KeyError later.
self.assertEqual(set(ALLOWED_TRANSITIONS), set(OrderStatus))
if __name__ == "__main__":
unittest.main()The first test covers all nine pairs of statuses, so it checks the known-good moves and the known-bad moves together. The last test guards a second failure: someone adds a new status and forgets to add its row, so the device crashes with a KeyError instead of giving a clear refusal. A test that fails when the table is incomplete verifies the device against future change.
Verify that it cannot be skipped
Even a device with a zero miss rate fails if people can route around it. Bypass checking is a separate step, and it is where most field failures are found.
Ask these questions about every device:
- Can it be switched off, unplugged, or covered? Is that easier than using it?
- Is there a faster path that does the same job without the device?
- Does using the device cost the operator time, effort, or a penalty that the bypass avoids?
- Does anyone have an incentive to skip it, such as output targets or incentive pay?
- Can the device be satisfied without doing the real check, for example by tapping "confirm" repeatedly?
The last question catches many software devices. A confirmation dialog that says "Are you sure? Yes / No" can be answered by habit. The delete-by-typing-the-name example earlier in this tutorial works because it cannot be satisfied without reading the name.
def delete_environment(name: str, confirm_name: str) -> str:
if confirm_name != name:
raise ValueError("Confirmation does not match the environment name; nothing was deleted")
return f"Deleted {name}"To verify this, test the bypass paths, not only the main path. Try an empty string, a name with different capitalisation, a name with trailing whitespace, and the name of a different environment. Decide for each whether the result is what you want. Then check the surrounding code: if another function deletes environments without calling this one, the device protects only one door.
import unittest
def delete_environment(name: str, confirm_name: str) -> str:
if confirm_name != name:
raise ValueError("Confirmation does not match the environment name; nothing was deleted")
return f"Deleted {name}"
class DeleteConfirmationTests(unittest.TestCase):
def test_exact_name_proceeds(self):
self.assertEqual(delete_environment("staging", "staging"), "Deleted staging")
def test_near_misses_are_refused(self):
for attempt in ["", "Staging", "staging ", "production"]:
with self.subTest(attempt=attempt):
with self.assertRaises(ValueError):
delete_environment("staging", attempt)
if __name__ == "__main__":
unittest.main()A bypass checklist for physical devices
Walk the process with the operators, not just the engineers. Operators know where the device slows them down. Record each bypass you find, then treat it as a design input.
Common fixes, from strongest to weakest:
- Make the correct path the only path. The part cannot be assembled without the device.
- Make the bypass physically harder than compliance, for example a fixed guard that needs a tool to remove.
- Make the bypass visible, so a supervisor sees it at once, for example a sealed switch whose seal must be broken.
- Make the bypass leave a record, for example a logged override with a name and a reason.
The fourth option is the weakest. A log records a defeat after it happens; it does not stop it.
Check that the device itself stays healthy
Devices wear out. A limit switch sticks, a sensor drifts, a lamp burns out, and a software rule gets edited. If the device fails silently, the process looks protected when it is not.
Plan for this in three ways:
- Fail safe. Design the device so its failure stops the process rather than letting it continue. A sensor that loses power should read as "error present," not "all clear."
- Periodic challenge. At a set frequency, such as the start of each shift, run a known-bad sample through the device and confirm it is caught. Record the result.
- Automated tests. In software, keep the tests above in the build pipeline, so a change that weakens the device fails the build.
Confirm the result in process data
Bench tests show the device can work. Process data shows whether it does work. After the device is in use, compare the defect rate or the count of the specific error with the rate before installation, using the same measurement method and a long enough period to see the pattern.
Watch for these signs:
- The error count falls to zero or near zero: consistent with the device working.
- The error count falls, then slowly rises: the device may be wearing out, or people are learning to bypass it.
- The error count does not change: the device may not address the real cause, or the error was misidentified. Return to root cause analysis.
- The error count falls but a different defect rises: the error has moved. Check whether the device pushed people toward a new shortcut.
Also track the device's own signals. For a warning or shutdown device, the number of times it triggers is useful data. Many triggers show that the upstream process still produces many errors. A trigger count of zero over a long period is ambiguous: either the errors stopped, or the device is not working. The periodic challenge check tells you which.
Edge cases
- Rare errors. If the error happens once a year, process data cannot verify the device in a reasonable time. Rely on challenge tests.
- Multiple devices on one error. Test each device alone. Otherwise one working device hides a broken one.
- Changeovers. A device tuned for one product can pass wrong work after a changeover. Include the changeover in the test plan.
- New people. Test with someone who did not help design the device. Designers know unconsciously how to use it correctly.
Exercises
Exercise
A fixture accepts a bracket only when it is oriented correctly. In a test, you run 50 known-bad brackets and 50 known-good brackets. Three bad brackets pass, and two good brackets are stopped. Give the miss rate and the false alarm rate, and say which result matters more for a device that guards against a safety-related error.
Show answer
The miss rate is 3 of 50, or 6%. The false alarm rate is 2 of 50, or 4%. The miss rate matters more for a safety-related error, because every miss is an error that can escape. The target is zero misses, so the fixture needs redesign before use. The false alarms should also be reduced, because they push operators toward bypassing the fixture.
Exercise
The tests for deleteenvironment pass, but a colleague points out that a separate function, forcedelete(name), removes environments with no confirmation. What verification step did the tests miss, and what is a sound fix?
Show answer
The tests did not check bypass paths in the surrounding code. The device guards one entry point, and forcedelete is a second route that avoids it. A sound fix is to make forcedelete require the same confirmation, or to route all deletion through one function so there is a single door. Then add a test that confirms every deletion path refuses a wrong confirmation.
Exercise
Six months after installing a shutdown device, the line records zero stops. A manager says this proves the errors are gone. What do you say, and what check would settle the question?
Show answer
Zero stops is ambiguous. The errors may be gone, or the device may be broken or disabled. Run a known-bad sample through the device. If it stops the line, the device works and the zero reflects real improvement. If it does not, the device has failed and the zero is meaningless. Scheduling this challenge at the start of each shift prevents the question from arising again.