BT

Your opinion matters! Please fill in the InfoQ Survey!

Review: Exception Hunter

| by Jonathan Allen Follow 247 Followers on Apr 14, 2008. Estimated reading time: 1 minute |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

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.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login 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

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT