The gastrin test is a blood test that measures the level of the hormone called gastrin in the blood. Gastrin is a hormone which is responsible for secretion of gastric acid aka hydrochloric acid by the stomach. When there has been an intake of food, gastrin is released into the blood. This causes secretion of gastric acid in the stomach. When the acid level of stomach increases, the body produces less gastrin. A gastrin test is conducted when the person is suffering from conditions like diarrhoea, abdominal pain and peptic ulcers. Medicines or antacids used to treat heartburn may also cause gastrin levels to spike up.