Most bugs fail cheaply. A small category fails expensively, and the discipline is not writing better code. It is learning to see which actions belong to that category before they bite you.
The andon cord at Toyota could be pulled by any worker on the line. Most software products have inverted this, and the inversion costs more than anyone admits.