Welcome to Team System Rocks Sign in | Join | Help

AppVerifier: Under The Covers - Part I

This is my first blog post on Team System Rocks! (Thanks to Mickey Gousset for helping set it up). My name is Jean-Luc David - I'm a Team System MVP and the lead author for Professional Visual Studio 2005 Team System (which will be published soon - click on the book cover on the right for more details).

In the process of working with the product and writing the book, you come across features that are real eye openers. That feature for me was AppVerifier. You can easily underestimate it - the only visible clue that it's in the product is the "Start with Application Verifier" option that appears in the Debug menu once you load in a Visual C++ project in VS2005. Even the MSDN documentation has very little details about the feature - however, don't be fooled. AppVerifier has a lot of rich functionality (as you will soon find out).

In case you are not familiar with AppVerifier, it's an essential dynamic testing tool for unmanaged applications. In fact, when someone is talking about the "dynamic test" features of Team System they are referring to AppVerifier. The Team System version of AppVerifier looks for three classes of errors: Heaps, Handles, and Locks. Microsoft picked these three simply because they are the most common errors that crop up in C++ apps. AppVerifier is also available outside of Team System as part of the Application Compatibility Toolkit (an important suite of tools to help you get your app certified for the "Designed for Windows" logo program).

Back to Team System's AppVerifier. Let's say you try to use a NULL handle within your application:

VOID ProblemCode()
{   
      try {
      HANDLE hBadHandle = NULL;
      SetEvent(hBadHandle);
      }
}

AppVerifier will pop up a warning that a handle error was found - then a whole lot rich debugging functionality is surfaced in Team System. You'll get a handle stack trace with the handle value (in this case, 0x00000000). AppVerifier also provides you with a description and some additional information to help you debug your program. On top of that a breakpoint will be added to your Source Control window, you'll be able to view dissassembler information in the Dissassembly window and a task will be created in the Visual Studio Task List. You can try looking at the Call Stack (by clicking Debug > Windows > Call Stack) and view the AppVerifier the Handle Verifier Stop information will appear in the Output window.

I'll be writing a few more posts if you are interested in this feature of Team System. My book contains a much deeper overview. In the next installment, I'll talk about the programming and extensibility features of AppVerifier. Thanks for listening!

* A special thanks goes out to Jennifer Norberg and Prasad Kakulamarri for their insights on the product. :)

Published Sunday, September 18, 2005 5:29 PM by jldavid

Comments

No Comments

Anonymous comments are disabled