Testing the Edge Cases

Make sure you think of the edge cases, while doing your design. That way, even if you are not planning to cover all the cases in your implementation, you can at least leave a comment in the code, mentioning the possible edge cases. That will help those who are going to fix the code, when they hit an edge case in the future and try to fix them.

It is not a bad idea to cover the edge cases in you tests. At least to some reasonable level. Most of the time, in open source development, what I have noticed is that, common success cases are tested. Not the occasional fault cases. However, when that occasional fault case does occurs, the whole system can come down to its knees.

Comments

I prefer to write these edge cases in the tests. These TODO's can be confusing since no one is maintaining them and I've already seen code full of TODO's that were already done in the past or were relevant to earlier code only.