Case Study
Learn how to handle essential exceptions by analyzing sample inputs and user actions in this case study.
We'll cover the following
This case study will look at some ways that we can find—and help the users fix—potential problems with the data or the application’s computations. Both the data and the processing are possible sources of exceptional behavior. They aren’t, however, equivalent; we can compare the two as follows:
Data
Exceptional data is the most common source of problems. The data may not follow the syntax rules and have an invalid physical format. Other, more minor errors may stem from data not having a recognized logical organization, for example, the wrong spelling of column names. Exceptions can also reflect users attempting to perform an unauthorized operation. We need to alert users and administrators of invalid data or invalid operations.
Processing
Exceptional processing is what is commonly called a bug. An application shouldn’t try to recover from these problems. While we prefer to find them as part of a unit or integration testing, it’s possible that a problem escaped our scrutiny and wound up in production. Then it is exposed to the users of our software. We need to tell the users that something’s broken and – as gracefully as possible – stop processing or crash. To continue in the presence of a bug is a serious breach of trust.
In our case study, we have three kinds of inputs that need to be examined for potential problems:
Types of input
-
The known
Sample
instances, provided by a botanist, and reflecting expert judgment. While this data should be exemplary in its quality, there’s no guarantee that someone didn’t accidentally rename a file and replace good data with something invalid or otherwise unprocessable. -
The unknown
Sample
instances, provided by researchers. These may have all kinds of data quality problems. We’ll look at a few of them. -
Actions taken by a researcher or a botanist. We’ll review the use cases to see what actions should be allowed by each class of user. In some cases, these problems are prevented by offering each class of user a focused menu of actions they can take.
We’ll start with a review of the use cases, so we can identify the kinds of exceptions that are required by this application.
Get hands-on with 1200+ tech skills courses.