Text

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Wednesday, August 7, 2019

Intentional Error

Sometimes it is difficult to test error handling.  Exceptions in different layers of the coding.  If an exception happens you want it to be logged, displayed, or otherwise findable.  If the exception handling doesn't properly make the exception details findable by the support analyst, they will have a tough time positively diagnosing the cause.

Yet to test the exception handling in every layer, one might need to sabotage various things.  Remove a file.  Lock down the permissions.  Temporarily remove an assembly.

Depending on the environment the test is conducted on, the ability to sabotage elements on the server may be difficult or impractical.  Especially for a QA tester that may not have access to the box, or the training to "correctly sabotage" elements on it.

One approach is to pick one of the free form fields of a data record, and establish a series of testing values.  Something easy enough to remember, but not prone to be added to real records.  Like the key words "Intentional Error" followed by a six digit number.

Different sections of the code that process that record can check the field for the key words and a unique number related to that code section.  If the key words and number are detected, the code immediately throws a defined "IntentionalErrorException".  The testing scripts include the key words and numbers to use, where the exception is to be reported, and key elements that must be included for the error to be useful to support analysts.



No comments:

Post a Comment