I was wondering if there is a good resource such as a checklist for anticipating the various failure cases of common Cocoa operations and tasks.
I'm just starting to learn a bit about Unit Testing, and it seems like the most critical dimension in determining how useful the tests will be is in the programmer's ability to anticipate the ways in which their code could possibly fail. I realize this is a skill that is learned over time through lots of experience and becomes automatic, but are there resources out there to help develop this skill?
Some of example cases that quickly come to mind are:
I'm just starting to learn a bit about Unit Testing, and it seems like the most critical dimension in determining how useful the tests will be is in the programmer's ability to anticipate the ways in which their code could possibly fail. I realize this is a skill that is learned over time through lots of experience and becomes automatic, but are there resources out there to help develop this skill?
Some of example cases that quickly come to mind are:
- Handling nil and NULL cases
- Fencepost errors
- Unavailable resources (memory, diskspace, missing files etc.)
- Handling odd Unicode characters (e.g. Kanji)
- Very large and small numbers as well as 0
- Errors resulting from someone subclassing your class