Just a few years ago a 15-month-old girl—her stomach, arms and legs swollen and her hands and feet crusted in weeping, yellow scales—was rushed to the emergency room at the University of Texas Southwestern Medical Center in Dallas. Laboratory tests indicated a host of nutrition problems.

The child's mother, during the previous year, had told doctors that standard infant formula seemed to provoke vomiting and a rash. The mother and her pediatrician assumed the girl was allergic to the formula and switched her to goat's milk. Symptoms persisted, though, and the baby was switched again, to coconut milk and rice syrup. At 13 months, the pediatrician noted yet another red, swollen rash and ordered an allergy test, the child's first. The test identified coconut as a so-called high-reaction class, and coconut milk was removed from her diet. Reduced to a diet of rice milk, the child's symptoms worsened.

In the ER, doctors determined the girl suffered from kwashiorkor, a nutritional disorder rarely seen in the developed world. She was fed intravenously and evaluated by a team that included pediatric allergist J. Andrew Bird, who used more sophisticated methods to test her response to coconut and cow's milk, wheat, soy, egg white, fish, shrimp, green beans and potatoes. To her mother's astonishment, the toddler showed no adverse reaction to any of them. After a few days of steady nourishment and a course of antibiotics to clear her skin of various infections, she was released from the hospital into a life free of food restrictions. (Her digestive upsets appeared to be caused by a variety of common ailments that would have almost certainly cleared on their own.)

The problem was not in the baby but in the tests. Common skin-prick tests, in which a person is scratched by a needle coated with proteins from a suspect food, produce signs of irritation 50 to 60 percent of the time even when the person is not actually allergic. “When you apply the wrong test, as was the case here, you end up with false positives,” says Bird, who co-authored a paper describing the Dallas case in 2013 in the journal Pediatrics. And you end up with a lot of people scared to eat foods that would do them no harm. Bird has said that he and a team of researchers found that 112 of 126 children who were diagnosed with multiple food allergies tolerated at least one of the foods they were cautioned might kill them.

Kari Nadeau, director of the Sean N. Parker Center for Allergy Research at Stanford University, says that many pediatricians and family physicians are not aware of these testing flaws. “When it comes to diagnosis, we've been in the same place for about 20 years,” she observes. To move forward, Nadeau and other researchers are developing more advanced and easily used methods.

Food allergies are real and can be deadly, but mistakenly slapping an allergy label on a patient can be a big problem as well. First, it does not solve the person's troubles. Second, a diagnosis of allergies comes with a high price: a few years ago Ruchi S. Gupta, a pediatric allergist affiliated with the Northwestern University Feinberg School of Medicine, estimated the annual cost of food allergy at nearly $25 billion, or roughly $4,184 per child, with some of that attributed to medical costs but even more to a decline in parents' work productivity.

There is a mental health price as well: children who believe they have a food allergy tend to report higher levels of stress and anxiety, as do their parents. Every sleepover, picnic and airplane ride comes fraught with worry that one's child is just a peanut away from an emergency room visit or worse. Parents and children must be ever armed with an injectable medicine that can stave off a severe allergic reaction. The prospect of a lifetime of this vigilance can weigh heavily on parents, some of whom go so far as to buy peanut-sniffing dogs or to homeschool their children to protect them both from exposure to the offending food and from the stigmatization of the allergy itself.

Pediatric allergist John Lee, director of the Food Allergy Program at Boston Children's Hospital, has heard more than his share of horror stories. “Food allergies can be terribly isolating for a kid,” he says. “One parent told me his child was forced to sit all alone on a stage during lunch period. And siblings can feel resentful because in many cases parents don't feel they can take family vacations or even eat dinner in a restaurant.”

