.NET FAQs Unleashed!

 
 


    



    



Difference between Bugs, Exceptions and End User Errors

By Vishal Khanna

Humans are bound to make errors, and programmers are humans. Applications may crash or stop running because of different reasons. The crash may happen during the application development OR during production when the application is already released. Now this hiccup may be categorized in three ways:

1) Bugs - When the cause of the error is because of a mistake done by a developer, its called a bug. A developer may be well experienced but still may write bad code by mistake. For instance, a declared file object may not be disposed, and may later cause a memory leak, well thats a bug. Normally, during development of enterprise applications, bugs are caught by Testers and categorized based on their criticality. But there may be times when even the Testing team might miss out on catching a bug. Well, thats danger!

2) Exceptions - An exception may be a System Exception or an Application Exception. Now say, a file being parsed by the code has been deleted by some one from the location being searched, then a "File Not Found" exception may crop up. Such exceptions are usually handled by well written code by using Exception Handlers. These errors are usually caused at runtime. They may be difficult to prevent at times, but surely may be handled by good code. There might be a scene where the programmer may only catch the exception through good code but may not prevent it.

3) End User Errors - An error may be invoked by an input made by the end user. For example, an invalid string may be entered in a Textbox that expects a number. These types of errors may be handled using controls like RegularExpressionValidator, or code that handles the keyboard,  mouse, stylus input. These errors if not handled efficiently by the developer, may cause terrible nightmares. For example, an application may be hacked or damaged using SQL injections, if at all, input boxes allow bad input that may crack the code.

The three points above are the broad categories into which errors may be divided.

Happy Programming.

Cheers!