InfoQ

News

Review: Exception Hunter

Posted by Jonathan Allen on Apr 14, 2008 06:50 AM

Community
.NET
Topics
Debugging
Tags
Static Analysis

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.

Reflector Add-In by Jason Bock Posted Apr 16, 2008 5:53 PM
  1. Back to top

    Reflector Add-In

    Apr 16, 2008 5:53 PM by Jason Bock

    I've been working on a Reflector add-in that does something similar to this tool. It's on CodePlex: http://www.codeplex.com/ExFinderReflector

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.