Diagnosing a food allergy usually begins with a patient history and the skin-prick test. If the scratch does not provoke a raised bump surrounded by a circle of red itchiness, the patient almost certainly is not allergic to the material. But positive tests can be harder to interpret because skin irritation does not necessarily reflect a true allergy, which is a hypersensitivity of the immune system that extends through the body. In a real allergy, immune components such as IgE antibodies in the blood are stimulated by an allergen. The antibody binds to immune cells called mast cells, which then triggers release of a cascade of chemicals that produce all kinds of inflammation and irritation. But levels of allergen-specific antibodies in the blood are quite low even in allergic people, so running a simple blood test is not an answer, either.

The diagnostic “gold standard” for food allergy is a placebo-controlled test. A potential irritant is eaten, and the body's response (a rash, say, or swelling) is compared with what happens after eating something that looks like the irritant but is benign. For example, a patient who might be allergic to eggs is given a tiny amount of egg baked into a cake, along with a taste of egg-free cake. Ideally, the test is double-blind, meaning that neither the patient nor the allergist knows which cake contains egg. The accuracy rate of these tests, for both positive and negative results, is about 95 percent, according to Lee.

Unfortunately, this procedure is tricky, time-consuming, expensive and relatively uncommon; experts agree that few allergy sufferers have access to it.

James Baker, who is a physician and immunologist and CEO of the nonprofit Food Allergy Research & Education (FARE), says his organization is tackling this problem by setting up 40 centers around the country to administer food challenges with all the necessary precautions. “You have to be prepared to treat or transport people to the emergency room if they react,” he asserts.

Scientists are also looking for something easier to use. One promising newcomer to the diagnostic arsenal is the basophil-activation test (BAT). Basophils, a type of white blood cell, excrete histamines and other inflammatory chemicals in reaction to a perceived threat—such as an allergen. Nadeau and her colleagues have designed and patented a test that involves mixing just one drop of blood with the potential allergen and measuring the reaction in basophils. In pilot studies, the procedure diagnosed allergies with 95 percent accuracy in both children and adults, a rate similar to that of food-challenge tests.

BAT is still in the research phase and requires more studies with a larger, more varied population, but another approach—allergen-component testing—has already been approved by the U.S. Food and Drug Administration for peanut allergies. Lynda Schneider, a pediatric allergist and director of the Allergy Program at Boston Children's Hospital, says that some children have a mild sensitivity—but not a full-blown allergy—to one protein in peanuts. Rather than testing them with crude mixtures of lots of proteins found in nuts, Schneider's component tests isolate specific proteins and then challenge the patient with those. By sorting out which protein is prompting the negative reaction, physicians can determine with a high degree of accuracy whether the patient is truly allergic to peanuts.

Schneider wants to get beyond diagnosis and into treatment. Omalizumab is a monoclonal antibody that binds to IgE antibodies and prevents them from glomming on to mast cells, which triggers the allergic cascade. In a recent study, Schneider and her colleagues administered this so-called anti-IgE drug over the course of 20 weeks to 13 children who were known to have peanut allergies while giving them a gradually larger dose of peanuts. During the anti-IgE phase, none of the children developed an allergic reaction to peanuts, although two did have a recurrence once the anti-IgE regime ended. “The anti-IgE allowed their system to go through a desensitization process,” Schneider says.

Kids who are allergic to milk and eggs can be gradually desensitized by heating these foods for 30 minutes or so, Bird has found. The heat changes the shape of these proteins, which vastly reduces their tendency to provoke allergies. This is not a home remedy, and it is done under medical supervision, but studies of kids who are fed small amounts of heated egg or milk show the children are far more likely to acquire a tolerance to these foods over time—that is, more likely to outgrow the allergy. A study called Learning Early About Peanut Allergy (LEAP) showed that exposing children to tiny amounts of peanut products early in their life dramatically reduced the incidence of allergy.

Scott H. Sicherer, a professor of pediatrics, allergy and immunology at the Icahn School of Medicine at Mount Sinai, takes the early desensitization idea a step further. He suggests children can best avoid food allergies if they eat a wide variety of foods at an early age, run in the open air and “play in the dirt.” A little less protection from the world, he says, may be the best protection from allergies.