You can use Visual Studio Analyzer to isolate faults by taking advantage of the many Visual Studio Analyzer events that components can generate and that Visual Studio Analyzer can record. Visual Studio Analyzer provides many predefined events, including:
You only have to write code for your own custom events. The events you collect are stored in an event log, which you can view in many different ways and at different levels to help you understand which component is at fault.
You use the events that Visual Studio Analyzer generates as the keys to understand where the failure might be. For example, if your application sends queries to a database and receives results back, you can add code to generate Visual Studio Analyzer events when these activities occur. You can then examine the Event List view to ensure that the queries do, in fact, occur as expected.
Traditional debugging tools work at a low level to determine the exact fault in a software component. Visual Studio Analyzer is not designed as a low-level debugger. Instead, Visual Studio Analyzer is a high-level tool that helps you understand which component or set of components is failing, so that you can use your low-level debugger strategically, thus reducing the overall cost of debugging.
Suppose you are trying to locate a fault in a multi-tier application. Let's suppose further that you've already run Visual Studio Analyzer against a session of your application. (It can be useful to run Visual Studio Analyzer against each application as part of your final quality assurance passes, and then save the Visual Studio Analyzer project as a baseline.) The following steps illustrate how you can use Visual Studio Analyzer to assist you.
For more information on Visual Studio Analyzer projects, event logs, filters, and views, see Understanding Visual Studio Analyzer Projects, Understanding Visual Studio Analyzer Event Logs, Understanding Visual Studio Analyzer Filters, and Understanding Visual Studio Analyzer Views.
You can use Visual Studio Analyzer to identify more complex faults, such as miscommunication between components. You accomplish this by adding Visual Studio Analyzer event generation code to your application.
For example, suppose your development team has created a large two-tier application that consists of multiple objects within a single executable. Many of these objects update a database using ODBC. A problem exists in the application that you cannot detect using normal Visual Studio Analyzer events, because it involves a bug between objects within the executable, as opposed to between separate components within the application. Your team wants to add code to your application so you can use Visual Studio Analyzer to trace the activity across the different logical components. You might use the following steps to accomplish this.