Developer Product Briefs
An In-Depth Look at Visual Studio Team System
Visual Studio Team System provides a wealth of tools in one place. Explore all aspects of this integrated suite of tools.
An In-Depth Look at Visual Studio Team System
Visual Studio Team System provides a wealth of tools in one place. Explore all aspects of this integrated suite of tools.
by David Nelson and Jeff Levinson
June 28, 2006
Visual Studio Team System (VSTS) is a suite of tools designed to allow a development team to communicate not only with one another, but with stakeholders, in real time. It also contains a set of tools for developing architectural views of a system, generating code from certain views, testing code at all stages (during and after development), and integrating the testing experience with project management. At a high-level view, VSTS is divided into four areas: integration, architecture, development, and testing. Each of these areas contains tools that cater to a different facet of the development team. Some of the tools are available to all groups of users, and some are targeted at a specific group associated with only one role. A complex hierarchy governs teamsthe larger the team, the more complex the hierarchy (see Figure 1).
Team System is also designed, from the ground up, to help an organization implement an effective development methodology, whether it's Microsoft Solutions Framework (MSF), Rational Unified Process (RUP), Extreme Programming (XP), Scrum, or any of a dozen other types. The purpose in implementing a structured methodology is the same as the goal of the rest of the VSTS suite of toolsto build better applications for a lower cost both in the short term and the long term. This concept of integrating methodology into the development process is ingrained in all aspects of Team System.
VSTS comes in four different editions—Team Edition for Software Architects, Team Edition for Software Developers, Team Edition for Database Professionals, and Team Edition for Software Testers)—and a core component called Team Foundation Server (TFS). Team System features out-of-the-box functionality, but it is also highly extensible. Joining the Microsoft Visual Studio Industry Partner (VSIP) program allows you access to the VSTS APIs, letting you integrate virtually any tools you have into the VS IDE.
Team Foundation Server is the "team" in Team System. Without it, all of the other components of VSTS are essentially standalone components that run on the client. Once TFS becomes part of the picture, the various client pieces start to work together as a cohesive unit.
Team System provides a framework in which applications can be built. Many companies these days are working to improve their processes by using the Capability Maturity Model Integration (CMMI) from Carnegie Mellon's Software Engineering Institute (SEI). Microsoft, with Visual Studio Team System, is releasing the only methodology recognized by SEI as being CMMI level 3compliant. This methodology is the MSF version 4. The template and instructions on how to use the methodology are all included with Team System. You might ask, "What is so significant about this?" In order for a company to provide software to the U.S. government, the company should, at a minimum, be CMMI level 3certified.
Team Foundation Server: Core Components
Team Foundation Server contains a new source-code control that is backed by SQL Server 2005 and designed for large-scale teams. It is a welcome edition to the developer's toolbox and allows an easy alternative to Visual SourceSafe. It also supports project managers and overall application reporting to the stakeholders. You can also use this tool to implement policies to ensure that code meets certain requirements before it is checked in (see Figure 2). This ensures that the code base is always stable.
Another key piece of TFS is the project site. This Windows SharePoint Services site serves as a central communication tool for the entire team (see Figure 3). Stakeholders can go to this Web site to review the current status of various tasks on the project, view nightly build and test reports, and have discussions or ask questions of the team. SharePoint also serves as a project-documentation repository (with version control).
Team Build is a component of the foundation that allows a server or workstation to become a build machine. Team Build automatically gets the latest version of code from Team Source Code Control (or a specific version), compiles it, deploys it, and runs any automated tests (unit or Web tests) against the build. The results of the compilation and testing are stored in the Team System data repository.
Work item tracking is another feature of TFS in which you can create work items in Microsoft Project (directly from the work breakdown structure) or Microsoft Excel and load them into Team Foundation Server. You can assign these work items to developers who, when checking their items into the source-code control, can associate changes (or bugs) against specific work items. The status of these work items is then reflected on the project site. Work item association can be enforced through policies as well.
The final feature of TFS is the reporting component. A team's project reporting is backed by the new version of SQL Reporting Services (see Figure 4). Out of the box, the reports cover areas such as number of open bugs/closed bugs/in-work bugs, work item status, build results, and so on. As an added bonus, SQL Reporting Services features an end-user ad-hoc report builder so users can create their own reports or customize existing reports. This, combined with the Team System data repository, allows an organization to mine the data for trends in the overall software development lifecycle.
Architect Edition Encompasses Designers
Various types of architects, each with different responsibilities, can work on a single project. The one thing that all architects have in common is that they must communicate aspects of the architecture to various stakeholders in various ways. It is in this spirit of building and then communicating the architecture that Microsoft provides the designers in the Team Edition for Software Architects (see Figure 5). VSTS provides four designers: Logical Datacenter Designer, Deployment Designer, System Designer, and Application Designer.
These designers are a core tenet of Microsoft's focus on model-driven architecture. However, VSTS moves models out of the cumbersome, documentation-only realm and into the practical realm. The problem with modeling with other tools is that the models are abstract representations of the architecture. They do not mean anything. The designers in VSTS have a concrete implementation. When you create a model with VSTS, you also generate the configuration for that model, which is based upon physical properties of the object you're deploying your application to (this includes skeleton code for the entire application). This allows VSTS to check for inconsistencies in your architecture against a representation of the actual physical machines you will be working with.
On top of this approach, VSTS introduces a new concept called a "domain-specific language," which is the "language" in which the concrete implementation of hardware or software is written. This allows the end users of VSTS to build model objects against which specific implementations can be validated. Microsoft has released a set of tools specifically for creating domain-specific languages (see Additional Resources). The language is a set of metadata that describes the physical implementation of a given configuration. These designers are built in concrete terms, so their intended audience (whether data architects or infrastructure architects or other application architects) understands them easily.
Team Edition for Software Architects also includes everyone's favorite modeling tool, Visio. This tool is available in all editions of VSTS, but will probably be most used by architects. Visio for Visual Studio allows for the creation of UML diagrams and provides the ability to model different views for different audiences of the application. Visio allows you to create those abstract, notional views that are helpful in trying to figure out and pinpoint what the architecture will be and then communicate it to everyone else.
Create Better Code With Developer Edition
The Team Edition for Software Developers provides tools that allow developers to understand code faster, generate code from models, write unit tests, and analyze code for errors. The goal of these tools is to reduce the amount of time developers need to actually write code and to ensure that the code that is produced is of a higher quality than they might be turning out currently.
The Class Designer is available in all editions of VSTS because it is useful to a wide range of people (see Figure 6). Architects can use the tool to create high-level class designs. Developers can fill in the diagrams in order to generate skeleton classes that they can then fill in the details for. And testers can use the Class Designer to understand the relationship between classes in order to help them analyze errors.
The Class Designer also generates code dynamically based on the model, reads changes in code, and incorporates those changes into the model. The key point here is that the model and the code are never out of sync. This solves the problem of documentation becoming stale. You might be asking yourself if this is a complete departure from the UML standard. It is not (see the sidebar, "Microsoft, UML and Visio," for more insight).
Once the general outline of code is written, tests can be written for the code. They can also be written after the code is finished. It is entirely up to you, but one thing is certainthe unit-testing component of VSTS will make the process a lot easier, faster, and more streamlined.
Creating a unit test is as easy as right-clicking on a class and method, selecting Create Tests, and filling in a couple of variables. It could also be more complicated, because unit testing supports data-driven testing, which allows for powerful testing capabilities without having to rewrite the unit tests continually or write many tests for one method. The unit-testing functionality is also part of the Team Edition for Software Testers.
As part of the unit-testing functionality, VSTS also provides a cool code-coverage tool (see Figure 7). This tool not only tells you what percentage of your code was covered vs. not covered, but it will show you as well. The code can actually be highlighted to show you fully covered lines of code, partially covered lines of code, and code that is not covered at all. To give you an idea of how important this tool is, take the following example. You write a method 100 lines long, and you run the unit tests against the code. The results all come back as passing, which is good, but the code covered is indicated at 60 percent, which is bad because 40 lines of code were never touched. This indicates that while all your tests passed, you either did not test something you should have or there is no way to test that code and so it is dead code that should be removed.
Since the inception of .NET 1.0, Microsoft has had a relatively unsupported free tool called FxCop (see Additional Resources). VSTS incorporates this tool into the IDE so that code analysis on managed code can be performed as part of a compilation and policies can be written against the results of the analysis (see Figure 8). This tool was created originally to ensure that Microsoft developers were following the correct standards when writing the .NET Framework. If you follow the coding recommendations of this tool, you will be writing to the same standards as Microsoft (in terms of format, completeness, and the standards of the .NET Framework).
VSTS also incorporates a performance-analysis tool that allows developers to test their code for bottlenecks. In the past, typical performance testing around a .NET application involved monitoring a lot of Windows Performance Monitor logs, which provided less-than-helpful information. The new performance tool allows you to either instrument or sample your code depending on the situation so you can gather detail at the individual method level or at the application level. Best of all, you can institute performance monitoring on a production application to pinpoint specific problems that might not have been apparent during development.
Finally, VSTS incorporates a tool to help developers of unmanaged code. This tool, called PREfast, has been in use within Microsoft for several years as a means to check C/C++ code for common errors such as buffer overruns. Microsoft has "productized" it for inclusion in VSTS. You can run this analysis tool simply by checking a box in the project properties. It is customizable to the extent that it allows you to implement checks not included in the out-of-the-box product.
Build Better Databases With Database Professional
The newest component of Visual Studio Team System, scheduled for release by the end of the year, is Team Edition for Database Professionals. It's designed to allow you to create, manage, and test databases in a way that wasn't possible before without specialized tools and extensive work. Using the Database Professional edition, you can perform a number of operations on databases which are of value to the developer and the DBA alike.
SchemaCompare allows you to compare Database Projects (a new type of project with this edition) to an existing database's schema or compare two database schemas to each other (see Figure A). You can update a schema with changes or script those changes to be run at a later date. Better yet, you can also compare data in one database with data in another version of the database. As part of this process, you can update the data so it's identical across databases.
Beyond the comparison features are the data-generation features which are useful for development and testing. The DataGenerator tool comes with default data generators for each column, including binary, string, and numeric generators. You can generate data based on statistical distributions or use special generators such as the regular expression generator or the databound generator, which lets you pull data from an existing data source. As with other tools in Team System, the data generators are fully extensible.
The last piece of Database Professional is the ability to perform unit testing on database objects. Using the same unit testing framework that is available with the Developer and Tester editions, you can write unit tests against stored procedures, tables, functions, and other objects. These tests can be data-driven, called through the MSTest command-line tool or the MSBuild tool.
Test Your Code With Test Edition
The final component of Visual Studio Team System, Team Edition for Software Testers, is devoted to testing all aspects of the code. It includes unit-testing functionality, load testing, manual testing, Web testing, and test management.
Test management is a key component of the testing infrastructure because it allows you to organize your tests. You can run tests in a non-interactive fashion from the command line or from the Team Build process. You can organize tests into lists in order to run them on like processes. Dependencies can be created between tests via an Ordered Test List, and individual tests or lists of tests can be slated to run at any given time. The Team Edition for Software Developers includes a cut-down version of this test-management tool.
More and more applications are moving to the Web in today's Internet- and intranet-based world. Because of this, Microsoft created a Web-testing tool that, combined with the load test, is completely different and far, far more powerful than the Application Center Test (ACT) was. You can record tests interactively and play back tests that are displayed visually for you as the test is running (see Figure 9).
You can change the tests in the IDE and convert them to coded tests, allowing you the freedom to do virtually anything in a test you want through managed code instead of scripting, which previously had to be done with ACT. All of the information about a test is recorded. If you want to record something additional, you can code a custom extraction rule. You can also validate a result in the page and take an action based on the result. The tests can also be run with results supplied from a database. This means that the testing can include dynamic navigation of a Web site. You can add think times to each step of the test to simulate real-world browsing of a Web site.
The Team Edition for Software Testers also features manual testing, which allows you to run tests that are based off of a list of steps. The pass/fail status of these tests is recorded just as any additional test is, and code coverage (if enabled) is captured for these tests as well. You can write the steps for these tests in Microsoft Word or in a plain-text file in any format your organization uses.
Finally, load testing is designed to see how your application (both hardware and software) performs in a real-world load simulation (see Figure 10). You can set the type of browser that is accessing the site, the type of network connection the browser is using to access the site, the way in which the think times are simulated (set times or a normal distribution), and which tests are actually run as load tests and their distribution. You can also set ramp-up times, or the tests can be run at a constant user load.
The tests can be run from the local machine, which simulates all of the connections, or they can be run via agents and a controller from many different machines. The controller directs the agents to run the test(s) and records the result in one location. A typical setup for this is a lab where you might have 20 test machines hitting one box with a Web site. This saves you the time and effort of starting the tests on all of the machines individually. Every aspect of the test is recorded from both the software and the hardware perspective, and errors are stored for later analysis. The entire test result is saved to the Visual Studio data repository (if you are working with the Team Foundation Server piece).
Visual Studio Team System provides a wealth of tools in one place. The tools work together to help you and your organization produce better quality code with less error in a shorter period of time. The hassle of using 10 different tools from six different vendors is over. And for those times when you want tools with additional features or you want to use a tried-and-true tool, you can always add them in through the open and extensible API.
This article was adapted from Jeff Levinson's and David Nelson's new book, Pro Visual Studio 2005 Team System [Apress, ISBN: 1590594606].
About the Authors
David Nelson is an expert with Microsoft server technologies. He is an associate technical fellow at The Boeing Company and works as an enterprise solution design and integration architect.
Jeff Levinson is an expert with Microsoft development tools and holds MCSD (.NET and VS6) and MCDBA certifications. He also works as a solution design and integration architect at The Boeing Company.