You are on page 1of 36

Visual Studio Team System 2008

Overview

Adopting Visual Studio Team System 2008
Mickey Williams Director, Center of Excellence
mickey.williams@neudesic.com

Visual Studio Team System 2008

Visual Studio Team System 2008 Architecture Edition

capturing intent of developers and IT Professionals Applications – System topology – Developer constraints – IT policy Application Hosts – Installation directives – Health model – Monitoring rules Network Topology – Service Level Agreements & OS – Reports Hardware 4 . • System Definition Model (SDM): – A formal model of a complete system – All information pertinent to deployment and operations ? ? • Machine-readable.

Visual Studio Team System 2008 Development Edition .

Agenda • Code Analysis • Code Coverage • Profiling 6 .

Agenda • Code Analysis • Code Coverage • Profiling 7 .

Code Analysis • Evaluating code without execution – Managed & unmanaged code – Integrated with IDE – Callable from the command line • Great way of finding bugs earlier in your development cycle – Costs less when you find bugs early – Code review in a box • Can be used at the Team level – Part of your build process – Part of your check-in policy 8 .

NET assemblies – Supports all managed languages • Enforces Design Guidelines • Customizable – Which checks to include – Whether to report as error or warning – Create custom rules 9 . Code Analysis for Managed Code • Based on FxCop • Static analysis for .

dll and Microsoft.com/fxcop/ 10 .Cci.dll – Add a rules definition XML file – Inherit from BaseIntrospectionRule – Override the Check method • Client side installation – Must be deployed on developer workstations and build servers utilizing static analysis › Copy the rule DLL to the client machine • See http://blogs. Custom Code Analysis Rules • Create using a VS Class Library – Reference FxCopSdk.msdn.

Agenda • Code Analysis • Code Coverage • Profiling 11 .

Code Coverage • Measure test effectiveness • Line-by-line • Block-by-Block • Assemblies must be instrumented – Done automatically by Visual Studio when needed • Results sent to viewer or XML file 12 .

Agenda • Code Analysis • Code Coverage • Profiling 13 .

Profiling • Gather information on application timing and performance • Integrated into VSTS • Used by many internal teams and on customer engagements • Two measurement methods – Sampling gathers information at fixed intervals on whatever is executing – Instrumentation records every call 14 .

Agenda • Code Analysis • Code Coverage • Profiling 15 .

New Features for 2008 • Code metrics • Improved profiling – “Hot Pathing” to pinpoint problem – WCF support – Load/Web test integration – Baseline support • Customize code correctness policies • Better profile report compression • Saving analysis 16 .

The 5 Code Metrics .

Metric: Class Coupling # of Dependencies Between Types Business Logic GUI Transaction Customer Account 18 .

Metric: Class Inheritance # of Base Types Component Control ListControl Label ComboBox ListBox LinkLabel 19 .

EnableVisualStyles().SetCompatibleTextRenderingDefault(false). "/?")) { ShowAbout(). } #endregion #region Static Methods /// <summary> Primary workflow for the application. 2 Application. } 20 . /// </summary> [STAThread] static void Main(string[] args) { 1 Application. return. // Show usage syntax if the user so asks 5 if (UseArg(args. </param> private static void Workflow(string[] cmdargs) { // Collect the list of command line arguments 4 List<string> args = new List<string>(cmdargs).Metric: Lines of Code # of Executing Lines of Code static class Program { #region Application Entry Point /// <summary> /// The main entry point for the application. 3 Workflow(args). </summary> /// <param name="args"> Command line arguments.

} 21 . i < args. 9 case "/c" : Colapse = true.Length > i && File. 10 break. i++) switch (args[i]) { 3 case "/?" : ShowHelp(). return. } 11 return true. 8 break.Length.7 if (args.Metric: Cyclomatic Complexity # of Branches bool ParseCommandLine(string[] args) { 1 if (args. 5 case "/input" : 6. 4 return false.Exists(args[i + 1])) InputFile = args[i++].Length == 0) ShowHelp(). 2 for (int i = 0.

cmu. http://www.2 * log2(Halstead Volume) - 0.sei. Operating. New York. 1977. Elements of Software Science. 22 . Software Engineering Institute.16. and Programming Systems Series Volume 7.5. NY: Elsevier.html [Halstead 1] Halstead.23 * (Cyclomatic Complexity) .edu/str/descriptions/mitmpm.Metric: Maintainability Index – Overall indication of complexity by aggregation of several factors [Carnegie 1] – Lines of Code – Cyclomatic Complexity – Computational Complexity [Halstead 1] • Used on the Windows Code Base Maintainability Index = 171 . Maintainability Index Technique for Measuring Program Maintainability.2 * log2(Lines of Code) [Carnegie 1] Carnegie Mellon University. Maurice H.

Visual Studio Team System 2008 Database Edition .

Product Overview • Database project system – Supports schema and script versioning – Schema build & deploy • Schema compare • Data compare • Database unit testing • Test data generator • Schema refactoring • T-SQL editor with query execution • Work item and process integration with TFS 24 24 .

SQL script files (*) 25 25 . Database Development Life Cycle The cycle of life for database developers SQL Import database schema Server Database Database Project Database Template Create New Project Project SQL Script Reverse engineer existing .

Database Development Life Cycle The cycle of life for database developers Edit Refactor Compare Database Deploy Build Project Data Generation Test Compare 26 26 .

SQL script files Database 27 27 . Database Development Life Cycle The cycle of life for database developers SQL Import database schema Server Deploy Database SQL Script Build project Database Database Project Create New Project Project Template Deploy project SQL SQL Server Script Reverse engineer existing .

Visual Studio Team System 2008 Test Edition .

Agenda • Web Tests • Load Tests • Ordered Tests 29 .

Web Testing • Very easy to create basic web tests – Record/playback scenario – Can be converted to coded tests – Can be data-driven • Tests HTTP requests and results only – Not a UI testing tool • Will record AJAX calls – New in VSTS 2008 30 .

branched. labeled • Tests have full access to . Visual Studio Integration • Fully integrated into Visual Studio Team System – Simplifies adoption and integration – Test Manager and Test View are integrated into the shell – Very easy to create a work item based on a failed test – Tests are considered equal partners to code › Can be versioned.NET Framework – Tests can be written in any .NET language – Can be inspected using the Visual Studio debugger 31 .

Agenda • Web Tests • Load Tests • Ordered Tests 32 .

add agent machines as needed • Efficient load generation – About 1000 users from a typical test machine • Supports testing against web farms – Ensures that load is applied to the actual production scenario • Test controller is licensed per machine. agents per CPU – Not licensed per virtual user – Results in significant cost reduction – Enables team-based load testing • Performance counters collected on load agents and machines under test • Load Test Monitor enables monitoring a test in progress 33 . Key Benefits – Load Testing • Scale out load generation – Enables multiple commodity machines to be used to drive load – One controller.

Load Testing • A load test can contain any automated test – Web tests. virtual users. and think times 34 . unit tests • Load tests can be run on a developer’s machine – Load test early and often – Specialized hardware not required • Load test agents and load test agent controllers used when scaling out – Load test agent controller runs as a service – Each load test agent can test about 1000 users • Load test parameters include: – Test mix – Monitored performance counters – Ramp-up.

Ordered Tests • Test containers that incorporate other tests – Except load tests – May include manual tests • Useful when testing across test and list hierarchy – Regression test bundles – Features that cross multiple teams • Guarantees that tests are executed in a specific order – One pass/fail result for the entire container – Individual results can be viewed (double click results to drill-down) – Manual tests will be bypassed when running remotely 36 .

Questions? .