Microsoft Visual Studio 2005 Unleashed
Only three variables in play at any given time affect the impact and success of a software project: speed, quality, and money. Put another way, you can "improve" the success of any given application by delivering the application faster, by delivering a better application, or by spending less money to develop the application. If you truly want to optimize against this "faster, better, cheaper" troika, you need to look beyond the role of the developer and the singular process of writing code and start to contemplate how you can enable the other roles and skill sets that are prevalent in the software development life cycle. You also have to pay attention to more than just the development phase of any project. You need to pay attention to project planning, initial architecture analysis, test suites, and work item management. Visual Studio Team System recognizes this basic premise and elevates the role of Visual Studio in the software development process by providing a suite of interconnected tools that focus on all roles and all phases of the SDLC. Visual Studio Team System is the name applied to a set of Visual Studio versions, each of which targets a different role in the software development process. From a product capabilities perspective, you can think of Visual Studio Team System as a team-focused superset of the other available Visual Studio versions such as Visual Studio Professional or Visual Studio Standard (see Figure 17.4). Figure 17.4. The Visual Studio versions.
We discussed earlier the MSF team models: Visual Studio Team System provides tools useful for the architect, developer, tester, and project manager roles. This means that separate products are tailored to the architect, developer, and tester work sets: Visual Studio Team Architect, Visual Studio Team Developer, and Visual Studio Team Test. Project managers are enabled via a set of add-ins, utilities, and reporting functions delivered with the Visual Studio Team Foundation Server. Team Foundation Server also functions as the keystone collaboration and storage component within the team system. Each of these different products surfaces role- and track/activity-specific tools within the familiar IDE. Note Keep in mind the superset relationship between the Visual Studio Team System products (such as Team Architect) and the other Visual Studio versions: The VSTS versions add capabilities (specific to a role) over and above the features and functions found in Visual Studio Professional. Another way to think about it is like this: Anything you can do in Visual Studio Professional, you can also do in Visual Studio Team Architect (or Team Developer or Team Test).
Let's look at the different VSTS products and how they map into the software development process/team model space. Visual Studio Team Architect
Visual Studio Team Architect is, obviously, focused on the architect role. Part of an architect's job is to help the development team and the project management team crisply communicate the design of a system. The design and architecture of a system are typically visualized through the use of models; models are a superb way to construct and think about all the different aspects and variables involved in a large system and from that perspective are great documentation vehicles. Their historical problem is that they are difficult to translate into code and must then be updated to match the code any time the code base changes. Visual Studio Team Architect provides the architect with tools that overcome those problems. Specifically, four designersthe Distributed Application Designer, Logical Infrastructure Designer, Deployment Designer, and Class Designerwork together to deliver dynamic models of a software system. Besides working together in an integrated fashion, these designers are also capable of synchronizing with the system's code. This is the key benefit realized within Visual Studio Team Architect:
We cover these four designers in depth in Chapter 21, "Modeling." Visual Studio Team Developer
Visual Studio Professional already does a terrific job as an integrated development environment; its code authoring editors and designers are both powerful and easy to use. The Visual Studio Team Developer extends the embrace of the developer role by delivering tools to validate code. Using VS Team Developer, you can verify the performance and quality of your code. This edition provides static and dynamic code analysis tools, code profiling, code coverage, and unit testing facilities. Static Code Analysis
Static code analysis is a design-time check of source code that goes beyond the syntax-checking capabilities of the compiler. In fact, if we extend that analogy, if compiler checks are analogous to spelling checks in a word processor, then static code analysis is similar in concept to grammar checking in a word processor: It attempts to determine the meaning of your code and then highlight areas of concern. Code analysis happens at build/compile time; the various analysis checks are controlled on the Code Analysis tab on the project properties dialog box (as shown in Figure 17.5). Figure 17.5. Controlling code analysis options.
Dynamic Code Analysis and Code Profiling
Just like static code analysis works against your code at design time, dynamic code analysis works against your code at runtime. Code profiling analyzes your code to give you information on how your application is running. There are two code profilers. A sampling profiler polls your application and retrieves information about it. An instrumented profiler injects probes into your code at compile time; these probes emit data, which is collected by the profiler. Application profiling is set up using the Performance Explorer. We discussed the Performance Explorer in Chapter 5, "Browsers and Explorers." Code Coverage and Unit Testing
Code coverage and unit testing work together. Unit testing is accomplished via an attribute-based framework (similar to that employed by JUnit and NUnit if you are familiar with those tools). When you place an attribute on a block of code, it will show up in the Test Manager tool (see Figure 17.6). Figure 17.6. The Test Manager.
After creating a test, you can then use the test facilities to determine which lines of code were actually covered by the test. This is done interactively in the code editor window (tested lines of code are shaded green, missed lines of code shaded red) and via a Code Coverage Results window. We cover unit testing and code coverage with VSTS in Chapter 22, "Testing." Visual Studio Team Test
Visual Studio Team Test picks up the testing activities where Team Developer leaves off. In addition to the same profiling, unit testing, and code coverage tools, this edition has tools for load testing web applications, running and analyzing unit tests, and managing test cases. Creating Tests
You can create tests of the following types within Team Test:
Load Tests
Load tests are somewhat unique: VSTS can create a logical testing unit called a rig. Rigs are client computers (known as agents) and a controller used to generated load demand against a system. There are full management capabilities in Visual Studio Team Test to create agents, assign them to a controller, encapsulate a group of agents and a controller as a rig, and run and monitor tests from the rig. We cover load tests in Chapter 22, "Testing." Team Foundation Server
The individual team products can all function individually, but adding Team Foundation Server (TFS) allows the entire team to collaborate seamlessly across work activities and tracks. It even has its own set of enabling technologies. Although TFS serves all the individual roles and constituencies, the project manager role in particular is shored up by the tools provided with Team Foundation Server. Note Team Foundation Server requires Microsoft SQL Server 2005.
Source Control
Team Foundation Server includes a brand-new source control engine that far exceeds Visual Source Safe's capabilities when used with large development teams. The TFS source control engine uses SQL Server 2005 as its backing store instead of the file system and is very scalable up to the largest development teams. In addition to native support for access over HTTP/HTTPS, the TFS source control system also supports check-in policies and shelving:
Note Although most users will leverage the TFS source system within Visual Studio, it also ships with a standalone user interface that can provide administrator and contributor level functionality to individuals who don't own Visual Studio Team System.
Source control is covered in Chapter 19, "Source Control." Work Item Tracking
A work item is the atomic unit within VSTS for tracking and managing activities and work products within the context of a project. Work items can be assigned to any role within the project team and can be assigned to a specific workflow. Work items are powerful in that they can be related to a multitude of items to create a web of connected work products. For example, you may create a work item for a bug report and then link that bug report to a checked-in source code file, a developer, a tester, and the test case that revealed the bug. A set of Microsoft Office add-ins ship with Team Foundation Server to allow project managers to tie into work items from within Office. For instance, a project manager can use the Microsoft Word add-in to generate a status report directly linked to work items in the TFS database. Or the project manager may use the Microsoft Project add-in to automatically generate and sync work items with the action items in the Microsoft Project plan file. Although simple in concept, work items are the single most important collaboration element in VSTS. Consider an end-to-end scenario: You are assigned a work item to fix a bug in your code. You would first review the work item, check out the section of offending code, make the fix, and then use the VSTS development/test tools to automatically run the tests that cover that code section. From there, you would check the changed code back into the source repository. Test would then pick up the ball. When the fix makes it into a build, that build is also linked to the work item. All the while, notifications are sent to interested parties so that others can track the progress of the work item through its workflow. We cover work items in depth in Chapter 20, "Work Item Tracking." Build Automation
Team Foundation Build is a part of the Team Foundation Server. It enables release management roles to run tests against a code base, build the code base, release the code base to a file server, and generate reports about the build and distribute them to the team. Team Foundation Build is a tool and graphical user interface that sits over the top of the MSBuild tool. Chapter 23, "Team Foundation Build," has all the details on using the TFS build automation features. Reports
Because all the work items and other work products in VSTS are stored in a SQL Server 2005 database, TFS is able to leverage the SQL Server 2005 Reporting Services and the SQL Server 2005 Analysis Services to deliver reports about build quality, work item progress, test results, build results, and so on. The Project Portal
Team Foundation Server uses the project template to generate a Windows Sharepoint site containing the correct document libraries and document templates that map to the chosen project type. For instance, creating a project based on the MSF Agile template will produce a SharePoint site with artifact document templates specifically generated for the agile process. By using the SharePoint site as a universal portal, even nonVisual Studio project stakeholders can interact with the VSTS work items and participate in project collaboration. |
Категории