How should I test my program

After putting my code on ideone, ideone is giving correct output on the sample input but codechef is saying the solution is wrong.Why??

Use codechef compile and run ide https://www.codechef.com/ide

Codechef should improve its testing technique.

We test our code in other sites and ide they work fine there, but when submit in codechef it simply says WRONG ANSWER. seriuosly? shouldn’t it clearly state whats went wrong. Its so irritating ti see that message again and again having no idea what did go wrong.