DevPartner Fault Simulator takes on .Net fault handling
Version 2.0 improves integration, helps developers and testers "ruggedize" .Net code.
In electronics engineering, a fault simulator predicts what will happen to a circuit when a component malfunctions, without having to actually install a bad component in the circuit. DPFS (DevPartner Fault Simulator) applies a similar idea to software: It shows you what will happen to your .Net application when an abnormal situation occurs, without having to actually create the situation.
Fault Simulator 1.0 arrived in 2005, to mixed reviews. InfoWorld’s previous review praised the concept but raised questions about the utility of the implementation. The biggest concerns were DPFS 1.0’s lack of integration with other Compuware tools, and its inability to affect classic C++ exception handling.
DPFS 2.0 still does not simulate faults for classic native C++ exception handling, although it does simulate faults for managed C++. It also now integrates with Compuware’s Coverage Analysis tool and has a number of other improvements that will make .Net developers’ and testers’ lives easier. However, there’s room for growth -- the feature set and documentation still have some rough spots.
DPFS 1.0 showed developers where it could simulate .Net faults by displaying curly underlines in Microsoft Visual Studio. The underlines appeared beneath lines of code calling .Net functions that DPFS recognized as ones that throw exceptions.
Click for larger view.
Click on the icon at the end of a method, and you can add XML documentation comments for the possible exceptions to the method, indicating that you want to allow exceptions to be caught by callers of the method. Once you’ve built the application, the new XML comments can be read by DPFS and used to create simulated faults for the methods they document.
I think the try/catch block generation is a major productivity boost for a developer trying to make an application more robust. DPFS doesn’t actually write the body of the catch clauses, just the block skeleton; you still have to think about what action is appropriate to handle each fault.
I was pleasantly surprised to find that if you have multiple successive lines of code that can generate the same fault, DPFS 2.0 correctly surrounds all of them with a single try/catch block.
For the Code Testers