Presentation is loading. Please wait.

Presentation is loading. Please wait.

Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College

Similar presentations


Presentation on theme: "Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College"— Presentation transcript:

1 Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College hummel@lakeforest.edu http://164.68.21.9/hummel/workshops.htm hummel@lakeforest.edu http://164.68.21.9/hummel/workshops.htm Lecture 3: Visual Studio 2005 Team System

2 3-2 3. VSTS 2005 3.1 Visual Studio 2005 Overview of Visual Studio editions Overview of new features

3 3-3 3. VSTS 2005 Visual Studio 2005 Editions Express: free IDE, one for each language / platform Standard: base line IDE (one for all languages and platforms) Professional: adds tools, SQL Server Express for database access Team Editions: Three separate software engineering editions: Architect, Developer, Tester Team Suite: All three software engineering editions in one package Team Foundation Server The server-side component for the team editions / suite Source code control, process management, task/bug lists, reporting, etc. Built-in support for two SE processes: Agile and Waterfall MSDNAA provides all editions of VS 2005, however TFS is trial only…

4 3-4 3. VSTS 2005 New Features in VS 2005 Here are some of the more interesting new features in Professional & Team System editions: –Class Designer –Object Test Bench –Refactoring –Code snippets

5 3-5 3. VSTS 2005 Class Designer Class Designer allows you to design classes visually –much like UML class designer tools –Project menu, Add New Item…, Class Diagram…

6 3-6 3. VSTS 2005 Object Test Bench Object Test Bench lets you interact with objects without code –right-click, instantiate, inspect data and call methods –identical to the idea behind the BlueJ Java IDE –View menu, Other Windows…

