BT

Review: Exception Hunter

by Jonathan Allen on Apr 14, 2008 |

Unhandled exceptions are the bane of any application, especially those that run without user interaction. Ideally, the compiler would detect and alert developers to these potential issues, but current .NET compilers cannot even determine which exceptions might be thrown.

To address this Red Gate has released Exception Hunter. This tool analyzes methods to determine which exceptions they can throw. The reports can be viewed interactively or chained to an automated build process like CruiseControl.

Like most Red Gate software, Exception Hunter has a simple and straightforward interface. But unfortunately, simplicity does not always translate into ease of use. While the tool is capable of generating reports, it can only do so from the command line. This simple task isn't to be found anywhere in the GUI.

More frustrating is that the method list does not indicate which methods actually throw exceptions. Some methods are in bold, but that just means the method is not inherited form a base class. The user has to drill into each method separately.

All this could be overlooked except for one thing, the number of false positive is ridiculously high. Consider this simple VB application

Source Code

The exceptions these few lines can throw include:

  • ArgumentException 6
  • ArgumentNullException 4, 6
  • ArgumentOutOfRangeException 4, 5, 6
  • FormatException 4, 6
  • IndexOutOfRangeException 6
  • InvalidCastException 6
  • InvalidOperationException 6
  • ObjectDisposedException 6
  • IO.PathTooLongException 6
  • NotSupportedException 6
  • NullReferenceException 6
  • OutOfMemoryException 4, 5, 6

One could only imagine the noise a non-trivial application would generate.

While effective exception analysis would be a boon to the industry, Red Gate's Exception Hunter demonstrates that we just are not to that point yet. And one has to wonder if this is even a solvable problem.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Reflector Add-In by Jason Bock

I've been working on a Reflector add-in that does something similar to this tool. It's on CodePlex:

www.codeplex.com/ExFinderReflector

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT