In some cases, doctors may treat ulcers without diagnosing them with specific tests and observe whether the symptoms resolve, thus indicating that their primary diagnosis was accurate.More specifically, peptic ulcers erode the muscularis mucosae, at minimum reaching to the level of the submucosa (contrast with erosions, which do not involve the muscularis mucosae).Confirmation of the diagnosis is made with the help of tests such as endoscopies or barium contrast x-rays. The tests are typically ordered if the symptoms do not resolve after a few weeks of treatment, or when they first appear in a person who is over age 45 or who has other symptoms such as weight loss, because stomach cancer can cause similar symptoms. Also, when severe ulcers resist treatment, particularly if a person has several ulcers or the ulcers are in unusual places, a doctor may suspect an underlying condition that causes the stomach to overproduce acid.An esophagogastroduodenoscopy (EGD), a form of endoscopy, also known as a gastroscopy, is carried out on people in whom a peptic ulcer is suspected. It is also the gold standard of diagnosis for peptic ulcer disease. By direct visual identification, the location and severity of an ulcer can be described. Moreover, if no ulcer is present, EGD can often provide an alternative diagnosis. One of the reasons that blood tests are not reliable for accurate peptic ulcer diagnosis on their own is their inability to differentiate between past exposure to the bacteria and current infection.
If a peptic ulcer perforates, air will leak from inside the gastrointestinal tract (which always contains some air) to the peritoneal cavity (which normally never contains air). This leads to "free gas" within the peritoneal cavity. If the person stands, as when having a chest X-ray, the gas will float to a position underneath the diaphragm. Therefore, gas in the peritoneal cavity, shown on an erect chest X-ray or supine lateral abdominal X-ray, is an omen of perforated peptic ulcer disease. Classification
Peptic ulcers are a form of acid–peptic disorder. Peptic ulcers can be classified according to their location and other factors. By location
Duodenum (called duodenal ulcer)
Esophagus (called esophageal ulcer)
Stomach (called gastric ulcer)
Meckels diverticulum (called Meckels diverticulum ulcer; is very tender with palpation)

Modified Johnson
Type I: Ulcer along the body of the stomach, most often along the lesser curve at incisura angularis along the locus minoris resistantiae. Not associated with acid hypersecretion. Type II: Ulcer in the body in combination with duodenal ulcers. Associated with acid oversecretion. Type III: In the pyloric channel within 3 cm of pylorus. Associated with acid oversecretion. Type IV: Proximal gastroesophageal ulcer. Type V: Can occur throughout the stomach. Associated with the chronic use of NSAIDs (such as ibuprofen). Macroscopic appearance
Gastric ulcers are most often localized on the lesser curvature of the stomach. The ulcer is a round to oval parietal defect ("hole"), 2–4 cm diameter, with a smooth base and perpendicular borders.