7 3-7 3. VSTS 2005 Refactoring Refactoring provides tool support for redesigning code –renaming, turning code into methods, encapsulating fields, etc. –refactoring is an important aspect of Agile programming –View code in Editor pane, Refactor menu… public class Sailboat { private string m_Name; // private field public string Name // public property { get { return this.m_Name; } set { this.m_Name = value; } } public class Sailboat { private string m_Name; // private field public string Name // public property { get { return this.m_Name; } set { this.m_Name = value; } }

8 3-8 3. VSTS 2005 Code Snippets Code snippets are templates for common coding idioms –equals, foreach, properties, constructors, try-catch-finally, etc. –Edit menu, IntelliSense, Insert Snippet…

9 3-9 3. VSTS 2005 3.2 Visual Studio 2005 Team System Overview of Team System Overview of Team Foundation Server Common use cases

10 3-10 3. VSTS 2005 Visual Studio Team System (VSTS) Microsoft’s toolset for software engineering –Design –Implementation –Testing –Profiling –Deployment –Maintenance –Management –Collaboration VS Team Edition VS Team System Foundation Server VS Team System Foundation Server … VS Team Edition MS Project SQL Server MS Excel

11 3-11 3. VSTS 2005 VSTS Capabilities Dynamic Code Analyzer Visual Studio Team Edition for Software Architects Static Code AnalyzerCode ProfilerUnit Testing Code Coverage Visio and UML ModelingTeam Foundation Client VS ProClass Modeling Load TestingManual Testing Test Case Management Application Modeling Logical Infra. Modeling Deployment Modeling Visual Studio Team Edition for Software Testers Visual Studio Team Edition for Software Developers Visual Studio Team Foundation Server

12 3-12 3. VSTS 2005 VSTFS Visual Studio Team Foundation Server –integrates with VS, IE, MS Project, MS Excel, cmd-line –enterprise-level version control, reporting, tracking, etc. –built on top of SQL Server 2005, web services, etc. –example: –real source code version control, not Visual SourceSafe Change ManagementWork Item Tracking ReportingProject Site Visual Studio Team Foundation Server Integration ServicesProject Management MS Project SQL Server MS Excel VSTE IE

13 3-13 3. VSTS 2005 Common Use Cases of VSTS Initially, the most common use cases are: –Unit testing –Code coverage –Source code control NOTE: unit testing and code coverage are self-contained within VSTS; source code control requires interaction with VSTFS.

14 3-14 3. VSTS 2005 (1) Unit Testing First, create a test harness (one per class?): –Test menu, New Test… –adds a *new* project to the current VS solution

15 3-15 3. VSTS 2005 Writing a Test Harness A test harness == 1 or more test classes & methods –attributes identify test harness to VSTS testing engine –if test method returns normally, considered a successful test — if test method throws an exception, considered a failure [TestClass] public class SailboatTest { [TestMethod] public void TestMethod1() { Sailboat s; double speed, expected, diff; s = new Sailboat("A2", 36.33); speed = s.Hullspeed(); expected = 8.08; diff = speed – expected; Assert.IsTrue(Math.Abs(diff) < 0.1); }. } [TestClass] public class SailboatTest { [TestMethod] public void TestMethod1() { Sailboat s; double speed, expected, diff; s = new Sailboat("A2", 36.33); speed = s.Hullspeed(); expected = 8.08; diff = speed – expected; Assert.IsTrue(Math.Abs(diff) < 0.1); }. } public class Sailboat {. } public class Sailboat {. }

16 3-16 3. VSTS 2005 Executing a Test Harness Various ways to execute your test harness: –Select test project as startup, F5 –Test menu, Start Selected Test Project with Debugger –Test menu, Windows, Test Manager, check individual tests to run, right-click on pane, select Debug Checked Tests Test results are collected & displayed –results also saved in a TestResults folder –useful for nightly builds and test runs, then view results in the morning

17 3-17 3. VSTS 2005 Unit Test Wizard Unit Test Wizard will stub out test methods for you Test Menu, New Test, Unit Test Wizard… –No silver bullet, writing good unit tests is hard work…

18 3-18 3. VSTS 2005 (2) Code Coverage How much of the code did your tests exercise? VSTS will collect this data, just need to configure: –in Solution Items, double-click.testrunconfig –select Code Coverage from list –select.exe containing class(es) you are testing –Apply and Close –run test harness without debugger (Ctrl-F5) –Test menu, Windows, Code Coverage Results drill-down into.exe & expand classes statistics on % covered & uncovered double-click on methods to view code

19 3-19 3. VSTS 2005 (3) Source Code Control Source code control tracks changes to code & other items –VS 2005 Team System acts as client — requires Team Explorer plug-in –VS 2005 TS clients then interact with VS Team Foundation Server Visual Studio Team Foundation Server SQL Server Visual Studio Team Edition / Suite Team Explorer

20 3-20 3. VSTS 2005 Connecting to TFS First, connect using the Tools menu: –specify the server, and the project(s) to open

21 3-21 3. VSTS 2005 Team Explorer Once connected, your Team Explorer window is the key –right-click on server to connect to existing projects –right-click on server to create new projects –double-click on project's Source Control to open Source Control explorer –etc. Visual Studio creates workspaces on the client to keep track of client-side items checked-in & out of TFS –see File menu, Source Control, Workspaces…

22 3-22 3. VSTS 2005 Creating a New Team Project To create a new project, right-click on server in Team Explorer –you must have admin rights in that TFS

23 3-23 3. VSTS 2005 First Time Checking-in You just created a new Team project, and want to check-in… Open existing solution, right-click, add to Source Control –workspace is created to maintain association with TFS –when you're ready to check-in, File menu >> Source Control >> Check-in

24 3-24 3. VSTS 2005 First Time Checking-out You want to join an existing project, and need to check-out… Create a new workspace & use Source Control explorer –File menu >> Workspaces >> Add… –Team Explorer >> Source Control >> right-click >> Get Latest Version –open local copy of solution

25 3-25 3. VSTS 2005 Working with Team Projects Just work locally as you normally would… –when you edit items, VS will automatically check-out –notice icons in Solution Explorer –you are responsible for check-in — right-click on item in Solution Explorer or batch check-ins using Source Control explorer

26 3-26 3. VSTS 2005 3.3 What's Next? Lab exercise #3


Download ppt "Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College"

Similar presentations


Ads by Google