Usually it is necessary to obtain a good history, a physical examination and some screening tests. On rare occasions, even more sophisticated tests are required. We can't, at least not yet. Fortunately, we know that IBS is not a serious condition. While it does not protect you from other illness, it does not lead to the development of more serious diseases such as cancer, colitis, obstruction, etc.
Treatment is aimed in two directions.
The first is to educate you about the condition so that the symptoms and their cause are less mysterious and less frightening. The second method is to try to reduce those things in your life which, while not the cause of IBS, may help aggravate it. Again, we don't have all the answers, but certain aggravating factors are known. Too much or too little exercise. A change in routine.