Tuesday, January 30, 2007

Getting Code Coverage Without Tests ...

The following steps shows how to get code coverage on .NET applications without having to actually run "tests" in the VSTS context. You will need either VSTS for Developers, VSTS for Testers, or VSTS Team Suite Edition installed to have the right tools to make it work.

Using the commandline you can instrument any .NET assembly, but beware of code signing as it might cause problems. Once the code is instrumtented, you need to get the "listener" running to collect the code coverage data generated, as follows:
  1. Open a VS command prompt
  2. Instrument your assembly by executing:
    vsinstr /coverage Assemblyname.dll
  3. Start the Code Coverage monitoring process by executing:
    vsperfcmd /start:coverage /output:yourfilename.coverage
  4. Run your Application that contains the instrumented code
  5. End the Code Coverage monitoring process by executing:
    vsperfcmd /shutdown
  6. Open the file "yourfilename.coverage" found in your application directory in Visual Studio to view the results.

TeamRM ... Robust Work Item Management Tool

TeamRM, a Visual Studio 2005 plug-in that enables more robust work item management and visualization by allowing the user to create and manage Parent/Child and Link relationships between Team Foundation Work Items is now available in Team System Rocks Files Area. This is a fully functional pre-release version in need of your feedback. Please use the file comments or forum to send them your feedback.

TeamCity adds support for TFS

TeamCity is an innovative, IDE independent, integrated team environment targeted for .NET and Java software developers and their managers. It automates and coordinates key collaborative processes to eliminate manual systems and delays, providing tight integration with multiple build and test tools, real-time unit test frequency, server-side inspections and code coverage analysis.

JetBrains, the makers of TeamCity have begun integration with TFS. They have a pre-release of TeamCity available for download. It's recommended that everyone to check it out and let them know what they think about it.

Keyboard Shortcut Reference Posters for VS

VS Keyboard Shortcut Reference Posters are now available for download free from Microsoft Download Center.

You can download your language of preference and print at your convenience from the following links.

Visual Basic, Visual C# and/or Visual C++

Thursday, January 25, 2007

TFS Powerful Easy Reports Add-In

TFS ships with a number of reports that allow you to track your progress of a project but modifying or creating new reports in Microsoft Visual Studio™ can prove to be challenging. Radius, from 90 Degree Software, integrates directly with TFS and delivers a powerful but easy to use reporting solution that allows you to rapidly create and use reports based on existing TFS queries.

The Radius Advantage:

  • Powerful and easy to use: Radius delivers report designers with an easy-to-use, yet powerful, reporting solution. The results-oriented user interface, designed to look and feel like Microsoft Office 2007, intuitively provides users with quick access to the features they need most, right when they need them. People who are already familiar with tools like Microsoft Office Word, Excel or PowerPoint will intuitively pick up and use Radius features with little instruction. As a result, report designers can create, modify and deploy user specific reports that are meaningful, interactive, and meet the needs of their diverse end-users, and they can do this quickly, increasing productivity.
  • The Radius TFS add-in: Provides TFS users the ability to use an existing team or personal TFS workitem query as the report query. The user is then able to proceed in creating visual report objects such as tables, charts and matrixes. The add-in also allows the project manager to quickly define filters based on TFS items such as AssignedTo values. The project manager can define custom groups of developers to filter the report quickly without needing to define this in the TFS query. Once the project manager has added the TFS query or queries to the report all of the report design features are available.
  • Search, Reuse and Securely Share: One of the powerful features Radius provides is the ability to search, re-use, and securely share any report or report component. As a result of leveraging existing reports and report components, organizations can decrease report deployment time, reduce the time, and costs required, to deploy reports.

The tool is really worth the check ...

Wednesday, January 24, 2007

TFSWarehouse Cube Corruption

Ever got your TFSWarehouse Cube corrupted?

One of the reasons I got that corruption was due to machine failure that corrupted some of the cube's XML files, I spent quite some time trying to figure out the problem and how to solve it, but luckily I got to fix it easily in 4 steps.
  1. Open SQL Management and Stop the TFS Analysis Service on the TFS Data Tier.
  2. Go to "C:\Program Files\Microsoft SQL Server\MSSQL.2\OLAP\Data" on the TFS Data Tier, and delete the folder TFSWarehouse.0.db and the XML file TFSWarehouse.0.db.xml
  3. Run the following command on the TFS Data Tier to rebuild the cube, it can be found in "C:\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\Tools"SetupWarehouse -o -s TFSServer -d TFSWarehouse -c warehouseschema.xml -a TFSServiceAccount -ra TFSReportsAccount -mturl http://TFSServer:8080
  4. Start the TFS Analysis Service on the TFS Data Tier and Process the cube to get back on track.

