Delving into Visual Studio 2005 Team Edition for Software Developers Brian A. Randell Senior...
-
Upload
elwin-cooper -
Category
Documents
-
view
216 -
download
0
Transcript of Delving into Visual Studio 2005 Team Edition for Software Developers Brian A. Randell Senior...
Delving into Delving into Visual Studio 2005 Visual Studio 2005 Team Edition for Team Edition for Software DevelopersSoftware Developers
Delving into Delving into Visual Studio 2005 Visual Studio 2005 Team Edition for Team Edition for Software DevelopersSoftware Developers
Brian A. RandellBrian A. RandellSenior ConsultantSenior ConsultantMCW TechnologiesMCW Technologies
About BrianAbout Brian
Senior Consultant with Senior Consultant with MCW Technologies, LLCMCW Technologies, LLC
Contact me via my blog or e-mail: Contact me via my blog or e-mail: http://www.mcwtech.com/cs/blogs/brianr/ http://www.mcwtech.com/cs/blogs/brianr/
[email protected] [email protected]
Visual Basic MVPVisual Basic MVP
Author of Visual Studio 2005 Author of Visual Studio 2005 Team Edition for Database Professionals Team Edition for Database Professionals Hands-on LabsHands-on Labs
Manager and co-author of Manager and co-author of Microsoft SQL Server 2005 Microsoft SQL Server 2005 Hands-on LabsHands-on Labs
Author of Core Team System training courseAuthor of Core Team System training course
Co-author of Effective Visual BasicCo-author of Effective Visual Basic
Something Wicked This Way Comes …Something Wicked This Way Comes …
… And It’s Your Code!… And It’s Your Code!
AgendaAgenda
Why Quality Matters to YouWhy Quality Matters to You
Unit TestingUnit Testing
Code CoverageCode Coverage
Static AnalysisStatic Analysis
Dynamic AnalysisDynamic Analysis
Code ProfilingCode Profiling
Testing vs. DebuggingTesting vs. Debugging
““Testing is a means of detecting errors”Testing is a means of detecting errors”
““Debugging is a means of diagnosing and Debugging is a means of diagnosing and correcting the root causes of errors that correcting the root causes of errors that have already been detected”have already been detected”
Steve McConnell, Code Complete 2Steve McConnell, Code Complete 2ndnd Ed., p500 Ed., p500
Projects and TestingProjects and Testing
Often an expensive afterthoughtOften an expensive afterthought
Strategies for minimizing impactStrategies for minimizing impact
RequirementsCoding
IntegrationBeta Test
Post-Release
5
10
15
20
25
30
Relative CostTo Fix Bugs...
Why Quality Matters to YouWhy Quality Matters to You
Defect detection rates rarely rise above Defect detection rates rarely rise above 75% when using a single technique75% when using a single technique
The techniques average about 40%The techniques average about 40%
If you’re trying to achieve high defect-rate If you’re trying to achieve high defect-rate detection, you need to use a combination detection, you need to use a combination of techniquesof techniques
The bottom line: The bottom line:
You can’t just rely upon your test team—You can’t just rely upon your test team—quality begins with you!quality begins with you!
Steve McConnell, Code Complete 2Steve McConnell, Code Complete 2ndnd Ed., p470 Ed., p470
Tools Can HelpTools Can Help
Building software is hard—good tools can Building software is hard—good tools can helphelp
Visual Studio 2005 Professional is the Visual Studio 2005 Professional is the foundation for developers who want to foundation for developers who want to write solid, high-quality codewrite solid, high-quality code
Visual Studio 2005 Team Edition for Visual Studio 2005 Team Edition for Software Developers (VSTESD) brings Software Developers (VSTESD) brings testing to the developer as an integrated testing to the developer as an integrated feature—not an afterthoughtfeature—not an afterthought
Visual Studio Team SystemVisual Studio Team SystemVisual Studio Team SuiteVisual Studio Team Suite
MS
F P
rocess a
nd
Gu
idan
ce
MS
F P
rocess a
nd
Gu
idan
ce
Visual Studio Team Foundation ServerVisual Studio Team Foundation Server
VisualStudio
IndustryPartners
SoftwareSoftwareArchitectsArchitects
SoftwareSoftwareDevelopersDevelopers
SoftwareSoftwareTestersTesters
DatabaseDatabaseProfessionalsProfessionalsVisual
StudioTeam
ExplorerApplication Application ModelingModeling
Infrastructure Infrastructure and Deployment and Deployment
ModelingModeling
Code AnalysisCode Analysis
Performance Performance TuningTuning
Security AnalysisSecurity Analysis DatabaseDatabase Deployment Deployment
Database Database Change Change
ManagementManagementDatabase Database TestingTesting
Performance Performance TestingTesting
Manual TestingManual Testing
Test Case Test Case ManagementManagement
Visual Studio Professional Visual Studio Professional EditionEdition
Change ManagementChange Management
Work Item TrackingWork Item Tracking
ReportingReporting
Project SiteProject Site
Integration ServicesIntegration Services
Project ManagementProject Management
Load Test AgentLoad Test Agent
Visio and UML Visio and UML ModelingModeling
Class Class ModelingModeling
Unit TestingUnit Testing
Code Code CoverageCoverage
New!
Unit TestingUnit Testing
The process of running repeatable, The process of running repeatable, programmatic tests, generally written by a programmatic tests, generally written by a developer, against some code (a class, set developer, against some code (a class, set of methods, individual method, etc)of methods, individual method, etc)
Formalizes the process of test rigsFormalizes the process of test rigs
Whole “lifestyle” dedicated to it—Test Whole “lifestyle” dedicated to it—Test Driven Development (TDD)Driven Development (TDD)
Unit Testing in VSTESDUnit Testing in VSTESD
Explicit Test Project TypeExplicit Test Project TypeCan be created by you or by Visual StudioCan be created by you or by Visual Studio
Test artifacts that support code can be C#, Test artifacts that support code can be C#, Visual Basic, or Managed C++Visual Basic, or Managed C++
Right-click support forRight-click support forTest project and member generation from most Test project and member generation from most project types (Class libraries, Windows Forms, project types (Class libraries, Windows Forms, etc.)etc.)
Member generation from test projectsMember generation from test projects
Can run tests against any managed target Can run tests against any managed target and most unmanaged targets (just might and most unmanaged targets (just might require code and effort on your part)require code and effort on your part)
Unit Testing RuntimeUnit Testing Runtime
Tests can be run inside or outside of Visual Tests can be run inside or outside of Visual StudioStudio
VSTestHost.exe spawned when running via VSTestHost.exe spawned when running via the debuggerthe debugger
MSTest.exe supports command-line MSTest.exe supports command-line integrationintegration
Unit Testing and C++Unit Testing and C++
Only supports “production code”Only supports “production code”Unmanaged—callable from a static library, Unmanaged—callable from a static library, an .obj file, or a DLL entry point. an .obj file, or a DLL entry point.
Only traditional native binding mechanisms workOnly traditional native binding mechanisms work
Mixed—project that uses the /clr compiler Mixed—project that uses the /clr compiler option.option.
As long as it’s not an EXE any callable method in your As long as it’s not an EXE any callable method in your code can be called and tested.code can be called and tested.
Safe or Pure--any callable assembly method can Safe or Pure--any callable assembly method can be called and testedbe called and tested
EXE or DLLEXE or DLL
Right-click generation only supported from Right-click generation only supported from projects using /clr:safe compiler optionprojects using /clr:safe compiler option
Team Foundation Server Team Foundation Server IntegrationIntegration
Work items—bugs, tasks, etc.—can be Work items—bugs, tasks, etc.—can be created from Test Results windowcreated from Test Results window
Test results can be published to TFSTest results can be published to TFS
Tests can be run as part of nightly or Tests can be run as part of nightly or integration builds via Team Buildintegration builds via Team Build
Code CoverageCode Coverage
Code Coverage allows you to see what Code Coverage allows you to see what code is being executed, neé covered, and code is being executed, neé covered, and what code is notwhat code is not
This is accomplished by instrumenting the This is accomplished by instrumenting the assemblyassembly
Support for both managed and native codeSupport for both managed and native code
What’s going on inside?What’s going on inside?
New assembly is generatedNew assembly is generated
Two types are added in custom namespaceTwo types are added in custom namespace
Methods are injected with calls to internally Methods are injected with calls to internally generated classgenerated class
A minimum of two calls are addedA minimum of two calls are addedOne to registerOne to register
one to track entryone to track entry
Additional calls based upon coding constructs Additional calls based upon coding constructs like conditionals, loops, etc.like conditionals, loops, etc.
External dependency on VSCover80.dllExternal dependency on VSCover80.dll
Code Coverage in VSTESDCode Coverage in VSTESD
Instrumentation of assemblies does not Instrumentation of assemblies does not occur until tests are run with Code occur until tests are run with Code Coverage enabledCoverage enabled
Done on a per assembly basisDone on a per assembly basis
Programmatic access to coverage data Programmatic access to coverage data possible via managed interfacespossible via managed interfaces
Full command-line support via three tools:Full command-line support via three tools:Instrumentation—vsinstr.exeInstrumentation—vsinstr.exe
Monitoring—VSPerfMon.exeMonitoring—VSPerfMon.exe
Control—VSPerfCmd.exeControl—VSPerfCmd.exe
TFS IntegrationTFS Integration
Work items—bugs, tasks, etc.—can be Work items—bugs, tasks, etc.—can be created from Test Results window linking created from Test Results window linking to test with code coverageto test with code coverage
Code coverage data can be included with Code coverage data can be included with test results that are published to TFStest results that are published to TFS
Code coverage can be run with tests as Code coverage can be run with tests as part of a nightly or integration build via part of a nightly or integration build via Team BuildTeam Build
Things to watch out forThings to watch out for
Cannot debug assemblies that have Code Cannot debug assemblies that have Code Coverage enabledCoverage enabled
It is possible to not get 100% code It is possible to not get 100% code coveragecoverage
My in Visual Basic projectsMy in Visual Basic projects
Certain conditional or looping operationsCertain conditional or looping operations
Static Code AnalysisStatic Code Analysis
Support for both managed and unmanaged Support for both managed and unmanaged codecode
Evolution of FxCop for managed Evolution of FxCop for managed developersdevelopers
Post compilation analysis of compiled ILPost compilation analysis of compiled IL
PREfast for C++ developersPREfast for C++ developersAnalysis done during build processAnalysis done during build process
Static Code Analysis in VSTESDStatic Code Analysis in VSTESD
Managed projects have a new property Managed projects have a new property page labeled Code Analysispage labeled Code Analysis
Check-box to turn it on; 11 categories of rulesCheck-box to turn it on; 11 categories of rules
Violation of rules can trigger warning or errorViolation of rules can trigger warning or error
Can decorate code with attributes to suppress a Can decorate code with attributes to suppress a warning (right-click support from Error List warning (right-click support from Error List window)window)
Use FxCopCmd.exe at the command lineUse FxCopCmd.exe at the command line
C++ projects done via Code Analysis node C++ projects done via Code Analysis node under Configuration Propertiesunder Configuration Properties
Can use /analyze switch at command line Can use /analyze switch at command line
TFS IntegrationTFS Integration
Work items—bugs, tasks, etc.—can be Work items—bugs, tasks, etc.—can be created from Error List windowcreated from Error List window
Source Code Control Policy can be used to Source Code Control Policy can be used to enforce code analysis before check-inenforce code analysis before check-in
Support for migration of policy from server to Support for migration of policy from server to solutions on client machinessolutions on client machines
Support for both managed and C++ projectsSupport for both managed and C++ projects
Code analysis can be run as part of nightly Code analysis can be run as part of nightly or integration builds via Team Buildor integration builds via Team Build
Things to watch out forThings to watch out for
Customization of rules not possible for C+Customization of rules not possible for C++ in this release+ in this release
Customization of rules for managed code is Customization of rules for managed code is discourageddiscouraged by product team by product team
It’s not officially supported or documented It’s not officially supported or documented
Issues with policy migration to new Visual Issues with policy migration to new Visual Studio 2005 Web Project typesStudio 2005 Web Project types
Dynamic Code AnalysisDynamic Code Analysis
Application Verifier catches heap, handle Application Verifier catches heap, handle and lock errors in native applicationsand lock errors in native applications
Used with C++ projects during runtime Used with C++ projects during runtime onlyonly
Available via Debug | Start With Available via Debug | Start With Application VerifierApplication Verifier
Things to watch out forThings to watch out for
You must be an administrator on the You must be an administrator on the system that you are using in order to run system that you are using in order to run Application Verifier Application Verifier
Application Verifier only runs on Windows Application Verifier only runs on Windows XP and Windows Server 2003XP and Windows Server 2003
I’ve not tried it on Vista or Longhorn server yetI’ve not tried it on Vista or Longhorn server yet
Code ProfilingCode Profiling
Support two modes of application profiling Support two modes of application profiling for both managed and native applicationfor both managed and native application
Sampling captures runtime data on a Sampling captures runtime data on a periodic basis without modification of the periodic basis without modification of the applicationapplication
Generally best for isolating hot spotsGenerally best for isolating hot spots
Instrumentation modifies binaries by Instrumentation modifies binaries by inserting probes and provides very inserting probes and provides very granular informationgranular information
Generally used after a hot spot is found and Generally used after a hot spot is found and you want to dig deeperyou want to dig deeper
Code Profiling in VSTESDCode Profiling in VSTESD
Can be started from Visual Studio via Tools Can be started from Visual Studio via Tools | Performance Tools| Performance Tools
Can also generate performance session Can also generate performance session from a test via the Test Results windowfrom a test via the Test Results window
However doesn’t work correctly for C++ However doesn’t work correctly for C++ projectsprojects
Rich Command Line SupportRich Command Line Support
VsPerfCLREnv.exe to setup and cleanupVsPerfCLREnv.exe to setup and cleanup
VsPerfCmd.exe to start and stopVsPerfCmd.exe to start and stopVsPerfMon.exe for advanced profilingVsPerfMon.exe for advanced profiling
vsinstr.exe to instrument your assembliesvsinstr.exe to instrument your assemblies
VsPerfReport.exe to analyze reportsVsPerfReport.exe to analyze reports
TFS IntegrationTFS Integration
Not muchNot much
No right-click support for SCC or Work No right-click support for SCC or Work ItemsItems
Performance window is its own window is Performance window is its own window is its own windowits own window
Things to watch out forThings to watch out for
Make sure you setup a symbol server or Make sure you setup a symbol server or hook up to Microsoft’s to see external hook up to Microsoft’s to see external member namesmember names
Profiling can generate TONS of dataProfiling can generate TONS of dataMake sure you have lots of disk spaceMake sure you have lots of disk space
Can’t profile in sampling mode under Can’t profile in sampling mode under Virtual PCVirtual PC
Only supports .NET 2.0 managed Only supports .NET 2.0 managed applicationsapplications
Does not support 64-bit applicationsDoes not support 64-bit applications
Add a post-compilation event to re-sign Add a post-compilation event to re-sign assemblies if your profiling code with assemblies if your profiling code with strong namesstrong names
3rd Party Tools3rd Party Tools
SPI DynamicsSPI DynamicsComprehensive Find and Fix Approach: DevInspect and Comprehensive Find and Fix Approach: DevInspect and SecureObjects accelerate the construction and delivery SecureObjects accelerate the construction and delivery of secure Web applications by identifying vulnerabilities of secure Web applications by identifying vulnerabilities and fixing insecure source code within Visual Studio 2005 and fixing insecure source code within Visual Studio 2005
DevInspect and SecureObjects leverage Visual Studio DevInspect and SecureObjects leverage Visual Studio 2005 Team System’s source control system and code 2005 Team System’s source control system and code check-in policies to prevent developers from checking check-in policies to prevent developers from checking insecure source code. insecure source code.
For more information:For more information:http://www.spidynamics.com/products/devinspect/http://www.spidynamics.com/products/devinspect/index.html index.html
http://www.spidynamics.com/products/devinspect/http://www.spidynamics.com/products/devinspect/datasheet.html datasheet.html
VSTS Breakout SessionsVSTS Breakout Sessions
DEV311 - Delving into Visual Studio 2005 Team Edition for DEV311 - Delving into Visual Studio 2005 Team Edition for Software TestersSoftware Testers
6/12/2006 5:00PM-6:15PM 104 ABC6/12/2006 5:00PM-6:15PM 104 ABC
DEV217 - Introducing Visual Studio 2005 Team Edition for DEV217 - Introducing Visual Studio 2005 Team Edition for Database ProfessionalsDatabase Professionals
6/13/2006 10:15AM-11:30AM 104 ABC6/13/2006 10:15AM-11:30AM 104 ABC
DAT312 - Managing and Deploying Your SQL Server DAT312 - Managing and Deploying Your SQL Server Schemas with Visual Studio Team Edition for Database Schemas with Visual Studio Team Edition for Database ProfessionalsProfessionals
6/13/2006 1:00PM-2:15PM 156 ABC6/13/2006 1:00PM-2:15PM 156 ABC
DAT320 - Testing and Refactoring Your Database with Visual DAT320 - Testing and Refactoring Your Database with Visual Studio Team Edition for Database ProfessionalsStudio Team Edition for Database Professionals
6/14/2006 8:30AM-9:45AM 160 ABC6/14/2006 8:30AM-9:45AM 160 ABC
DEV327 - Visual Studio 2005 Team Foundation Server (Part DEV327 - Visual Studio 2005 Team Foundation Server (Part 1): Applying Version Control, Work Item Tracking and Team 1): Applying Version Control, Work Item Tracking and Team Build to Your Software Development Project Build to Your Software Development Project
6/14/2006 10:15AM-11:30AM 160 ABC6/14/2006 10:15AM-11:30AM 160 ABC
VSTS Breakout SessionsVSTS Breakout Sessions
DEV429 - Visual Studio 2005 Team Foundation Server (Part DEV429 - Visual Studio 2005 Team Foundation Server (Part 2): Developing Custom Process Templates, Work Item Types 2): Developing Custom Process Templates, Work Item Types and Policies and Policies
6/14/2006 2:00PM-3:15PM 160 ABC6/14/2006 2:00PM-3:15PM 160 ABC
DEV233 - Visual Studio 2005 Team Foundation Server: Using DEV233 - Visual Studio 2005 Team Foundation Server: Using Metrics to Manage and Troubleshoot Your Projects Metrics to Manage and Troubleshoot Your Projects
6/14/2006 5:30PM-6:45PM 153 ABC6/14/2006 5:30PM-6:45PM 153 ABC
DEV237 - Visual Studio 2005 Team Foundation Server: Step-DEV237 - Visual Studio 2005 Team Foundation Server: Step-by-Step Migration and Adoption Planning by-Step Migration and Adoption Planning
6/15/2006 9:45AM-11:00AM 104 ABC6/15/2006 9:45AM-11:00AM 104 ABC
DEV439- Visual Studio 2005 Team System and Microsoft DEV439- Visual Studio 2005 Team System and Microsoft Solution Framework: Implementing an Agile or CMMI Process Solution Framework: Implementing an Agile or CMMI Process
6/15/2006 1:00PM-2:15PM 156 ABC6/15/2006 1:00PM-2:15PM 156 ABC
DAT433DAT433 Under the Hood of Visual Studio Team Edition Under the Hood of Visual Studio Team Edition for Database Professionals 6/15/2006 for Database Professionals 6/15/2006
1:00PM-2:15PM 160 ABC1:00PM-2:15PM 160 ABC
VSTS HOL / TCLVSTS HOL / TCL
Hands on LabsHands on LabsDEV005 Streamlining your Development Process with DEV005 Streamlining your Development Process with Visual Studio 2005 Team SystemVisual Studio 2005 Team SystemDEV008 Take a Tour of Visual Studio 2005 Team System DEV008 Take a Tour of Visual Studio 2005 Team System for Database Professionalsfor Database Professionals
ChalktalksChalktalksBuilding Quality In: Visual Studio Team System and Building Quality In: Visual Studio Team System and Continuous Integrated TestingContinuous Integrated Testing
DEV TLC Theatre 6/14/2006 8:30AM-9:45AMDEV TLC Theatre 6/14/2006 8:30AM-9:45AMTeamlook and TeamSpec in Context Modeling that Teamlook and TeamSpec in Context Modeling that Supports Visual Studio 2005 Supports Visual Studio 2005
DEV TLC Theatre 6/14/2006 5:30PM-6:45PMDEV TLC Theatre 6/14/2006 5:30PM-6:45PMModeling that Supports Visual Studio 2005Modeling that Supports Visual Studio 2005
DEV TLC Theatre 6/14/2006 5:30PM-6:45PMDEV TLC Theatre 6/14/2006 5:30PM-6:45PMVisual Studio Team Edition for Database Professionals: Visual Studio Team Edition for Database Professionals: Overview Overview
DEV TLC Theatre 6/15/2006 9:45AM-11:00AMDEV TLC Theatre 6/15/2006 9:45AM-11:00AMCode Generation and Model Execution from DSL ToolsCode Generation and Model Execution from DSL Tools
DEV TLC Theatre 6/15/2006 2:45PM-4:00PMDEV TLC Theatre 6/15/2006 2:45PM-4:00PM
SummarySummary
Quality is everyone’s jobQuality is everyone’s job
Use the tools when it makes senseUse the tools when it makes sense
Questions?Questions?I’m here all week or contact me via my blog or I’m here all week or contact me via my blog or e-mail: e-mail:
http://www.mcwtech.com/cs/blogs/brianr/ http://www.mcwtech.com/cs/blogs/brianr/
ResourcesResourcesTechnical Chats and Webcastshttp://www.microsoft.com/communities/chats/default.mspx http://www.microsoft.com/usa/webcasts/default.asp
Microsoft Learning and Certificationhttp://www.microsoft.com/learning/default.mspx
MSDN & TechNet http://microsoft.com/msdnhttp://microsoft.com/technet
Virtual Labshttp://www.microsoft.com/technet/traincert/virtuallab/rms.mspx
Newsgroupshttp://communities2.microsoft.com/communities/newsgroups/en-us/default.aspx
Technical Community Siteshttp://www.microsoft.com/communities/default.mspx
User Groupshttp://www.microsoft.com/communities/usergroups/default.mspx
Fill out a session Fill out a session evaluation on evaluation on CommNet for CommNet for
a chance toa chance toWin an XBOX Win an XBOX
360!360!
© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.