1) a breath test. it has to be arrange by your doctor, however, it is not readily available.
2) exclude all foods that contain more free fructose than glucose from your diet for at least one month and see how you feel.
I was diagnosed using the second method. Within 48 hours of removing high fructose foods I noticed a siginificant change in pain and D (it can also produce C). It took me a couple of years to figure out how much excess fructose I could tolerate.
-------------------- STABLE: ♂, IBS-D 50+ years - Science of IBS