An EGD test is a diagnostic and/or therapeutic procedure used to help in the diagnosis or treatment of stomach/duodenal ulcers, inflammation, gastroesophageal reflux disease (GERD), cancer, or dysphagia (swallowing problems) and other problems in the upper gastrointestinal tract.