An upper gastrointestinal (GI) endoscopy is usually the preferred diagnostic test for GERD and its complications. Esophageal pH monitoring is the most accurate way to tell whether there's stomach acid in your esophagus.