A stool analysis is several tests done on a sample of stool (bowel movement). It is done to find a problem in the digestive tract. Or it may be done to find the cause of symptoms such as pain, gas, or diarrhea. Your doctor will tell you if you need to stop eating certain foods or stop taking medicines before collecting the sample.