Yeah! Im working on handling some negative scenarios. And while thinking over it, thought of writing this blog.

While writing code, we consider a few scenarios and start developing. When we give it to QA team, they start testing the positive cases first and then the negative cases. Obviously, there will be lots of issue when the negative cases are executed.

When I look at the code written, we have written a significant percent of code for handling negative scenarios than the positive cases. I get irritated when I look at a big code segment that handles some remote scenario that doesn’t have much impact on the customers. How to handle this?

What is my expectation as a customer when something goes wrong?

  • I should know that something had gone wrong in the product
  • I should know what is the immediate step that I should take. (90% of the problems on Windows are not observed on a reboot. Doesn’t matter whether it gets fixed or not. But, there is no damage done to me. Something like these should be known to the me).
  • When I take those actions, the product should continue working or resume from where it was. It should not ask me to revert everything.

What the developers should do?

Before deciding to fix a negative scenario, evaluate the following:

  • How frequent this issue might happen?
  • What will the customer loose when this issue happens?
  • Find out a corrective action at this point and see how difficult it would be for the customer to take it? (The corrective actions can be to restart the machine or process, or modifying some file or change some setting somewhere.)
  • Will the product continue to work after the customer took the actions?

Based on the answers for the above questions, handling the scenario can be decided. Some of the resolutions can be automated. Due to time constraints, if that can’t be done, we should have answers for all these questions.

If any of the questions says high impact, it is not always required to fix the complete issue. It would be good to do though. But, writing code upto a level where the system can resume without any data loss, should be good enough.

If all these questions says less impact, then “Cummon guys, Lets spend that energy for giving something kool to the customer.”

Happy to hear what others think!!!