“I didn’t run into any bugs in testing, so there are no bugs…right?”

Unfortunately, large scale software is too complex to be ‘bug-free’ – no matter how much testing you do. You simply cannot test for all the different ways your users are interacting with your application. Therefore, it’s important to understand the differences between errors and exceptions in your application, and the correct ways to handle them so you can take a proactive approach to maintaining a healthy application for both your development team and your end users.

The Problem With Just Testing

Even with the most thorough testing process, you are still only testing specific situations and have your own bias that comes into play.

Imagine suddenly thousands of users are using your application in different ways than you or your team even thought of – they will almost certainly run into something you didn’t during testing.

How to Properly Handle Errors in Your Application

Simply put, bugs can lead to both errors and exceptions. Errors and exceptions are terms that have different meanings depending on who you ask.

The main question should be how can you better handle these errors and exceptions so they don’t have negative consequences.

First, let’s look at some definitions, and why the differences are important.

Errors and Exceptions – What’s the Difference?

Some programming languages have their own definitions for errors and exceptions, but I’d like to define the differences.

*Note: The examples and specifics in this article are from .NET but the key principles are not language specific.

Errors

Programming errors where there is no way to recover/continue gracefully and usually need a programmer to step into and change the code to make the fix. Errors can sometimes be turned into exceptions so that they can be handled within the code.

Errors can usually be avoided with simple checks, and if simple checks won’t suffice errors can also turn into exceptions, so that the application can handle the situation gracefully.

#devops #software testing #debugging #error handling

How to Handle Errors and Exceptions in Large Scale Software Projects
2.80 GEEK