SHENZHEN, China, July 19 — Inside Mattel’s sprawling test lab here, scores of technicians are doing their worst: setting Chicken Dance Elmo dolls on fire, wrecking Hot Wheels cars and yanking at the limbs of Dora the Explorer. The lab workers are paid to break toys, pick apart their innards, and analyze the raw materials that go into them.

The goal is to protect young children from the serious harm that poor construction or dangerous components can bring. But it is also to protect Mattel, the world’s biggest toy maker, from what is increasingly viewed as the risk of doing business in China.

The recent wave of recalls and warnings from China has ignited worldwide concern about the safety of Chinese products, potentially mucking up a global system built, in large part, on outsourced manufacturing. As a result, companies are trying urgently to figure out how to do business here, without risking their reputation, consumer trust, or customers’ lives.

Mattel may have some of the answers. In the 1990s, critics charged the company with running sweatshops in Asia. Now, independent analysts, and even watchdog groups, say Mattel may be the best role model for how to operate prudently in China.