The diagnosis often involves a breath test, blood test, or stool test. Doctors might also use an endoscopy to get a closer look at the stomach's interior and retrieve tissue samples.