September 2006 - Posts

Visual Studio 2005 Team Edition for (unmanaged) C++ Developers

If you're a C++ developer who writes mostly unmanaged C++ code, you may wonder what parts of Visual Studio 2005 Team Edition for Developers apply to you. It's a reasonable concern.

I did a little research and found an excellent post from Rob Caron that links out to dozens of C++ related Team System articles. But it's a little scattershot. A lot of the functionality is inherent to Visual Studio 2005-- not necessarily Team System.

Chris Idzerda (our CTO and a star C++ developer) and I sat down and worked through all the Developer functionality in C++ to figure out what parts of the Developer Edition are helpful for C++ developers. We quickly found that there's a huge divide between native C++ code and managed C++. You can still get many of the benefits of Team System in native C++, but you'll get the most benefit if you're using managed C++.

Here's what we found when we tried using the Team Edition for Developers functionality as an unmanaged code C++ developer:

  • Unit tests

    Unit testing works best for Managed C++ code. In fact, it works identically to unit testing for C# and VB.NET. However, if you're testing unmanaged C++ code, you can still benefit from VSTS unit testing. You have three options:

    1. Create a new managed C++ test project. After creating the project, in the project options, set the General, CLR from /clr:safe to /clr. You will not get auto-generated unit tests, but this will work.
    2. Write a managed C++ wrapper for your code. Then auto-generate the unit tests.
    3. Create a new test project in any language, then call your existing code using [DllImport] or COM interop.

    We think the best options are #1 and #2. We have a sample C++ project in Visual Studio 2005 that demonstrates option #1. Note that this is not the only way to integrate managed C++ test code with unmanaged C++, but it worked OK for us. Check it out and see what you think.

  • Code Coverage

    The code coverage story is a bit strange for unmanaged C++ code. But it does work! We got it to work by following John Cunningham's series of posts (one, two) that explain exactly how to do it. We manually instrumented our executable, manually ran the tests, the results were automatically gathered, and we were able to manually double-click on the resulting *.coverage file and show source code highlighting. Very cool! Although a bit, er, manual..

  • Code Analysis

    Under the project properties, you'll notice both Static (General, Code Analysis) and Dynamic (General, Application Verifier) analysis options.

    It looks like the dynamic half of the analysis, Application Verifier, is enabled by default.

    However, you'll need to flip the switches in the Code Analysis sections to enable static analysis warnings. As usual there's a big divide between managed and unmanaged C++ code here; the managed code gets the same comprehensive FxCop-style code analysis you've seen in VB.NET and C#. Unmanaged code can only use the "Enable Code Analysis for Managed Binaries" option. Here's a screenshot from MSDN of the warnings the unmanaged C++ code analysis.

  • Code Profiler

    The good news is that code profiling works nearly identically for unmanaged C++ as it does for C# and VB.NET. However, there is one limitation: only memory allocations for .NET objects can be tracked. If you're writing unmanaged C++ code, you probably aren't allocating any .NET objects. And even if you're writing managed C++ code, you may not be allocating many .NET objects. So keep that caveat in mind.

In general, most areas of Team Edition for Software Developers do work for C++ developers. They even get a few goodies that the rest of us don't, such as the Application Verifier. That said, there's a lot of subtle encouragement to switch to managed C++ development, too.

posted by jatwood with 2 Comments

The Best Team System Book Yet

I'm often asked to recommend books about Team System. Well, I've read them all, and although they're all decent, one stands above all the rest. That book is Software Engineering with Microsoft Visual Studio Team System by Sam Guckenheimer and Juan Perez.

This is one of the rare books that explains "why" and not "how". It is by far the best book on VSTS that I've read.

But don't take my word for it. Read the first chapter online and decide for yourself. Here's a review of the book from The Server Side.

Here's the copy from the back cover, so you get some idea of what's inside:

Software Engineering with Microsoft Visual Studio Team System is written for any software team that is considering running a software project using Visual Studio Team System (VSTS), or evaluating modern software development practices for its use.

It is about the value-up paradigm of software development, which forms the basis of VSTS: its guiding ideas, why they are presented in certain ways, and how they fit into the process of managing the software lifecycle. This book is the next best thing to having an onsite coach who can lead the team through a consistent set of processes.

Sam Guckenheimer has been the chief customer advocate for VSTS, responsible for its end-to-end external design. He has written this book as a framework for thinking about software projects in a way that can be directly tooled by VSTS. It presents essential theory and practical examples to describe a realistic process for IT projects.

Readers will learn what they need to know to get started with VSTS, including

  • The role of the value-up paradigm (versus work-down) in the software development lifecycle, and the meanings and importance of “flow”
  • The use of MSF for Agile Software Development and MSF for CMMI Process Improvement
  • Work items for planning and managing backlog in VSTS
  • Multidimensional, daily metrics to maintain project flow and enable estimation Creating requirements using personas and scenarios
  • Project management with iterations, trustworthy transparency, and friction-free metrics
  • Architectural design using a value-up view, service-oriented architecture, constraints, and qualities of service
  • Development with unit tests, code coverage, profiling, and build automation
  • Testing for customer value with scenarios, qualities of service, configurations, data, exploration, and metrics
  • Effective bug reporting and bug assessment
  • Troubleshooting a project: recognizing and correcting common pitfalls and antipatterns

It's great stuff. If you buy only one book on Team System, this should be it.

posted by jatwood with 1 Comments