What is the philosophy for throwing an exception? That is to say, an exception is just another control structure like "if". When using an API and the documents say "throws foo.exception" then it's just another piece of the API and the tests for application code that calls the API should include the testing for the exception. Then it's a matter of deciding if the application code handles it locally or passes handling higher up the call stack to a centralized location or ignores it.
In other words, code should be tested for not handling exceptions just like it is for handling them.
Comments
What is the philosophy for throwing an exception? That is to say, an exception is just another control structure like "if". When using an API and the documents say "throws foo.exception" then it's just another piece of the API and the tests for application code that calls the API should include the testing for the exception. Then it's a matter of deciding if the application code handles it locally or passes handling higher up the call stack to a centralized location or ignores it.
In other words, code should be tested for not handling exceptions just like it is for handling them.
Good luck.