That's all you need to do. Hope that will help ...

Monday, January 22, 2007

VSTS Load Test Simulating Browser Cache

Below are some notes that can allow the Load Test containg Web Tests to attempt simulating the caching behavior of the browser

  • There is a property named on each request in a Web test named “Cache Control” in the Web test editor (and named “Cache” on the WebTestRequest object in the API used by coded Web tests)
  • When the Cache Control property on a request in the Web test is false, the request is always issued.
  • When the Cache Control property is true, the VSTS load test runtime code attempts to emulate the Internet Explorer caching behavior (with the “Automatically” setting) as described in this article:
    (This includes reading and following the HTTP cache control directives.)
  • The Cache Control property is automatically set to true for all dependent requests (typically for images, style sheets, etc embedded on the page).
  • In a load test, the browser caching behavior is simulated separately for each user running in the load test.
  • When a virtual user in a load test completes a Web test and a new Web test session is started to keep the user load at the same level, sometimes the load test starts simulates a “new user” with a clean cache, and sometimes the load test simulates a return user that has items cached from a previous session.
    This is determined by the “Percentage of New Users” property on the Scenario in the load test.
    The default for “Percentage of New Users” is 100 in which case all user sessions are started with a clean cache.
    This is probably not correct for most applications where there are return users, so users should consider the most appropriate value to use for this setting depending on the actual usage of the application being load tested.

There was a bug in the original release of Visual Studio 2005 Team System that is fixed by the SP1 update where the load test was not honoring the “max-age” cache control directive.

TFSServerManager PowerTool

BHarry, is working on a great tool called TFSServerManager that contains lots of capabilities mainly for dogfood statistics, it should be checked out on his post

I can't wait to see it out and start using it...

Sunday, January 21, 2007

What Can TFS Tell You?

Throughout the software development life cycle countless data streams into the TFS data warehouse.
It takes many data points to illustrate a trend and guide decision making for managing a project.
The two process templates that ship with TFS include a number of reports for visualizing this data. However, do they answer the questions you're asking, or the questions your stakeholders are asking you?

The TFS Reporting team developed a brief (15-minute) survey to assess your reporting needs as they working their way on the next release of the product.
By participating in this survey, you may very well save yourself the time of creating your own custom reports. Take the survey and let your needs be known! Team Foundation Server Reporting Survey

Thursday, January 18, 2007

Advanced Load Testing Features of Visual Studio Team System

Bill Barnett, a Software Design Engineer in Microsoft, wrote a great article on MSDN describing all the bits and pieces of Load Test features in VSTS.
Visual Studio Team Test Edition provides two capabilities that can allow
users to create load tests of web sites quickly and easily: the Web Test
recorder and the Load Test wizard. In fact, these tools make this process so
easy that it is tempting to use the web tests and the load tests that result
from using these tools without much modification. However, to use the web
testing and load testing capability most effectively it is beneficial to
understand how to use other web test and load test properties that are not set
by these tools. This note describes some of the most important considerations
for load testing with Visual Studio Team System that are not addressed by the
web test recorder and the load test wizard.

Saturday, January 13, 2007

TfsAdminUtil and Reporting Services Service Account

The following is a snapshot of the error that you might see if the Reporting Services data sources are not updated when the account is changed or updated:

Reporting Services Error
  • An error has occurred during report processing. (rsProcessingAborted) Get Online Help

    • Cannot impersonate user for data source 'TfsOlapReportDS'. (rsErrorImpersonatingUser) Get Online Help

      • Logon failed. (rsLogonFailed) Get Online Help

        • For more information about this error navigate to the report server on the local server machine, or enable remote errors

SQL Server Reporting Services

If your Reporting Services service account has changed because you moved your Team Foundation Server installation or if you are using a different account, you will need to run TfsAdminUtil ChangeAccount.

In addition to this, you will also need to update the password and/or username for the TfsReportDS and the TfsOlapReportDS data sources manually using the Reporting Services web site at: http:///Reports/

More documentation on this topic: http://msdn2.microsoft.com/en-us/library/ms252480(VS.80).aspx

