LATE one night in a Ginza bar, a veteran executive at Nissan recounted to your correspondent the early days of exporting to America, when his firm's cars were known abroad as Datsuns. Before being shipped, all export models went through additional inspections because the cost of fixing warranty claims so far from the factory and its supply chain would wipe out any profit made on them. On the rare occasions they did break, the parts had to be shipped in from Japan.

One day, the story goes, a plane carrying a crate of such parts lost an engine over the Midwest and had to jettison its cargo to save weight. On the ground below, a farmer noticed the debris falling from the sky. “Ah,” he mumbled to himself, “it's raining Datsun cogs.”

Shutterstock

The point the Nissan man was making with this shaggy-dog story was that the quality of Japanese cars sold abroad was well above average while they were being shipped from factories in Japan and extra precautions taken to save on warranty claims. At the time, this strategy made perfect sense. Japanese carmakers saved a ton of money from not having to finance expensive inventories around the world. Meanwhile, Honda, Toyota and Nissan (the Datsun name was dropped in 1982) gained reputations, deservedly so, for quality and reliability. Until Toyota's recent fiasco, those brand values remained largely intact, despite Japanese carmakers relocating much of their capacity to factories overseas.

The modern view is that carmakers everywhere have learned the secrets of Japanese manufacturing and now build products of comparable quality. That is debatable. Price for price, Japanese manufacturers still manage to make their products more reliable than average. At least, they did until recently. But, in what might now be viewed as a straw in the wind, Toyota (or, rather, its luxury Lexus brand) was dethroned from the top spot in last year's J.D. Power report on vehicle dependability.

J.D. Power and Associates, a market-research firm based in Westlake Village, California, issues this report on the American car market every year. Lexus had topped it for the previous 14. In 2009, though, Buick and Jaguar came joint top. Toyota still did well overall. Its vehicles earned nine awards for reliability in specific market segments. No other marque, save Ford's Lincoln division, which took two, won more than one such award. But the balloon of invincibility had been punctured.

The person who began the process of inflating that balloon was, ironically, an American. From 1950 onwards W. Edwards Deming, an expert on quality control, taught a generation of Japanese managers how to improve their products. The lesson they took back to their factories was the overriding importance of statistical quality control (SQC). In industrial countries elsewhere, even in Deming's own America, manufacturers were still relying on inspection and rejection of faulty parts—a horrendously wasteful process.

One of the main tools for SQC that Deming introduced to his Japanese disciples was the control chart, invented by Walter Shewhart at Bell Labs, the research arm of America's former telephone monopoly, Bell System, in the 1920s. Shewhart was among the first to recognise that data collected from observations of manufacturing processes rarely follow a simple Gaussian distribution (bell curve) in the way that natural phenomena like human height do. Instead, each manufacturing process exhibits its own pattern of variation. Some display a controlled variation inherent to the process itself. Others display uncontrolled variation caused by something external to the process.

The distinction between the two patterns goes to the philosophical heart of probability theory. Deming and his colleagues at Western Electric, the manufacturing arm of Bell System, coined the terms “common cause” for the former and “special cause” for the latter.

For quality purposes, any common cause of variations in manufacturing (tool wear, say, or poor set-up) can be predicted statistically from previous observations, and the process controlled accordingly. Any special cause in variation is something that comes out of the blue from outside the process (a power surge, perhaps, or an operator falling asleep) and is beyond the scope of statistical forecasting.

The purpose of a control chart is to identify instances when variations in manufacturing are causing the specifications of a product to move above or below a mean value by more than a critical amount—say, three standard deviations. The standard deviation is a measure of the spread of a statistical curve such as a bell curve around its mean. The idea, then, is to define acceptable tolerances above and below this mean value, and design the manufacturing process to draw in the tails of the curve so that those tolerances are met a given fraction of the time. If the tolerance limits are three standard deviations from the mean, and the curve is a true Gaussian distribution, then 99.7% of production will within the zone of tolerance. If that falls, it suggests something had gone wrong. This way, any unpredictable special-cause effects can be spotted and corrected before doing too much harm.

Many refinements have been made to statistical control and the theory of quality assurance since Deming's days—with acronyms like TQM, CMMI, MSA, QFD, FMEA and APQP, each with its own loyal band of adherents and eras of fashion. One of the more successful has been the Six Sigma strategy for identifying and removing the causes of defects, pioneered by Motorola in the 1980s. (Sigma is the Greek letter that mathematicians use to represent the standard deviation in equations.) Today, Six Sigma is used by two-thirds of the firms in Fortune's “500” list.

Processes that operate with Six Sigma quality (in principle, within six standard deviations of a mean value) over a short sampling period produce defect levels over the long term of less than 3.4 per million—providing, of course, a lot of other management practices are also in place. When achieved, this translates into a production yield of 99.99966%. Six Sigma is said to have saved Motorola more than $17 billion over the years.

So, how did Toyota—a manufacturer that has made some of the most significant contributions to the science of quality assurance—manage to screw up so badly? It is not just the move offshore. Though the firm has 52 overseas plants in 27 countries, the quality practices honed at its headquarters in Aichi prefecture can be packaged and transplanted to Mexico or Kentucky just as readily as to a Komatsu press shop.

Nor was it Toyota's obsession with overtaking General Motors at any cost to become the world's largest carmaker. There is no evidence to suggest that increasing volume on modern production lines will lead inevitably to some loss of quality.

Instead, two recent trends, both software related, hint at the reason behind Toyota's unexpected decline. One is the shortening of product-development cycles generally in the car industry. These are down from a typical four or five years to little more than 15 months, thanks to computer-aided design and manufacturing, and the virtual simulation of the resulting products. To save money and time, Toyota has even dispensed on occasion with building test “mules” and other engineering prototypes.

The other trend is the wholesale replacement of mechanical components with electronic controls. It started with ignition systems, then spread to air-conditioning, cruise-control, engine-management, throttle linkages, transmissions, and now the steering and braking systems. Drive-by-wire is not cheap, but it reduces the number of components needed to do the job. It also allows them to do extra things as well as to compensate for wear and changes in driving style and road conditions.

But software is not hardware, and software “engineers”, despite their appropriation of the name, are a different breed from the sort that bash metal. Programming digital controllers is not one of Toyota's core competences. Even with the most diligent of testing, bugs will always find their way into software. Right now, it seems Toyota is learning that lesson the hard way.