30
A Taste of Visual Studio 2005 David Grey

A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Embed Size (px)

Citation preview

Page 1: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

A Taste of Visual Studio 2005

David Grey

Page 2: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Introduction

In this session we will introduce Visual Studio 2005 and its features and examine those features that are most relevant to CS teaching

> Class Designer> Object Test Bench> Refactoring> Unit testing, static analysis and code coverage> Source control and Team Foundation Server

Page 3: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Introducing Visual Studio 2005

Page 4: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Overview

Visual Studio 2005 comes in several different editions> Express editions> Standard> Professional (supplied in MSDN AA)

Similar feature set to Visual Studio .NET 2003, plus Class Designer and Object Test Bench

> Team System editions Team Architect: Professional edition plus visual distributed application

and SOA design tools Team Developer: Professional edition plus unit testing, code coverage,

static analysis, profiling Team Tester: unit testing, code coverage, Web load testing, test

management> Team Suite (contains all of the Team System editions)> Team Foundation Server : Server back-end for Visual Studio which offers

source control, bug tracking and work item management, automated build and test, collaborative working tools

Page 5: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Visual Studio Express Editions

Completely free, stripped-down version of one of the technologies in Visual Studio 2005

Designed for hobbyists and teaching Ideal for introductory teaching

> Simpler user interface than Visual Studio> Software is freely available to all> Ships with wide range of sample starter applications

Express editions available:> Visual C# Express> Visual Basic Express> Visual C++ Express> Visual J# Express> Web Developer Express - supports ASP .NET development

Page 6: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Deploying Visual Studio 2005

Visual Studio 2005 will co-exist with Visual Studio .NET 2003

> Occasional errors with plug-ins registered against one version not working in the other

Visual Studio 2005 will co-exist with Visual Studio 2005 Express editions

> Can use Express editions for introductory programming courses and move to full version as confidence in the IDE grows

Page 7: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Introductory Teaching Features

Page 8: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Class Designer

Not a UML modelling tool but supports graphical design of classes

> Each class represented by a shape> Methods, properties, fields and events listed> New members can be added directly to the diagram

Tightly coupled to source code> Adding new members to diagram generates source for them> Modifying source updates the diagram

Good for > Understanding relationship between classes> Performing class-level design inside the IDE

Page 9: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

demodemo

Visual Studio 2005 IDE

Using Class Designer> Adding new classes

> Adding members to classes

> Source code integration

Page 10: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Object Test Bench

Designed for simple object-level testing Object Test Bench can be used for

> Teaching object-oriented programming concepts without going into language syntax.

> Testing simple classes and their methods.> Providing a lightweight testing tool designed for use on small

and simple projects.> Discovering the behaviour of a library API quickly.

Page 11: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

demodemo

Using Object Test Bench> Creating object instances

> Invoking methods

> Using other object instances

Page 12: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Refactoring

Visual Studio supports several source-code refactorings > Encapsulating a field as a property> Promoting a local variable to a parameter> Reordering method parameters> Extracting a block as new method> Extracting an interface from a class

When performing a refactoring, all affected code is updated Benefits

> Simplifies refactoring for novice programmers> Productivity improvements for experienced programmers> Allows consideration of refactoring and design issues without requiring large

amount of language experience

Page 13: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

demodemo

Refactoring with the Visual Studio IDE

Page 14: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Improving Coding Skills

Static Analysis, Refactoring and Testing

Page 15: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Static Analysis

Static analysis for .NET was previously only available in a 3rd party open source tool –FxCop

> FxCop integrated into IDE and build process in VS 2005 FxCop

> Extensible, rule driven static analysis tool> Detects known security issues and poor programming practices> Suggest ways to improve code and its performance> Customisable with configurable rule sets and custom rules> Pre-defined rules based on commercial best practice

Useful tool for students> Highlights limitations of their code> Suggests common performance and maintainability improvements> Helps improve coding standards by illustrating differences between student

code and commercial-grade code

Page 16: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