Thursday, January 11, 2007

Changes to the VSTS for DB Professionals Download

Recently some changes to the download of the Visual Studio Team Edition for Database Professionals Add-on were made to try to clear up some initial confusion customers were reporting.

This is the add-on which installs into Visual Studio 2005 Team Suite edition and provides the additional functionality provided by Visual Studio Team Edition for Database Professionals.

Here is a quick list of the changes:
  • Add-on no longer called a "Trial"
    The add-on can be used in a trial mode when installed with the Visual Studio 2005 Team Suite 180-day Trial Edition. When running in this mode you will get all of the Team Suite and Database Professionals functionality, and both of these solutions will stop working when your trial time period expires. However, if you own a "full" (non-trial) edition of Team Suite then this add-on will not expire since you are entitled to receive the Database Professionals functionality for free as a benefit of owning Team Suite edition. Hence it didn't really make sense to name this add-on a "Trial" by default when it can in fact be installed as a full add-on provided that you have an appropriate license to Team Suite.
  • .EXE and .ISO available
    Previously only a .ISO file for download was offered, which required you to either mount that image or use a CD burning program to create media. They are still offering an .ISO file, but now they are also providing a self-extracting archive file (the .EXE) which you can download and quickly run to get started.
  • Documentation Clarification
    Remember that this add-on does not provide the Team Edition for Database Professionals documentation. To get the documentation, you can either view it online or you can download and install a newer version of the MSDN Library which includes this documentation. The latest version is available here.

Hopefully those changes clear up some confusion - but if you still have questions please visit the Team Edition for Database Professionals Forum.

Working Offline with TFS

John Robbins has written a post called Working Offline with TFS. In it, he describes his approach to using Visual Studio when not connected to the Team Foundation Server. As many of you know, the server information is stored in the .sln file, and VS tries to connect to the server whenever you open a solution that contains the server information in its source control bindings. To make things go more quickly, he wrote a couple of custom MSBuild tasks to automate the process of adding and removing the bindings the solution files. While you don't have to remove the bindings while you're offline, it certainly makes opening the solution quicker when you know you can't get to the server.
For synchronizing with the server when he's connected again, he wrote an MSBuild task that wraps tfpt to use the online command. The online command will find and pend edits for any files in version control that are writable and don't already have a pending edit. Optionally, it will find additions and deletions (and there more options still -- run tfpt online /help for more information).
He pointed out a bug in tfpt.exe where you can't get the online command's dialog when standard out is redirected, which was also a bug in tf.exe. I fixed the bug in tfpt.exe to add the /prompt switch. Tf.exe also has the same issue, but we had already fixed the Orcas tf.exe a while back. So, the problem with not getting the online command's dialog as he describes will be fixed when the updated tfpt.exe is released, so long as you add /prompt (I don't know when, but it's not too far off in the future).

Thursday, January 04, 2007

VSTS for DB Professionals Samples Project

A new project is now available on CodePlex for Visual Studio Team Edition for Database Professionals, please check it out http://www.codeplex.com/vsdbpro

The goal of this project is to share and collaborate on Visual Studio Team Edition for Database Professionals related sample projects and sample code.
In order to put some organizations in place they created five categories in which the samples have to fall.
  • Data generators
  • Data distributions
  • Test conditions
  • Sample projects
  • Miscellaneous: tools and other helpful item that make the live of DataDude easier

Wednesday, January 03, 2007

IE Add-In for Submitting Web Bugs to TFS

Check this post (Automatically raise bugs from IE) on the Microsoft Developer Tools UK Sales Team blog for information about an Internet Explorer Add-In Neil Kidd developed for submitting Web Pages bugs with all the necessary accompanying information to TFS.
It can be downloaded from GotDotNet.
I've written an addin for IE to allow users to easily raise a complete bug
report. When the user indicates that there is a problem on the page, the
will create a new Team System Work Item and populate it with the
  • A screenshot attached to the work item.
  • HTML source of the page and any frames and IFrames attached to the work
  • Any style sheets referenced by the page attached to the work item.
  • Any script files referenced by the page attached to the work item.
  • Details about the user's machine and browser (OS version, browser version,
    screen size, ...).

TFS Admin Tool 1.2 Released

Joe Morel just announced the latest release of TFS Administration Tool 1.2 on his blog, which can be found on CodePlex

This release adds the ability to administer TFS installations configured to use only SSL.