Consulting Training Blog Careers About Us Contact Us

Unit Testing in Visual Studio 2010 Training

Course ID: UTVS2010
Duration: 2 Days

Upcoming Classes

Sorry, nothing scheduled right now. Click the Get Notified button below to be alerted when a class is scheduled.

Get Notified

On Site/Private

Can't find a class that fits right for you? Contact us to inquire about scheduling your own private class

Contact Us

Description

This two-day instructor-led course provides students with the knowledge and skills to effectively use Visual Studio 2010 to design, write, and run high-quality .NET unit tests.  The course focuses on the applicable features and capabilities of Visual Studio as it relates to unit testing and Test-Driven Development.  This course also introduces other, popular unit testing tools and techniques, and demonstrates how they integrate with Visual Studio and your development lifecyle. 

Bring This Course To You

For groups of 5 or more, let Intertech bring this course to your location. Customized versions tailored towards your objectives are also available.

Learn More

Learning Objectives

This course teaches students how to effectively design, write, and run high-quality unit tests using Visual Studio 2010. At course completion, attendees will have had exposure to these topics:

  • Why unit tests are critical to software quality
  • How unit tests and integration tests differ
  • Popular unit testing frameworks
  • The anatomy of a unit test
  • The 3A pattern (Arrange, Act, Assert)
  • Assertions and expected exceptions
  • Test class inheritance
  • Testing private methods
  • Visual Studio test projects
  • Visual Studio Test-related windows and tools
  • How basic and standard unit tests differ
  • How to unit test without access to source code
  • How and when to use categories and lists
  • How and when to use ordered tests
  • Running tests and managing test results
  • The importance of Test-Driven Development
  • Implementing TDD in Visual Studio 2010
  • How to effectively refactor within TDD
  • Why and how to refactor legacy code
  • Happy path vs. sad path testing
  • Testing boundary conditions
  • Organizing tests and test assemblies
  • Behavior-Driven Development principles
  • How to use data-driven unit tests
  • Why and how to calculate code coverage
  • Why and how to use test impact analysis
  • Team Foundation Server support for testing
  • Why and how to use continuous integration
  • Using dummies, fakes, stubs, and mocks
  • Why and how to use Rhino Mocks (3rd party)
  • Why and how to use Microsoft Pex
  • Why and how to use Microsoft Moles

Audience

This course is intended for current software development professionals, including architects, developers, and white-box testers who are involved with building .NET applications. The student will learn and receive hands-on experience using Visual Studio to design, write, and run high-quality .NET unit tests and learn the practice of Test-Driven Development.

Prerequisites

Before attending this course, students should have:

  • Experience creating, maintaining, and debugging software
  • Experience with the Visual C# language
  • Experience with Visual Studio 2005, 2008, or (preferably) 2010
  • Familiarity with their organization's development lifecycle

Course Outline

Unit Testing in .NET


This module introduces the fundamental concepts of unit testing and how it is supported by various unit testing frameworks and tools for .NET, including NUnit and MSTest.  The anatomy of a unit test is also detailed in this module.

  • The role of the developer
  • Unit tests explained
  • .NET unit testing frameworks
  • MSTest.exe
  • Writing unit tests

Unit Testing in Visual Studio 2010


This module introduces Visual Studio test projects, the testing windows, and the functionality for effectively writing and running unit tests and managing the test results. 

  • Testing support in Visual Studio 2010
  • Test projects
  • Testing windows
  • Unit testing in Visual Studio 2010
  • Managing a large number of tests 
  • Test categories vs. test lists
  • Running tests
  • Managing test results 

Test-Driven Development


This module introduces Test Driven Developent (TDD) and the business case for why you should practice it.  Refactoring and a discussion of how to work with legacy code are also a part of this module. 

  • What is TDD
  • TDD benefits
  • Common objections to TDD
  • Implementing TDD in Visual Studio 2010
  • Refactoring
  • Legacy Code

Writing Good Unit Tests


Just knowing how to write unit tests and being disciplined in TDD is not enough.  This module will demonstrate several other practices for ensuring that you write high-quality unit tests. 

  • Know your code
  • Path testing
  • The sad path
  • Right BICEP
  • Testing for expected exceptions
  • Maintaining high-quality test code
  • Behavior-Driven Development (BDD)
  • BDD naming conventions
  • Organizing test libraries (assemblies)

Leveraging Visual Studio 


This module examines additional unit testing features found in Visual Studio, including code coverage, data-driven unit tests, and test impact analysis.  In addition, many unit-testing specific features in Team Foundation Server and Team Foundation Build will be part of the discussion.

  • Code coverage
  • Using code coverage as a metric
  • Data-driven unit tests
  • Test impact analysis
  • Team Foundation Server
  • Testing check-in policy
  • Team Foundation Build
  • Build verification tests (BVTs)
  • Gated check-ins
  • Continuous Integration (CI)

Testing Difficult Code


This module introduces some tools and techniques for testing difficult code, such as code that can't be tested without being hosted in another environment (i.e. ASP.NET, SharePoint, etc).

  • What are doubles
  • Dummies, stubs, fakes, and mocks
  • Mocking Frameworks
  • Rhino Mocks
  • Microsoft Pex
  • Microsoft Moles

Free Resources from Intertech

Free eBook: Can a Project Be Too Small for Test Automation?

Free eBook: Top Freeware Picks for Developers

Free Tip Sheet: 10 Technologies Every .NET Developer Should Know

X