demodemo

Examining code with FxCop static analysis

Configuring FxCop

Integrating into the build process

Page 17: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Testing in Visual Studio 2005

Visual Studio 2005 has extensive testing tools> Team Tester version aimed solely at testers

Unit testing tool and code coverage integrated directly into the IDE

Code generation support for tests Other testing tools exist in VS but probably

less relevant to general-purpose CS teaching

Page 18: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Unit Testing

Easy to generate unit tests for code by right clicking the class or method

Generates one test case per method> Attempts to write sensible basic test as prelude to developer

writing the test properly> Auto-generates all code required to access private members

Promotes writing of tests after writing code> Doesn’t fit well with test driven approaches> Possible to write tests manually before code to be tested is

written but less IDE support for this

Page 19: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

demodemo

Creating unit tests

Test View and running unit tests

Page 20: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Code Coverage Analysis

Code coverage statistics can be generated during unit testing

> Configured through project properties

Detailed statistics shown in test results Tested/untested code paths highlighted

directly in source code view> Clear visualization of what has and has not been tested

Page 21: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

demodemo

Code coverage

Page 22: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Team Foundation Server

Visual Studio for Group Working

Page 23: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

What is Team Foundation Server? TFS is the server back-end for Visual Studio 2005 which

provides> Source control and check-in policies> Bug tracking and work item management> Automated building and testing> Project portal and reporting> Customizable software methodology templates

Supports collaborative working for software development teams Team Foundation features accessed through

> Team Explorer add-on client for VS 2005> Sharepoint portal for each project> Standard Office tools (e.g. Excel, Project, etc)

Team Foundation Server releases Q1 2006> Not available in MSDN AA

Page 24: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Team Foundation Source Control

Tight integration with IDE Based on SQL Server database

> Significant improvement over SourceSafe, though SourceSafe can still be used

> Supports complex branching and merging, concurrent check-out, code shelving

> Enables customisable check-in policies to be enforced e.g. code must pass FxCop analysis, defined set of unit

tests must be passed, code reviews performed, etc> Association of check-ins with work items and bug tracking

Page 25: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Work Item Management

Team Foundation Server enables> Definition of work items > Assignment of tasks to team members> Monitoring progress on tasks> Bug tracking, and assignment of tasks to resolve bugs

Sophisticated reporting tools provided which provide a range of software development metrics and predications

> e.g. bug rates, predicted completion dates, overall progress and quality

Page 26: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Project Portal

TFS creates a Sharepoint portal for each project

> Accessible only to team members> Provides access to a range of reports and intelligence

e.g. remaining work, daily bug rates, overall quality, outcomes of automated building and testing

> Document libraries and other data repositories for information sharing and communication between team members

> Guidance on chosen development methodology

Page 27: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

demodemo

Team Explorer client

Creating a Team Project> Assigning team members and setting permissions

Using Team Foundation source control

Project portal site

Team Foundation reports

Page 28: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Team Foundation and Group Working

TFS seems ideally suited to student group projects Source control means they can adopt proper working practices and

access source code from anywhere Work item assignment ideally suited for assigning tasks to group

members and management of group projects Project portal and reports allow teaching staff to transparently monitor

activity and progress on the project Portal document libraries can be used for storage and assessment of

project documentation (e.g. requirements, design diagrams, etc) Ability to plug Web parts in to portal means it can be customised to any

project process Process template can be customised to specific group project

processes, practices (and learning outcomes?)

Page 29: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

SummarySummary

In this presentation we have introduced the various versions of Visual Studio 2005 and have examined

> Class Designer> Object Test Bench> Refactoring> Unit testing, static analysis and code coverage> Source control> Team Foundation Server

Page 30: A Taste of Visual Studio 2005 David Grey. Introduction In this session we will introduce Visual Studio 2005 and its features and examine those features

Reading and ResourcesReading and Resources

Reading Hundhausen, Working with Microsoft Visual

Studio 2005 Team System, Microsoft Press, 2006