By testing a stool sample, the doctor can tell if there is bleeding or infection in the intestines.